LibreOffice Module registry (master)  1
Macros | Functions | Variables
reflwrit.cxx File Reference
#include <new>
#include <memory>
#include <algorithm>
#include <sal/types.h>
#include <osl/endian.h>
#include <rtl/string.hxx>
#include <rtl/ustring.hxx>
#include "reflwrit.hxx"
#include <registry/refltype.hxx>
#include <registry/version.h>
#include <registry/writer.h>
#include "reflcnst.hxx"
Include dependency graph for reflwrit.cxx:

Go to the source code of this file.

Macros

#define BLOP_OFFSET_MAGIC   0
 
#define BLOP_OFFSET_SIZE   (BLOP_OFFSET_MAGIC + sizeof(sal_uInt32))
 
#define BLOP_OFFSET_MINOR   (BLOP_OFFSET_SIZE + sizeof(sal_uInt32))
 
#define BLOP_OFFSET_MAJOR   (BLOP_OFFSET_MINOR + sizeof(sal_uInt16))
 
#define BLOP_OFFSET_N_ENTRIES   (BLOP_OFFSET_MAJOR + sizeof(sal_uInt16))
 
#define BLOP_HEADER_N_ENTRIES   6
 
#define BLOP_FIELD_N_ENTRIES   6
 
#define BLOP_METHOD_N_ENTRIES   5
 
#define BLOP_PARAM_N_ENTRIES   3
 
#define BLOP_REFERENCE_N_ENTRIES   4
 

Functions

sal_uInt32 UINT16StringLen (const sal_uInt8 *wstring)
 
sal_uInt32 writeString (sal_uInt8 *buffer, const sal_Unicode *v)
 
sal_uInt32 readString (const sal_uInt8 *buffer, sal_Unicode *v, sal_uInt32 maxSize)
 
sal_uInt32 writeFloat (sal_uInt8 *buffer, float v)
 
sal_uInt32 writeDouble (sal_uInt8 *buffer, double v)
 
static void TYPEREG_CALLTYPE release (TypeWriterImpl hEntry)
 
sal_Bool TYPEREG_CALLTYPE typereg_writer_setFieldData (void *handle, sal_uInt16 index, rtl_uString const *documentation, rtl_uString const *fileName, RTFieldAccess flags, rtl_uString const *name, rtl_uString const *typeName, RTValueType valueType, RTConstValueUnion valueValue) SAL_THROW_EXTERN_C()
 Sets the data of a field of a type writer. More...
 
static void TYPEREG_CALLTYPE setFieldData (TypeWriterImpl hEntry, sal_uInt16 index, rtl_uString const *name, rtl_uString const *typeName, rtl_uString const *doku, rtl_uString const *fileName, RTFieldAccess access, RTValueType valueType, RTConstValueUnion constValue)
 
sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodData (void *handle, sal_uInt16 index, rtl_uString const *documentation, RTMethodMode flags, rtl_uString const *name, rtl_uString const *returnTypeName, sal_uInt16 parameterCount, sal_uInt16 exceptionCount) SAL_THROW_EXTERN_C()
 Sets the data of a method of a type writer. More...
 
sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodParameterData (void const *handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex, RTParamMode flags, rtl_uString const *name, rtl_uString const *typeName) SAL_THROW_EXTERN_C()
 Sets the data of a parameter of a method of a type writer. More...
 
sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodExceptionTypeName (void const *handle, sal_uInt16 methodIndex, sal_uInt16 exceptionIndex, rtl_uString const *typeName) SAL_THROW_EXTERN_C()
 Sets an exception type name of a method of a type writer. More...
 
void const *TYPEREG_CALLTYPE typereg_writer_getBlob (void *handle, sal_uInt32 *size) SAL_THROW_EXTERN_C()
 Returns the blob of a type writer. More...
 
static const sal_uInt8 *TYPEREG_CALLTYPE getBlop (TypeWriterImpl hEntry)
 
static sal_uInt32 TYPEREG_CALLTYPE getBlopSize (TypeWriterImpl hEntry)
 
sal_Bool TYPEREG_CALLTYPE typereg_writer_setReferenceData (void *handle, sal_uInt16 index, rtl_uString const *documentation, RTReferenceType sort, RTFieldAccess flags, rtl_uString const *typeName) SAL_THROW_EXTERN_C()
 Sets the data of a reference of a type writer. More...
 
