Public Member Functions | |
| void | addBuffer (MemBuf *nmb) |
| void | addBuffer (const void *pAdr, u_int size) |
| u_int | find (const void *pAdr, u_int size, u_int start=0) |
| u_int | find (MemBuf *smb, u_int start=0) |
| u_int | find (char c, u_int start=0) |
| int | free () |
| char & | getAt (u_int nIndex) |
| char * | getBuffer () |
| char * | getBuffersetLength (u_int newSize) |
| u_int | getLength () |
| int | getPart (u_int nStart, u_int nEnd, MemBuf &result) |
| int | getPartAsString (u_int nStart, u_int nEnd, MemBuf &result) |
| u_int | getRealLength () |
| void | hashCRC (MemBuf &membuf) |
| void | hashCRC (const void *pAdr, u_int nSize) |
| void | hashMD5 (MemBuf &membuf) |
| void | hashMD5 (const void *pAdr, u_int nSize) |
| void | hex (MemBuf &membuf) |
| void | hex (const void *pAdr, u_int nSize) |
| unsigned char | hexCharToNumber (unsigned char c) |
| MemBuf | hexToData (const void *pAdr, u_int nSize) |
| void | intToStr (int i, char *pBufToUse, u_int nBufSize) |
| void | intToStr (int i) |
| int | isValid () |
| MemBuf (MemBuf &srcBuf, int bCopy) | |
| MemBuf (const MemBuf &srcBuf) | |
| MemBuf (const void *pAdr, u_int size) | |
| MemBuf () | |
| operator const void * () | |
| MemBuf | operator+ (const char *src) |
| MemBuf | operator+ (MemBuf &src) |
| const MemBuf & | operator+= (char c) |
| const MemBuf & | operator+= (const char *pStr) |
| const MemBuf & | operator+= (MemBuf &add) |
| MemBuf & | operator<< (const string &src) |
| MemBuf & | operator<< (const MemBuf &src) |
| MemBuf & | operator<< (unsigned char c) |
| MemBuf & | operator<< (char c) |
| MemBuf & | operator<< (unsigned long i) |
| MemBuf & | operator<< (long i) |
| MemBuf & | operator<< (unsigned int i) |
| MemBuf & | operator<< (int i) |
| MemBuf & | operator<< (const char *pSrc) |
| MemBuf & | operator= (const char *src) |
| MemBuf & | operator= (const MemBuf &src) |
| char & | operator[] (u_int nIndex) |
| void | replace (char what, char by) |
| int | setBuffer (const void *pAdr, u_int size) |
| void | setExternalBuffer (const void *pAdr, u_int size) |
| void | setLength (u_int newSize) |
| int | strToInt (const char *pAdr) |
| u_int | strToUint (const char *pAdr) |
| void | uintToStr (u_int i, char *pBufToUse, u_int nBufSize) |
| void | uintToStr (u_int i) |
| void | xIntToStr (u_int i, int bNegative, char *pBufToUse, u_int nBufSize) |
| ~MemBuf () | |
Public Attributes | |
| u_int | m_nBlockLength |
| u_int | m_nSizeLimit |
Protected Member Functions | |
| void | allocBuffer (u_int size) |
| void | xIntToStr (u_int i, int bNegative) |
Protected Attributes | |
| int | m_bCanDelete |
| char * | m_buffer |
| u_int | m_nRealSize |
| u_int | m_nSize |
Static Protected Attributes | |
| u_int | crc32Table [256] |
|
|
Default constructor |
|
||||||||||||
|
Copy constructor pAdr : pointer to the buffer to copy size : size of pAdr |
|
|
Direct copy constructor (should only be used by the operators to avoid reallocations) |
|
||||||||||||
|
Copy constructor |
|
|
Destructor |
|
|
|
|
||||||||||||
|
Add a buffer at the end of the internal buffer. If the internal buffer isn't large enough, a reallocation is done until m_nSizeLimit is reached If m_nSizeLimit is equal to 0, reallocation are always done. |
|
|
|
|
||||||||||||||||
|
find a specific buffer in the internal buffer from a specific location |
|
||||||||||||
|
|
|
||||||||||||
|
find a specific character in the internal buffer from a specific location |
|
|
free used memory |
|
|
|
|
|
|
|
|
Return the internal buffer by setting previously a specific length |
|
|
|
|
||||||||||||||||
|
Copy a part of the internal buffer in "result". Here, "result" is completly removed and replaced by this part. |
|
||||||||||||||||
|
Copy a part of the internal buffer in "result". Here, "result" is completly removed and replaced by this part. |
|
|
Get the real allocated size. |
|
|
|
|
||||||||||||
|
CRC hashing function |
|
|
|
|
||||||||||||
|
MD5 hashing function |
|
|
|
|
||||||||||||
|
Write to the MemBuf the hex representation of pAdr |
|
|
Return the decimal number of an hexadecimal character |
|
||||||||||||
|
Return a MemBuf with the decoded hexadicmal string pointed at pAdr |
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
replace a character by another |
|
||||||||||||
|
|
|
||||||||||||
|
Set an external buffer as the internal buffer. No memory copy are done. This can be useful to use variables from the stack. Ex.: unsigned char stackBuffer[10]; MemBuf buffer; buffer.setExternalBuffer(stackBuffer, 10); // here, you'll use the memory from stackBuffer |
|
|
Set the length of the internal buffer. If the length is smallest than the existing one, no reallocation is done. if it's biggest, a reallocation is done until m_nSizeLimit is reached. |
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
||||||||||||
|
Return a MemBuf with the string representation of "i" |
|
||||||||||||||||||||
|
Return a MemBuf with the string representation of "i" using an external buffer. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.9.1