\hypertarget{xbstring_8h_source}{}\doxysection{xbstring.\+h}
\label{xbstring_8h_source}\index{/mnt/1Tdata/xbase/xbase64-\/4.1.4/src/include/xbstring.h@{/mnt/1Tdata/xbase/xbase64-\/4.1.4/src/include/xbstring.h}}
\mbox{\hyperlink{xbstring_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 \textcolor{comment}{/*  xbstring.h}}
\DoxyCodeLine{2 \textcolor{comment}{}}
\DoxyCodeLine{3 \textcolor{comment}{XBase64 Software Library}}
\DoxyCodeLine{4 \textcolor{comment}{}}
\DoxyCodeLine{5 \textcolor{comment}{Copyright (c) 1997,2003,2014,2022 Gary A Kunkel}}
\DoxyCodeLine{6 \textcolor{comment}{}}
\DoxyCodeLine{7 \textcolor{comment}{The xb64 software library is covered under the terms of the GPL Version 3, 2007 license.}}
\DoxyCodeLine{8 \textcolor{comment}{}}
\DoxyCodeLine{9 \textcolor{comment}{Email Contact:}}
\DoxyCodeLine{10 \textcolor{comment}{}}
\DoxyCodeLine{11 \textcolor{comment}{    XDB-\/devel@lists.sourceforge.net}}
\DoxyCodeLine{12 \textcolor{comment}{    XDB-\/users@lists.sourceforge.net}}
\DoxyCodeLine{13 \textcolor{comment}{}}
\DoxyCodeLine{14 \textcolor{comment}{*/}}
\DoxyCodeLine{15 }
\DoxyCodeLine{16 \textcolor{preprocessor}{\#ifndef \_\_XBSTRING\_H\_\_}}
\DoxyCodeLine{17 \textcolor{preprocessor}{\#define \_\_XBSTRING\_H\_\_}}
\DoxyCodeLine{18 }
\DoxyCodeLine{19 \textcolor{preprocessor}{\#ifdef  CMAKE\_COMPILER\_IS\_GNUCC}}
\DoxyCodeLine{20 \textcolor{preprocessor}{\#pragma interface}}
\DoxyCodeLine{21 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{22 }
\DoxyCodeLine{23 \textcolor{preprocessor}{\#include <stdlib.h>}}
\DoxyCodeLine{24 \textcolor{preprocessor}{\#include <iostream>}}
\DoxyCodeLine{25 }
\DoxyCodeLine{26 \textcolor{keyword}{namespace }\mbox{\hyperlink{namespacexb}{xb}}\{}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 }
\DoxyCodeLine{30 }
\DoxyCodeLine{50 \textcolor{keyword}{class }XBDLLEXPORT \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \{}
\DoxyCodeLine{51 }
\DoxyCodeLine{52  \textcolor{keyword}{public}:}
\DoxyCodeLine{53   \textcolor{comment}{//Various constructors}}
\DoxyCodeLine{54   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}(xbUInt32 size);}
\DoxyCodeLine{55   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}(\textcolor{keywordtype}{char} c);}
\DoxyCodeLine{56   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s, xbUInt32 lMaxLen);}
\DoxyCodeLine{57   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}(\textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s);}
\DoxyCodeLine{58   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} * = \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{59   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}( \mbox{\hyperlink{namespacexb_a25f47b226ce924a5c78f97989b0744a2}{xbDouble}} d );}
\DoxyCodeLine{60   \mbox{\hyperlink{classxb_1_1xbString}{\string~xbString}}();}
\DoxyCodeLine{61 }
\DoxyCodeLine{62   \textcolor{comment}{//operators}}
\DoxyCodeLine{63   \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&operator= (\textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s);}
\DoxyCodeLine{64   \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&operator= (\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s);}
\DoxyCodeLine{65   \textcolor{keyword}{operator} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *() \textcolor{keyword}{const};}
\DoxyCodeLine{66   \textcolor{keywordtype}{char} \&operator[](xbUInt32 n) \textcolor{keyword}{const};}
\DoxyCodeLine{67   \textcolor{keywordtype}{char} \&operator[](xbInt32 n) \textcolor{keyword}{const};}
\DoxyCodeLine{68 }
\DoxyCodeLine{69   \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&operator+=(\textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s);}
\DoxyCodeLine{70   \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&operator+=(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s);}
\DoxyCodeLine{71   \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&operator+=(\textcolor{keywordtype}{char} c);}
\DoxyCodeLine{72   \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&operator-\/=(\textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s);}
\DoxyCodeLine{73   \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&operator-\/=(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s);}
\DoxyCodeLine{74   \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&operator-\/=(\textcolor{keywordtype}{char} c);}
\DoxyCodeLine{75 }
\DoxyCodeLine{76   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}} operator == ( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}}\& ) \textcolor{keyword}{const};}
\DoxyCodeLine{77   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}} operator == ( \textcolor{keyword}{const} \textcolor{keywordtype}{char} * ) \textcolor{keyword}{const};}
\DoxyCodeLine{78   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}} operator != ( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}}\& ) \textcolor{keyword}{const};}
\DoxyCodeLine{79   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}} operator != ( \textcolor{keyword}{const} \textcolor{keywordtype}{char} * ) \textcolor{keyword}{const};}
\DoxyCodeLine{80 }
\DoxyCodeLine{81   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}} operator <  ( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}}\& ) \textcolor{keyword}{const};}
\DoxyCodeLine{82   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}} operator >  ( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}}\& ) \textcolor{keyword}{const};}
\DoxyCodeLine{83   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}} operator <= ( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}}\& ) \textcolor{keyword}{const};}
\DoxyCodeLine{84   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}} operator >= ( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}}\& ) \textcolor{keyword}{const};}
\DoxyCodeLine{85 }
\DoxyCodeLine{86   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  operator-\/( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s );}
\DoxyCodeLine{87   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  operator+( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *s );}
\DoxyCodeLine{88   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  operator+( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s );}
\DoxyCodeLine{89   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  operator+( \textcolor{keyword}{const} \textcolor{keywordtype}{char} c );}
\DoxyCodeLine{90 }
\DoxyCodeLine{91   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&AddBackSlash( \textcolor{keywordtype}{char} c );}
\DoxyCodeLine{92   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Append(\textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s);}
\DoxyCodeLine{93   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Append(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s);}
\DoxyCodeLine{94   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Append(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s, xbUInt32 iByteCount );}
\DoxyCodeLine{95   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Append(\textcolor{keywordtype}{char} c);}
\DoxyCodeLine{96   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Assign(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *srcStr, xbUInt32 lStartPos, xbUInt32 lCopyLen );}
\DoxyCodeLine{97   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Assign(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *srcStr, xbUInt32 lStartPos );}
\DoxyCodeLine{98   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Assign(\textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s, xbUInt32 ulStartPos, xbUInt32 lCopyLen );}
\DoxyCodeLine{99   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Assign(\textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s, xbUInt32 ulStartPos );}
\DoxyCodeLine{100 }
\DoxyCodeLine{101   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  Copy() \textcolor{keyword}{const};}
\DoxyCodeLine{102   xbUInt32  CountChar( \textcolor{keywordtype}{char} c ) \textcolor{keyword}{const};}
\DoxyCodeLine{103   xbUInt32  CountChar( \textcolor{keywordtype}{char} c, xbInt16 iOpt ) \textcolor{keyword}{const};}
\DoxyCodeLine{104   xbInt16   CvtHexChar( \textcolor{keywordtype}{char} \&cOut );}
\DoxyCodeLine{105   xbInt16   CvtHexString( \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&sOut );}
\DoxyCodeLine{106   xbInt16   CvtULongLong( xbUInt64 \&ullOut );}
\DoxyCodeLine{107   xbInt16   CvtLongLong( xbInt64 \&llOut );}
\DoxyCodeLine{108 }
\DoxyCodeLine{109 \textcolor{preprocessor}{  \#ifdef XB\_DEBUG\_SUPPORT}}
\DoxyCodeLine{110   \textcolor{keywordtype}{void}      Dump( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *title ) \textcolor{keyword}{const};}
\DoxyCodeLine{111   \textcolor{keywordtype}{void}      Dump( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *title, xbInt16 iOption ) \textcolor{keyword}{const};}
\DoxyCodeLine{112   \textcolor{keywordtype}{void}      DumpHex( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *title ) \textcolor{keyword}{const};}
\DoxyCodeLine{113 \textcolor{preprocessor}{  \#endif}}
\DoxyCodeLine{114 }
\DoxyCodeLine{115   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&ExtractElement(\mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s, \textcolor{keywordtype}{char} delim, xbUInt32 iCnt, xbInt16 iOpt = 0 );}
\DoxyCodeLine{116   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&ExtractElement(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *src, \textcolor{keywordtype}{char} delim, xbUInt32 iCnt, xbInt16 iOpt = 0 );}
\DoxyCodeLine{117 }
\DoxyCodeLine{118   \textcolor{keywordtype}{char}      GetCharacter( xbUInt32 lPos ) \textcolor{keyword}{const};}
\DoxyCodeLine{119   xbUInt32  GetLastPos(\textcolor{keywordtype}{char} c) \textcolor{keyword}{const};}
\DoxyCodeLine{120   xbUInt32  GetLastPos(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s) \textcolor{keyword}{const};}
\DoxyCodeLine{121   \textcolor{keywordtype}{char}      GetPathSeparator() \textcolor{keyword}{const};}
\DoxyCodeLine{122   xbUInt32  GetSize() \textcolor{keyword}{const};}
\DoxyCodeLine{123 }
\DoxyCodeLine{124   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}}    HasAlphaChars() \textcolor{keyword}{const};}
\DoxyCodeLine{125   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}}    IsEmpty() \textcolor{keyword}{const};}
\DoxyCodeLine{126   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}}    IsNull() \textcolor{keyword}{const};}
\DoxyCodeLine{127 }
\DoxyCodeLine{128   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Left( xbUInt32 ulLen );}
\DoxyCodeLine{129   xbUInt32  Len() \textcolor{keyword}{const};                     \textcolor{comment}{// returns the length of the string}}
\DoxyCodeLine{130   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Ltrim();}
\DoxyCodeLine{131   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Ltrunc( xbUInt32 ulCnt );}
\DoxyCodeLine{132 }
\DoxyCodeLine{133   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Mid(xbUInt32 ulPos, xbUInt32 lLen );}
\DoxyCodeLine{134   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&PadLeft( \textcolor{keywordtype}{char} c, xbUInt32 ulLen );}
\DoxyCodeLine{135   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&PadRight( \textcolor{keywordtype}{char} c, xbUInt32 ulLen );}
\DoxyCodeLine{136 }
\DoxyCodeLine{137   xbUInt32  Pos(\textcolor{keywordtype}{char} c, xbUInt32 ulStartPos ) \textcolor{keyword}{const};}
\DoxyCodeLine{138   xbUInt32  Pos(\textcolor{keywordtype}{char} c) \textcolor{keyword}{const};}
\DoxyCodeLine{139   xbUInt32  Pos(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s) \textcolor{keyword}{const};}
\DoxyCodeLine{140   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&PutAt(xbUInt32 ulPos, \textcolor{keywordtype}{char} c);}
\DoxyCodeLine{141 }
\DoxyCodeLine{142   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Remove( xbUInt32 ulPos, xbUInt32 ulN );}
\DoxyCodeLine{143   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Replace( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sReplace, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sReplaceWith, xbInt16 iOpt = 0 );}
\DoxyCodeLine{144   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Resize( xbUInt32 lSize );}
\DoxyCodeLine{145   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Rtrim();}
\DoxyCodeLine{146 }
\DoxyCodeLine{147   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Set( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *s );}
\DoxyCodeLine{148   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Set( \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}} \&s );}
\DoxyCodeLine{149   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Set( \textcolor{keyword}{const} \textcolor{keywordtype}{char} *s, xbUInt32 ulSize );}
\DoxyCodeLine{150   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&SetNum( xbInt32 lNum );}
\DoxyCodeLine{151   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Sprintf(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *format, ...);}
\DoxyCodeLine{152 }
\DoxyCodeLine{153   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *Str() \textcolor{keyword}{const};}
\DoxyCodeLine{154   \textcolor{keywordtype}{char}      *strncpy( \textcolor{keywordtype}{char} * cDest, xbUInt32 n ) \textcolor{keyword}{const};}
\DoxyCodeLine{155   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&SwapChars( \textcolor{keywordtype}{char} from, \textcolor{keywordtype}{char} to );}
\DoxyCodeLine{156 }
\DoxyCodeLine{157   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&ToLowerCase();}
\DoxyCodeLine{158   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&ToUpperCase();}
\DoxyCodeLine{159   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&Trim();}
\DoxyCodeLine{160 }
\DoxyCodeLine{161   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}}    ValidLogicalValue() \textcolor{keyword}{const};}
\DoxyCodeLine{162   \mbox{\hyperlink{namespacexb_ab1a750481dd487f0d384aa1d200dff0f}{xbBool}}    ValidNumericValue() \textcolor{keyword}{const};}
\DoxyCodeLine{163   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&ZapChar( \textcolor{keywordtype}{char} c );}
\DoxyCodeLine{164   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&ZapLeadingChar( \textcolor{keywordtype}{char} c );}
\DoxyCodeLine{165   \mbox{\hyperlink{classxb_1_1xbString}{xbString}}  \&ZapTrailingChar( \textcolor{keywordtype}{char} c );}
\DoxyCodeLine{166 }
\DoxyCodeLine{167   \textcolor{keyword}{friend} std::ostream\& \mbox{\hyperlink{namespacexb_ad27f348219e895c44f74addba8e1889a}{operator<< }}( std::ostream\& os, \textcolor{keyword}{const} \mbox{\hyperlink{classxb_1_1xbString}{xbString}}\& s );}
\DoxyCodeLine{168 }
\DoxyCodeLine{169  \textcolor{keyword}{private}:}
\DoxyCodeLine{170 }
\DoxyCodeLine{171   \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} * NullString;}
\DoxyCodeLine{172   \textcolor{keyword}{static}       \textcolor{keywordtype}{char}   cJunkBuf;}
\DoxyCodeLine{173 }
\DoxyCodeLine{174   \textcolor{keywordtype}{char}     *data;          \textcolor{comment}{// pointer to actual string data}}
\DoxyCodeLine{175   xbUInt32 size;           \textcolor{comment}{// size of string plus null terminating byte}}
\DoxyCodeLine{176 }
\DoxyCodeLine{177   \textcolor{keywordtype}{void}     ctor(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *s);}
\DoxyCodeLine{178 \textcolor{comment}{//  xbUInt32 CalcSprintfBufSize(const char *format, ...);}}
\DoxyCodeLine{179 }
\DoxyCodeLine{180 \textcolor{comment}{//  char *   xb\_realloc( char *pIn, xbUInt32 iLen );}}
\DoxyCodeLine{181 }
\DoxyCodeLine{182   \textcolor{comment}{// next routine could result in buffer over runs if used with improperly sized buffers}}
\DoxyCodeLine{183   \textcolor{keywordtype}{char} *   xb\_strcpy ( \textcolor{keywordtype}{char} *target, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *source);}
\DoxyCodeLine{184 }
\DoxyCodeLine{185 \};}
\DoxyCodeLine{186 }
\DoxyCodeLine{187 \}        \textcolor{comment}{/* namespace */}}
\DoxyCodeLine{188 \textcolor{preprocessor}{\#endif   }\textcolor{comment}{/* \_\_XBSTRING\_H\_\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