void *TYPEREG_CALLTYPE typereg_writer_create (typereg_Version version, rtl_uString const *documentation, rtl_uString const *fileName, RTTypeClass typeClass, sal_Bool published, rtl_uString const *typeName, sal_uInt16 superTypeCount, sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount) SAL_THROW_EXTERN_C()
 Creates a type writer working on a binary blob that represents a UNOIDL type. More...
 
void TYPEREG_CALLTYPE typereg_writer_destroy (void *handle) SAL_THROW_EXTERN_C()
 Destroys a type writer. More...
 
sal_Bool TYPEREG_CALLTYPE typereg_writer_setSuperTypeName (void const *handle, sal_uInt16 index, rtl_uString const *typeName) SAL_THROW_EXTERN_C()
 Sets the type name of a super type of a type writer. More...
 
static TypeWriterImpl TYPEREG_CALLTYPE createEntry (RTTypeClass typeClass, rtl_uString const *typeName, rtl_uString const *superTypeName, sal_uInt16 fieldCount)
 

Variables

static const sal_Unicode NULL_WSTRING [1] = { 0 }
 

Macro Definition Documentation

#define BLOP_FIELD_N_ENTRIES   6

Definition at line 56 of file reflwrit.cxx.

#define BLOP_HEADER_N_ENTRIES   6

Definition at line 54 of file reflwrit.cxx.

#define BLOP_METHOD_N_ENTRIES   5

Definition at line 58 of file reflwrit.cxx.

#define BLOP_OFFSET_MAGIC   0

Definition at line 49 of file reflwrit.cxx.

#define BLOP_OFFSET_MAJOR   (BLOP_OFFSET_MINOR + sizeof(sal_uInt16))

Definition at line 52 of file reflwrit.cxx.

#define BLOP_OFFSET_MINOR   (BLOP_OFFSET_SIZE + sizeof(sal_uInt32))

Definition at line 51 of file reflwrit.cxx.

#define BLOP_OFFSET_N_ENTRIES   (BLOP_OFFSET_MAJOR + sizeof(sal_uInt16))

Definition at line 53 of file reflwrit.cxx.

#define BLOP_OFFSET_SIZE   (BLOP_OFFSET_MAGIC + sizeof(sal_uInt32))

Definition at line 50 of file reflwrit.cxx.

#define BLOP_PARAM_N_ENTRIES   3

Definition at line 60 of file reflwrit.cxx.

#define BLOP_REFERENCE_N_ENTRIES   4

Definition at line 62 of file reflwrit.cxx.

Function Documentation

static TypeWriterImpl TYPEREG_CALLTYPE createEntry ( RTTypeClass  typeClass,
rtl_uString const *  typeName,
rtl_uString const *  superTypeName,
sal_uInt16  fieldCount 
)
static
static const sal_uInt8* TYPEREG_CALLTYPE getBlop ( TypeWriterImpl  hEntry)
static

Definition at line 1217 of file reflwrit.cxx.

References typereg_writer_getBlob().

Referenced by RegistryTypeWriter::getBlop().

static sal_uInt32 TYPEREG_CALLTYPE getBlopSize ( TypeWriterImpl  hEntry)
static

Definition at line 1224 of file reflwrit.cxx.

References typereg_writer_getBlob().

Referenced by RegistryTypeWriter::getBlopSize().

sal_uInt32 readString ( const sal_uInt8 buffer,
sal_Unicode v,
sal_uInt32  maxSize 
)
static void TYPEREG_CALLTYPE release ( TypeWriterImpl  hEntry)
static

Definition at line 1112 of file reflwrit.cxx.

Referenced by RegistryTypeWriter::~RegistryTypeWriter().

static void TYPEREG_CALLTYPE setFieldData ( TypeWriterImpl  hEntry,
sal_uInt16  index,
rtl_uString const *  name,
rtl_uString const *  typeName,
rtl_uString const *  doku,
rtl_uString const *  fileName,
RTFieldAccess  access,
RTValueType  valueType,
RTConstValueUnion  constValue 
)
static

