#include <SimpleProperties.hpp>
Inheritance diagram for SimpleProperties::Writer:

Public Member Functions | |
| Writer () | |
| virtual | ~Writer () |
| bool | first () |
| bool | add (Uint16 key, Uint32 value) |
| bool | add (Uint16 key, const char *value) |
| bool | add (Uint16 key, const void *value, int len) |
Protected Member Functions | |
| virtual bool | reset ()=0 |
| virtual bool | putWord (Uint32 val)=0 |
| virtual bool | putWords (const Uint32 *src, Uint32 len)=0 |
Private Member Functions | |
| bool | add (const char *value, int len) |
Definition at line 167 of file SimpleProperties.hpp.
| SimpleProperties::Writer::Writer | ( | ) | [inline] |
| virtual SimpleProperties::Writer::~Writer | ( | ) | [inline, virtual] |
| bool SimpleProperties::Writer::add | ( | const char * | value, | |
| int | len | |||
| ) | [private] |
Definition at line 40 of file SimpleProperties.cpp.
References memcpy, putWord(), and putWords().
00040 { 00041 const Uint32 valLen = (len + 3) / 4; 00042 00043 if ((len % 4) == 0) 00044 return putWords((Uint32*)value, valLen); 00045 00046 const Uint32 putLen= valLen - 1; 00047 if (!putWords((Uint32*)value, putLen)) 00048 return false; 00049 00050 // Special handling of last bytes 00051 union { 00052 Uint32 lastWord; 00053 char lastBytes[4]; 00054 } tmp; 00055 tmp.lastWord =0 ; 00056 memcpy(tmp.lastBytes, 00057 value + putLen*4, 00058 len - putLen*4); 00059 return putWord(tmp.lastWord); 00060 }
Here is the call graph for this function:

Definition at line 78 of file SimpleProperties.cpp.
References add(), SimpleProperties::BinaryValue, and putWord().
00078 { 00079 Uint32 head = BinaryValue; 00080 head <<= 16; 00081 head += key; 00082 if(!putWord(htonl(head))) 00083 return false; 00084 if(!putWord(htonl(len))) 00085 return false; 00086 00087 return add((const char*)value, len); 00088 }
Here is the call graph for this function:

Definition at line 63 of file SimpleProperties.cpp.
References add(), putWord(), SimpleProperties::StringValue, and strlen().
00063 { 00064 Uint32 head = StringValue; 00065 head <<= 16; 00066 head += key; 00067 if(!putWord(htonl(head))) 00068 return false; 00069 Uint32 strLen = strlen(value) + 1; // Including NULL-byte 00070 if(!putWord(htonl(strLen))) 00071 return false; 00072 00073 return add(value, (int)strLen); 00074 00075 }
Here is the call graph for this function:

Definition at line 29 of file SimpleProperties.cpp.
References putWord(), and SimpleProperties::Uint32Value.
Referenced by add(), Dbdict::alterIndex_toCreateTrigger(), Dbdict::buildIndex_toCreateConstr(), NdbDictInterface::createEvent(), NdbDictInterface::createIndex(), Dbdict::createIndex_toCreateTable(), Ndbcntr::createSystableLab(), NdbDictInterface::dropEvent(), SimpleProperties::pack(), Dbdict::packTableIntoPages(), Trix::prepareInsertTransactions(), Dbdict::prepareUtilTransaction(), and writer().
00029 { 00030 Uint32 head = Uint32Value; 00031 head <<= 16; 00032 head += key; 00033 if(!putWord(htonl(head))) 00034 return false; 00035 00036 return putWord(htonl(value)); 00037 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool SimpleProperties::Writer::first | ( | ) |
Definition at line 24 of file SimpleProperties.cpp.
References reset().
Referenced by Dbdict::createIndex_toCreateTable(), Ndbcntr::createSystableLab(), Dbdict::packTableIntoPages(), Trix::prepareInsertTransactions(), Dbdict::prepareUtilTransaction(), SimplePropertiesSectionWriter::SimplePropertiesSectionWriter(), and writer().
00024 { 00025 return reset(); 00026 }
Here is the call graph for this function:

Here is the caller graph for this function:

Implemented in LinearWriter, UtilBufferWriter, and SimplePropertiesSectionWriter.
Referenced by add().
Here is the caller graph for this function:

| virtual bool SimpleProperties::Writer::putWords | ( | const Uint32 * | src, | |
| Uint32 | len | |||
| ) | [protected, pure virtual] |
Implemented in LinearWriter, UtilBufferWriter, and SimplePropertiesSectionWriter.
Referenced by add().
Here is the caller graph for this function:

| virtual bool SimpleProperties::Writer::reset | ( | ) | [protected, pure virtual] |
Implemented in LinearWriter, UtilBufferWriter, and SimplePropertiesSectionWriter.
Referenced by first().
Here is the caller graph for this function:

1.4.7

