Fennel: SqlStringBufferUCS2 Class Reference (original) (raw)
#include <[SqlStringBuffer.h](SqlStringBuffer%5F8h-source.html)>
| Public Member Functions | |
|---|---|
| SqlStringBufferUCS2 (SqlStringBuffer const &src) | |
| SqlStringBufferUCS2 (SqlStringBuffer const &src, int leftBumper, int rightBumper) | |
| void | init () |
| bool | verify () |
| void | randomize (uint start= 'A', uint lower= ' ', uint upper= '~') |
| void | patternfill (uint start= 'A', uint lower= ' ', uint upper= '~') |
| string | dump () |
| bool | equal (SqlStringBufferUCS2 const &other) |
| Public Attributes | |
| char * | mStr |
| char * | mStrPostPad |
| char * | mRightP |
| char * | mLeftP |
| const int | mStorage |
| const int | mSize |
| const int | mLeftPad |
| const int | mRightPad |
| const int | mLeftBump |
| const int | mRightBump |
| const int | mTotal |
| string | mS |
| Static Public Attributes | |
| static const uint | mBumperChar |
| static const int | mBumperLen |
Detailed Description
Definition at line 85 of file SqlStringBuffer.h.
Constructor & Destructor Documentation
| SqlStringBufferUCS2::SqlStringBufferUCS2 | ( | SqlStringBuffer const & | src | ) | [explicit] |
|---|
Definition at line 128 of file SqlStringBuffer.cpp.
References init(), mBumperChar, mS, SqlStringBuffer::mStorage, mStr, SqlStringBuffer::mStr, and mTotal.
00129 : mStorage(src.mStorage *2),
00130 mSize(src.mSize * 2),
00131 mLeftPad(src.mLeftPad * 2),
00132 mRightPad(src.mRightPad * 2),
00133
00134 mLeftBump(src.mLeftBump & 1 ? src.mLeftBump + 1 : src.mLeftBump),
00135 mRightBump(src.mRightBump & 1 ? src.mRightBump + 1 : src.mRightBump),
00136 mTotal(src.mStorage * 2 + mLeftBump + mRightBump)
00137 {
00138 mS.assign(mTotal, mBumperChar);
00139
00140 init();
00141
00142 char *srcP = src.mStr;
00143 char *dstP = mStr;
00144 int i = src.mStorage;
00145 while (i > 0) {
00146 #ifdef LITTLEENDIAN
00147 *(dstP++) = *(srcP++);
00148 *(dstP++) = 0x00;
00149 #else
00150 *(dstP++) = 0x00;
00151 *(dstP++) = *(srcP++);
00152 #endif
00153 i--;
00154 }
00155 }
| SqlStringBufferUCS2::SqlStringBufferUCS2 | ( | SqlStringBuffer const & | src, |
|---|---|---|---|
| int | leftBumper, | ||
| int | rightBumper | ||
| ) | [explicit] |
Definition at line 157 of file SqlStringBuffer.cpp.
References init(), mBumperChar, mLeftBump, mRightBump, mS, SqlStringBuffer::mStorage, mStr, SqlStringBuffer::mStr, and mTotal.
00161 : mStorage(src.mStorage *2),
00162 mSize(src.mSize * 2),
00163 mLeftPad(src.mLeftPad * 2),
00164 mRightPad(src.mRightPad * 2),
00165 mLeftBump(leftBumper),
00166 mRightBump(rightBumper),
00167 mTotal(src.mStorage * 2 + leftBumper + rightBumper)
00168 {
00169
00170 assert(!(mLeftBump & 1));
00171 assert(!(mRightBump & 1));
00172
00173 mS.assign(mTotal, mBumperChar);
00174
00175 init();
00176
00177 char *srcP = src.mStr;
00178 char *dstP = mStr;
00179 int i = src.mStorage;
00180 while (i > 0) {
00181 #ifdef LITTLEENDIAN
00182 *(dstP++) = *(srcP++);
00183 *(dstP++) = 0x00;
00184 #else
00185 *(dstP++) = 0x00;
00186 *(dstP++) = *(srcP++);
00187 #endif
00188 i--;
00189 }
00190 }
Member Function Documentation
| void SqlStringBufferUCS2::init | ( | | ) | | ------------------------------ | - | | - |
Definition at line 194 of file SqlStringBuffer.cpp.
References mLeftBump, mLeftP, mLeftPad, mRightBump, mRightP, mRightPad, mS, mSize, mStorage, mStr, and mStrPostPad.
Referenced by SqlStringBufferUCS2().
| bool SqlStringBufferUCS2::verify | ( | | ) | | -------------------------------- | - | | - |
Definition at line 208 of file SqlStringBuffer.cpp.
References mBumperChar, mLeftBump, mLeftPad, mRightBump, mRightPad, mS, mSize, and mTotal.
Referenced by SqlStringTest::testSqlStringAlterCase_UCS2(), SqlStringTest::testSqlStringBuffer_UCS2(), SqlStringTest::testSqlStringCpy_Fix(), SqlStringTest::testSqlStringCpy_Var(), and SqlStringTest::testSqlStringTrim_Helper().
| void SqlStringBufferUCS2::randomize | ( | uint | start = 'A', |
|---|---|---|---|
| uint | lower = ' ', | ||
| uint | upper = '~' | ||
| ) |
| void SqlStringBufferUCS2::patternfill | ( | uint | start = 'A', |
|---|---|---|---|
| uint | lower = ' ', | ||
| uint | upper = '~' | ||
| ) |
| string SqlStringBufferUCS2::dump | ( | | ) | | -------------------------------- | - | | - |
Definition at line 284 of file SqlStringBuffer.cpp.
References mLeftBump, mLeftP, mRightBump, mSize, mStorage, mStr, and mTotal.
Referenced by SqlStringTest::testSqlStringAlterCase_UCS2().
00285 { 00286 int i = 0; 00287 string ret; 00288 char buf[100]; 00289 00290 sprintf( 00291 buf, "DUMP: Storage=%d LeftBump=%d Size=%d RightBump=%d LP=%p Str=%p\n", 00292 mStorage, mLeftBump, mSize, mRightBump, 00293 mLeftP, mStr); 00294 ret += buf; 00295 00296 i = 0; 00297 while (i < mTotal) { 00298 sprintf( 00299 buf, 00300 " %d:%x(%c)", 00301 i, 00302 mLeftP[i], 00303 (mLeftP[i] >= ' ' ? mLeftP[i] : '')); 00304 ret += buf; 00305 i++; 00306 } 00307 00308 ret += "\nLeft Bumper:\n"; 00309 i = 0; 00310 while (i < mLeftBump) { 00311 sprintf(buf, "%d: 0x%x (%c)\n", i, mLeftP[i], mLeftP[i]); 00312 ret += buf; 00313 i++; 00314 } 00315 00316 ret += "\nText:\n"; 00317 i = 0; 00318 while (i < mStorage) { 00319 sprintf( 00320 buf, "%d: 0x%x (%c) 0x%x (%c)\n", i, 00321 mStr[i], (mStr[i] >= ' ' ? mStr[i] : ''), 00322 mStr[i + 1], (mStr[i + 1] >= ' ' ? mStr[i + 1] : '_')); 00323 ret += buf; 00324 i += 2; 00325 } 00326 00327 ret += "\nRight Bumper:\n"; 00328 i = 0; 00329 while (i < mRightBump) { 00330 sprintf( 00331 buf, "%d: 0x%x (%c)\n", i, mStr[i + mStorage], mStr[i + mStorage]); 00332 ret += buf; 00333 i++; 00334 } 00335 00336 return ret; 00337 }
Member Data Documentation
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/calctest/SqlStringBuffer.h
- /home/pub/open/dev/fennel/calctest/SqlStringBuffer.cpp