Definition at line 1141 of file reflwrit.cxx.

References typereg_writer_setFieldData().

void* TYPEREG_CALLTYPE typereg_writer_create ( typereg_Version  version,
rtl_uString const *  documentation,
rtl_uString const *  fileName,
RTTypeClass  typeClass,
sal_Bool  published,
rtl_uString const *  typeName,
sal_uInt16  superTypeCount,
sal_uInt16  fieldCount,
sal_uInt16  methodCount,
sal_uInt16  referenceCount 
)

Creates a type writer working on a binary blob that represents a UNOIDL type.

Operations on a returned handle are not multi-thread–safe.

Parameters
versionthe version of the created type writer; must not be negative
documentationthe documentation; must not be null
fileNamethe file name; must not be null (deprecated, use an empty string)
typeClassthe type class of the created type writer
publishedwhether the created type writer is published; for a type class that cannot be published, this should be false
typeNamethe type name of the created type writer; must not be null
superTypeCountthe number of super types of the created type writer
fieldCountthe number of fields of the created type writer
methodCountthe number of methods of the created type writer
referenceCountthe number of references of the created type writer
Returns
a handle on the type writer; if an out-of-memory condition occurs, null is returned, and no type writer is created
Available since:
UDK 3.2.0

Definition at line 1245 of file reflwrit.cxx.

References SAL_THROW_EXTERN_C.

Referenced by createEntry().

void TYPEREG_CALLTYPE typereg_writer_destroy ( void handle)

Destroys a type writer.

Parameters
handlea handle on a type writer obtained from a call to typereg_writer_create; must not be null
Available since:
UDK 3.2.0

Definition at line 1262 of file reflwrit.cxx.

References SAL_THROW_EXTERN_C.

Referenced by typereg::Writer::~Writer().

void const* TYPEREG_CALLTYPE typereg_writer_getBlob ( void handle,
sal_uInt32 *  size 
)

Returns the blob of a type writer.

Parameters
handlea handle on a type writer; must not be null
sizean out-parameter obtaining the size of the blob; must not be null
Returns
a (byte-aligned) pointer to the blob; the returned pointer and the returned size remain valid until the next function is called on the given type writer; if an out-of-memory condition occurs, null is returned and size is not modified

Definition at line 1202 of file reflwrit.cxx.

References SAL_THROW_EXTERN_C.

Referenced by typereg::Writer::getBlob(), getBlop(), and getBlopSize().

sal_Bool TYPEREG_CALLTYPE typereg_writer_setFieldData ( void handle,
sal_uInt16  index,
rtl_uString const *  documentation,
rtl_uString const *  fileName,
RTFieldAccess  flags,
rtl_uString const *  name,
rtl_uString const *  typeName,
RTValueType  valueType,
RTConstValueUnion  valueValue 
)

Sets the data of a field of a type writer.

Parameters
handlea handle on a type writer; must not be null
indexa valid index into the range of fields of the given type writer
documentationthe documentation of the field; must not be null
fileNamethe file name of the field; must not be null (deprecated, use an empty string)
flagsthe flags of the field
namethe name of the field; must not be null
typeNamethe type name of the field; must not be null
valueTypethe type of the value of the field
valueValuethe value of the value of the field
Returns
false iff an out-of-memory condition occurred, in which case the type writer is not modified
Available since:
UDK 3.2.0

Definition at line 1123 of file reflwrit.cxx.

References index, and SAL_THROW_EXTERN_C.

Referenced by typereg::Writer::setFieldData(), and setFieldData().

sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodData ( void handle,
sal_uInt16  index,
rtl_uString const *  documentation,
RTMethodMode  flags,
rtl_uString const *  name,
rtl_uString const *  returnTypeName,
sal_uInt16  parameterCount,
sal_uInt16  exceptionCount 
)

Sets the data of a method of a type writer.

Parameters
handlea handle on a type writer; must not be null
indexa valid index into the range of methods of the given type writer
documentationthe documentation of the method; must not be null
flagsthe flags of the method
namethe name of the method; must not be null
returnTypeNamethe return type name of the method; must not be null
parameterCountthe number of parameters of the method
exceptionCountthe number of exceptions of the method
Returns
false iff an out-of-memory condition occurred, in which case the type writer is not modified
Available since:
UDK 3.2.0

