#include "MercuryString.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
Go to the source code of this file.
Defines | |
#define | BASE_ALLOC 16 |
#define | NEXT_ALLOC(x, y) ( x + y + BASE_ALLOC ) |
#define | MANAGE_ALLOC(y) |
#define | FMT_BLOCK_SIZE 127 |
Functions | |
bool | operator< (const MString &lhs, const MString &rhs) |
bool | operator> (const MString &lhs, const MString &rhs) |
MString | operator+ (const char *lhs, const MString &rhs) |
MString | operator+ (const char lhs, const MString &rhs) |
MString | ssprintf (const char *fmt,...) |
#define BASE_ALLOC 16 |
Definition at line 9 of file MercuryString.cpp.
#define FMT_BLOCK_SIZE 127 |
Definition at line 384 of file MercuryString.cpp.
#define MANAGE_ALLOC | ( | y | ) |
Value:
if ( m_iLen + y + 1 > m_iAlloc ) \ { \ /* int iOldMalloc = m_iAlloc; */\ m_iAlloc = NEXT_ALLOC( m_iLen, y ); \ char * newStr = (char*)malloc( m_iAlloc ); \ memcpy( newStr, m_sCur, m_iLen + 1 ); \ free( m_sCur ); \ m_sCur = newStr; \ }
Definition at line 13 of file MercuryString.cpp.
#define NEXT_ALLOC | ( | x, | |||
y | ) | ( x + y + BASE_ALLOC ) |
Definition at line 11 of file MercuryString.cpp.
Definition at line 379 of file MercuryString.cpp.
Definition at line 374 of file MercuryString.cpp.
Definition at line 363 of file MercuryString.cpp.
Definition at line 368 of file MercuryString.cpp.
MString ssprintf | ( | const char * | fmt, | |
... | ||||
) |
Definition at line 386 of file MercuryString.cpp.