Fennel: /home/pub/open/dev/fennel/calctest/SqlStringBuffer.h Source File (original) (raw)

00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 #ifndef Fennel_SqlStringBuffer_Included 00024 #define Fennel_SqlStringBuffer_included 00025 00026 #include "fennel/common/TraceSource.h" 00027 00028 #include <boost/scoped_array.hpp> 00029 #include 00030 #include 00031 #include 00032 00033 using namespace fennel; 00034 using namespace std; 00035 00036 00037 00038 00039 class SqlStringBuffer 00040 { 00041 public: 00042 static const uint mBumperChar; 00043 static const int mBumperLen; 00044 00045 explicit 00046 SqlStringBuffer( 00047 int storage,
00048 int size,
00049 int leftpad = 0,
00050 int rightpad = 0, 00051 uint text = 'x',
00052 uint pad = ' ',
00053
00054 int leftBumper = mBumperLen,
00055 int rightBumper = mBumperLen); 00056 00057 bool verify(); 00058 00059 void randomize( 00060 uint start = 'A', 00061 uint lower = ' ', 00062 uint upper = ''); 00063 00064 void patternfill( 00065 uint start = 'A', 00066 uint lower = ' ', 00067 uint upper = ''); 00068 00069 00070 char * mStr;
00071 char * mRightP;
00072 char * mLeftP;
00073 const int mStorage;
00074 const int mSize;
00075 const int mLeftPad;
00076 const int mRightPad;
00077 const int mLeftBump;
00078 const int mRightBump;
00079 const int mTotal;
00080 string mS; 00081 00082 private: 00083 }; 00084 00085 class SqlStringBufferUCS2 00086 { 00087 public: 00088 static const uint mBumperChar; 00089 static const int mBumperLen; 00090 00091 explicit 00092 SqlStringBufferUCS2(SqlStringBuffer const &src); 00093 00094 explicit 00095 SqlStringBufferUCS2( 00096 SqlStringBuffer const &src, 00097 int leftBumper, 00098 int rightBumper); 00099 00100 void init(); 00101 bool verify(); 00102 void randomize( 00103 uint start = 'A', 00104 uint lower = ' ', 00105 uint upper = ''); 00106 00107 void patternfill( 00108 uint start = 'A', 00109 uint lower = ' ', 00110 uint upper = ''); 00111 00112 string dump(); 00113 bool equal(SqlStringBufferUCS2 const &other); 00114 00115 char * mStr;
00116 char * mStrPostPad;
00117 char * mRightP;
00118 char * mLeftP;
00119 const int mStorage;
00120 const int mSize;
00121 const int mLeftPad;
00122 const int mRightPad;
00123 const int mLeftBump;
00124 const int mRightBump;
00125 const int mTotal;
00126 string mS; 00127 00128 private: 00129 }; 00130 00131 #endif 00132 00133