Definition at line 1156 of file reflwrit.cxx.

References index, and SAL_THROW_EXTERN_C.

Referenced by typereg::Writer::setMethodData().

sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodExceptionTypeName ( void const *  handle,
sal_uInt16  methodIndex,
sal_uInt16  exceptionIndex,
rtl_uString const *  typeName 
)

Sets an exception type name of a method of a type writer.

Parameters
handlea handle on a type writer; must not be null
methodIndexa valid index into the range of methods of the given type writer
exceptionIndexa valid index into the range of exceptions of the given method
typeNamethe exception type name; must not be null
Returns
false iff an out-of-memory condition occurred, in which case the type writer is not modified
Available since:
UDK 3.2.0

Definition at line 1188 of file reflwrit.cxx.

References SAL_THROW_EXTERN_C.

Referenced by typereg::Writer::setMethodExceptionTypeName().

sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodParameterData ( void const *  handle,
sal_uInt16  methodIndex,
sal_uInt16  parameterIndex,
RTParamMode  flags,
rtl_uString const *  name,
rtl_uString const *  typeName 
)

Sets the data of a parameter of a method of a type writer.

Parameters
handlea handle on a type writer; must not be null
methodIndexa valid index into the range of methods of the given type writer
parameterIndexa valid index into the range of parameters of the given method
flagsthe flags of the parameter
namethe name of the parameter; must not be null
typeNamethe type name of the parameter; must not be null
Returns
false iff an out-of-memory condition occurred, in which case the type writer is not modified
Available since:
UDK 3.2.0

Definition at line 1173 of file reflwrit.cxx.

References SAL_THROW_EXTERN_C.

Referenced by typereg::Writer::setMethodParameterData().

sal_Bool TYPEREG_CALLTYPE typereg_writer_setReferenceData ( void handle,
sal_uInt16  index,
rtl_uString const *  documentation,
RTReferenceType  sort,
RTFieldAccess  flags,
rtl_uString const *  typeName 
)

Sets the data of a reference of a type writer.

Parameters
handlea handle on a type writer; must not be null
indexa valid index into the range of references of the given type writer
documentationthe documentation of the reference; must not be null
sortthe sort of the reference
flagsthe flags of the reference
typeNamethe type name of the reference; must not be null
Returns
false iff an out-of-memory condition occurred, in which case the type writer is not modified
Available since:
UDK 3.2.0

Definition at line 1231 of file reflwrit.cxx.

References index, and SAL_THROW_EXTERN_C.

Referenced by typereg::Writer::setReferenceData().

sal_Bool TYPEREG_CALLTYPE typereg_writer_setSuperTypeName ( void const *  handle,
sal_uInt16  index,
rtl_uString const *  typeName 
)

Sets the type name of a super type of a type writer.

Parameters
handlea handle on a type writer; must not be null
indexa valid index into the range of super types of the given type writer
typeNamethe super type name; must not be null
Returns
false iff an out-of-memory condition occurred, in which case the type writer is not modified
Available since:
UDK 3.2.0

Definition at line 1266 of file reflwrit.cxx.

References index, and SAL_THROW_EXTERN_C.

Referenced by createEntry(), and typereg::Writer::setSuperTypeName().

sal_uInt32 UINT16StringLen ( const sal_uInt8 wstring)

Definition at line 64 of file reflwrit.cxx.

Referenced by readString().

sal_uInt32 writeDouble ( sal_uInt8 buffer,
double  v 
)

Definition at line 133 of file reflwrit.cxx.

References writeUINT32(), and x.

sal_uInt32 writeFloat ( sal_uInt8 buffer,
float  v 
)

Definition at line 114 of file reflwrit.cxx.

References writeUINT32(), and x.

sal_uInt32 writeString ( sal_uInt8 buffer,
const sal_Unicode v 
)

Definition at line 75 of file reflwrit.cxx.

References i, and writeUINT16().

Referenced by ORegKey::setUnicodeListValue(), and ORegKey::setValue().

Variable Documentation

const sal_Unicode NULL_WSTRING[1] = { 0 }
static

Definition at line 47 of file reflwrit.cxx.