Xbase64 4.0.1
C++ Library for handling Xbase (DBF) format type files
Public Member Functions | Friends
xb::xbString Class Reference

Class for handling string data. More...

#include <xbstring.h>

Public Member Functions

 xbString (xbUInt32 size)
 Constructor. More...
 
 xbString (char c)
 Constructor. More...
 
 xbString (const char *s, xbUInt32 lMaxLen)
 Constructor. More...
 
 xbString (const xbString &s)
 Constructor. More...
 
 xbString (const char *="")
 Constructor. More...
 
 xbString (xbDouble d)
 Constructor. More...
 
 ~xbString ()
 Destructor. More...
 
xbStringoperator= (const xbString &s)
 Set operator =. More...
 
xbStringoperator= (const char *s)
 Set operator =. More...
 
 operator const char * () const
 Operator const char *. More...
 
char & operator[] (xbUInt32 n) const
 operator [] More...
 
char & operator[] (xbInt32 n) const
 operator [] More...
 
xbStringoperator+= (const xbString &s)
 Append operator +=. More...
 
xbStringoperator+= (const char *s)
 Append operator +=. More...
 
xbStringoperator+= (char c)
 Append operator +=. More...
 
xbStringoperator-= (const xbString &s)
 Append operator -=. More...
 
xbStringoperator-= (const char *s)
 Append operator -=. More...
 
xbStringoperator-= (char c)
 Append operator -=. More...
 
xbBool operator== (const xbString &) const
 operator == More...
 
xbBool operator== (const char *) const
 operator == More...
 
xbBool operator!= (const xbString &) const
 operator != More...
 
xbBool operator!= (const char *) const
 operator != More...
 
xbBool operator< (const xbString &) const
 operator < More...
 
xbBool operator> (const xbString &) const
 operator > More...
 
xbBool operator<= (const xbString &) const
 operator <= More...
 
xbBool operator>= (const xbString &) const
 operator >= More...
 
xbString operator- (const xbString &s)
 Concatonate operator -. More...
 
xbString operator+ (const char *s)
 Concatonate operator +. More...
 
xbString operator+ (const xbString &s)
 Concatonate operator +. More...
 
xbString operator+ (const char c)
 Concatonate operator +. More...
 
xbStringAddBackSlash (char c)
 Add a prefixing back slash to specified characters in the string. More...
 
xbStringAppend (const xbString &s)
 Append data to string. More...
 
xbStringAppend (const char *s)
 Append data to string. More...
 
xbStringAppend (const char *s, xbUInt32 iByteCount)
 Append data to string. More...
 
xbStringAppend (char c)
 Append data to string. More...
 
xbStringAssign (const char *srcStr, xbUInt32 lStartPos, xbUInt32 lCopyLen)
 Assign portion of string. More...
 
xbStringAssign (const char *srcStr, xbUInt32 lStartPos)
 Assign portion of string. More...
 
xbStringAssign (const xbString &s, xbUInt32 pos, xbUInt32 lCopyLen)
 Assign portion of string. More...
 
xbStringAssign (const xbString &s, xbUInt32 lCopyLen)
 Assign portion of string. More...
 
xbString Copy () const
 Copy a string. More...
 
xbUInt32 CountChar (char c) const
 Count the number of characters in the string. More...
 
xbUInt32 CountChar (char c, xbInt16 iOpt) const
 Count the number of characters in the string. More...
 
xbInt16 CvtHexChar (char &cOut)
 Convert hex character to string. More...
 
xbInt16 CvtHexString (xbString &sOut)
 Convert string of hex characters to string. More...
 
xbInt16 CvtULongLong (xbUInt64 &ullOut)
 Convert string to xbUInt64 number. More...
 
xbInt16 CvtLongLong (xbInt64 &llOut)
 Convert string to xbInt64 number. More...
 
xbStringExtractElement (const char *src, char delim, xbUInt32 iCnt, xbInt16 iOpt=0)
 Extract an element out of a delimited string. More...
 
char GetCharacter (xbUInt32 lPos) const
 Get a character by position. More...
 
xbUInt32 GetLastPos (char c) const
 Get the position of the last occurrence of a given character. More...
 
xbUInt32 GetLastPos (const char *s) const
 Get the position of the last occurrence of a given string. More...
 
char GetPathSeparator () const
 Get the path separator out of the string. More...
 
xbUInt32 GetSize () const
 Retrieve the size of the string buffer. More...
 
xbBool HasAlphaChars () const
 Determine if the string has any alpha characters. More...
 
xbBool IsEmpty () const
 Determine if string is empty. More...
 
xbBool IsNull () const
 Determine if string is NULL. More...
 
xbStringLeft (xbUInt32 ulLen)
 Retain left part of string, drop rightmost characters. More...
 
xbUInt32 Len () const
 Retrieve length of current string. More...
 
xbStringLtrim ()
 Left trim white space from string. More...
 
xbStringLtrunc (xbUInt32 ulCnt)
 Left truncate string. More...
 
xbStringMid (xbUInt32 ulPos, xbUInt32 lLen)
 Extract portion of data from string. More...
 
xbStringPadLeft (char c, xbUInt32 ulLen)
 Left pad string. More...
 
xbStringPadRight (char c, xbUInt32 ulLen)
 Right pad string. More...
 
xbUInt32 Pos (char c, xbUInt32 ulStartPos) const
 Determine position of a given character. More...
 
xbUInt32 Pos (char c) const
 Determine position of a given character. More...
 
xbUInt32 Pos (const char *s) const
 Determine position of a given substring. More...
 
xbStringPutAt (xbUInt32 ulPos, char c)
 Insert character into string. More...
 
xbStringRemove (xbUInt32 ulPos, xbUInt32 ulN)
 Remove portion of string. More...
 
xbStringReplace (const char *sReplace, const char *sReplaceWith, xbInt16 iOpt=0)
 Replace a value within a string with another value. More...
 
xbStringResize (xbUInt32 lSize)
 Resize a string. More...
 
xbStringRtrim ()
 Right trim the string. More...
 
xbStringSet (const char *s)
 Set the value of the string. More...
 
xbStringSet (const xbString &s)
 Set the value of the string. More...
 
xbStringSet (const char *s, xbUInt32 ulSize)
 Set the value of the string. More...
 
xbStringSetNum (xbInt32 lNum)
 Set the string to long integer numeric value. More...
 
xbStringSprintf (const char *format,...)
 Printf routine for formatting a string. More...
 
const char * Str () const
 Return string data. More...
 
char * strncpy (char *cDest, xbUInt32 n) const
 Copy all or part of string to character array. More...
 
xbStringSwapChars (char from, char to)
 Swap characters. More...
 
xbStringToLowerCase ()
 Replace all upper case charaters with lower case characters. More...
 
xbStringToUpperCase ()
 Replace all lower case charaters with lower case characters. More...
 
xbStringTrim ()
 Trim all leading and trailing white space from string. More...
 
xbBool ValidLogicalValue () const
 Check for valid logical field data. More...
 
xbBool ValidNumericValue () const
 This function returns true if the data is valid numeric data. More...
 
xbStringZapChar (char c)
 Remove every instance of a character from a string. More...
 
xbStringZapLeadingChar (char c)
 Remove leading character from a string. More...
 
xbStringZapTrailingChar (char c)
 Remove trailing character from a string. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const xbString &s)
 Stream insertion operator <<. More...
 

Detailed Description

Class for handling string data.

This class defines a basic string class with all the functions one would expect in a string class.

For purposes of the xbString class, a string is defined as a variable sized array of one byte characters terminated with a null (0x00 or \0) byte.

This version of the xbString class does not support wide (wchar_t) characters. Perhaps you would be interested in creating a class for supporting wide characters.

This string class handle strings in a 1-based (not 0 based) fashion. Any string routines taking an offset use a 1-based value. That is, the first position of the string is position 1, not 0.


Position 1 (not 0) is considered the first position in a string.
A return of 0 would indicate a not found condition. A return of 1, would be the first byte.

Constructor & Destructor Documentation

◆ xbString() [1/6]

xb::xbString::xbString ( xbUInt32  ulSize)

Constructor.

Parameters
ulSize- Allocation size. The allocation size is normally handled internally by the class, but it can be set in this constructor.

◆ xbString() [2/6]

xb::xbString::xbString ( char  c)

Constructor.

Parameters
c- Initialize string to c.

◆ xbString() [3/6]

xb::xbString::xbString ( const char *  s,
xbUInt32  ulMaxLen 
)

Constructor.

Parameters
sInitialize string to s.
ulMaxLenMaximum length of string. Truncate any characters greater than ulMaxLen.

◆ xbString() [4/6]

xb::xbString::xbString ( const xbString s)

Constructor.

Parameters
sInitialize string to s.

◆ xbString() [5/6]

xb::xbString::xbString ( const char *  s = "")

Constructor.

Parameters
s- Initialize string to s.

◆ xbString() [6/6]

xb::xbString::xbString ( xbDouble  d)

Constructor.

Parameters
d- Initiailize string to d.

◆ ~xbString()

xb::xbString::~xbString ( )

Destructor.

Member Function Documentation

◆ AddBackSlash()

xbString & xb::xbString::AddBackSlash ( char  c)

Add a prefixing back slash to specified characters in the string.

Parameters
cCharacter to prefix with a backslash.
Returns
Reference to this string.

◆ Append() [1/4]

xbString & xb::xbString::Append ( char  c)

Append data to string.

Parameters
cString data to append.
Returns
Reference to this string.

◆ Append() [2/4]

xbString & xb::xbString::Append ( const char *  s)

Append data to string.

Parameters
sString data to append.
Returns
Reference to this string.

◆ Append() [3/4]

xbString & xb::xbString::Append ( const char *  s,
xbUInt32  ulByteCount 
)

Append data to string.

Parameters
sString data to append.
ulByteCountMaximum number of bytes to append.
Returns
Reference to this string.

◆ Append() [4/4]

xbString & xb::xbString::Append ( const xbString s)

Append data to string.

Parameters
sString data to append.
Returns
Reference to this string.

◆ Assign() [1/4]

xbString & xb::xbString::Assign ( const char *  sStr,
xbUInt32  ulStartPos 
)

Assign portion of string.

Parameters
sStr- Source string for copy operation. sStr needs to be a Null terminated string.
ulStartPos- Starting position within source string.
Returns
Reference to this string.

◆ Assign() [2/4]

xbString & xb::xbString::Assign ( const char *  sStr,
xbUInt32  ulStartPos,
xbUInt32  ulCopyLen 
)

Assign portion of string.

Parameters
sStr- Source string for copy operation. sStr needs to be a Null terminated string.
ulStartPos- Starting position within source string.
ulCopyLen- Length of data to copy.
Returns
Reference to this string.

◆ Assign() [3/4]

xbString & xb::xbString::Assign ( const xbString sStr,
xbUInt32  ulStartPos 
)

Assign portion of string.

Parameters
sStr- Source string for copy operation. sStr needs to be a Null terminated string.
ulStartPos- Starting position within source string.
Returns
Reference to this string.

◆ Assign() [4/4]

xbString & xb::xbString::Assign ( const xbString sStr,
xbUInt32  ulStartPos,
xbUInt32  ulCopyLen 
)

Assign portion of string.

Parameters
sStr- Source string for copy operation. sStr needs to be a Null terminated string.
ulStartPos- Starting position within source string.
ulCopyLen- Length of data to copy.
Returns
Reference to this string.

◆ Copy()

xbString xb::xbString::Copy ( ) const

Copy a string.

Returns
xbString.

◆ CountChar() [1/2]

xbUInt32 xb::xbString::CountChar ( char  c) const

Count the number of characters in the string.

Parameters
cCharacter to count.
Returns
The number of characters.

◆ CountChar() [2/2]

xbUInt32 xb::xbString::CountChar ( char  c,
xbInt16  iOpt 
) const

Count the number of characters in the string.

Parameters
cCharacter to count.
iOpt0 - Count the number of characters.
1 - Count the number of characters not between single or double quotes.
Returns
The number of characters.

◆ CvtHexChar()

xbInt16 xb::xbString::CvtHexChar ( char &  cOut)

Convert hex character to string.

This routine converts a four byte string in the format of 0x00 to a one byte char value. The first four bytes of the string must be in the format 0x00. Anything past the first four bytes is disregarded.

Parameters
cOutOutput character.
Returns
XB_INVALID_PARM on error
XB_NO_ERROR on success.

◆ CvtHexString()

xbInt16 xb::xbString::CvtHexString ( xbString sOut)

Convert string of hex characters to string.

This routine converts a string of four byte format of 0x00 to a string of one byte chars.

Parameters
sOutOutput string of converted characters.
Returns
XB_INVALID_PARM on error
XB_NO_ERROR on success.

◆ CvtLongLong()

xbInt16 xb::xbString::CvtLongLong ( xbInt64 &  llOut)

Convert string to xbInt64 number.

Parameters
llOut- output long long.
Returns
XB_NO_ERROR

◆ CvtULongLong()

xbInt16 xb::xbString::CvtULongLong ( xbUInt64 &  ullOut)

Convert string to xbUInt64 number.

Parameters
ullOut- output unsigned long long.
Returns
XB_NO_ERROR

◆ ExtractElement()

xbString & xb::xbString::ExtractElement ( const char *  pSrc,
char  cDelim,
xbUInt32  lSkipCnt,
xbInt16  iOpt = 0 
)

Extract an element out of a delimited string.

Parameters
pSrcSource string.
cDelimDelimiter.
lSkipCntNumber of delimiters to skip.
iOpt0 - ignore single and double quotes.
1 - ignore delimiters between single or double quotes.
Returns
Reference to string extracted from element.

◆ GetCharacter()

char xb::xbString::GetCharacter ( xbUInt32  n) const

Get a character by position.

Parameters
n- Position in string to extract. First position is 1 (not 0).
Returns
Character from position n, or null.

◆ GetLastPos() [1/2]

xbUInt32 xb::xbString::GetLastPos ( char  c) const

Get the position of the last occurrence of a given character.

Parameters
c- Character to search for.
Returns
Last position of character in the string.

◆ GetLastPos() [2/2]

xbUInt32 xb::xbString::GetLastPos ( const char *  s) const

Get the position of the last occurrence of a given string.

Parameters
s- String to search for.
Returns
Last position of character in the string.

◆ GetPathSeparator()

char xb::xbString::GetPathSeparator ( ) const

Get the path separator out of the string.

Returns
Char value containing either / or \ depending on OS.

◆ GetSize()

xbUInt32 xb::xbString::GetSize ( ) const

Retrieve the size of the string buffer.

Returns
Size of string buffer including the null terminating byte.

◆ HasAlphaChars()

xbBool xb::xbString::HasAlphaChars ( ) const

Determine if the string has any alpha characters.

Returns
xbTrue - String contains one or more aloha characters.
xbFalse - String contains no alpha characters.

◆ IsEmpty()

xbBool xb::xbString::IsEmpty ( ) const

Determine if string is empty.

Returns
xbTrue if string is empty.
xbFalse if string is not empty.

◆ IsNull()

xbBool xb::xbString::IsNull ( ) const

Determine if string is NULL.

Returns
xbTrue if string is NULL.
xbFalse if string is not NULL.

◆ Left()

xbString & xb::xbString::Left ( xbUInt32  ulLen)

Retain left part of string, drop rightmost characters.

Parameters
ulLenNew string length, truncate rightmost excess.
Returns
Reference to string.

◆ Len()

xbUInt32 xb::xbString::Len ( ) const

Retrieve length of current string.

Returns
String length, excluding the terminating null byte.

◆ Ltrim()

xbString & xb::xbString::Ltrim ( )

Left trim white space from string.

Returns
Reference to this string.

◆ Ltrunc()

xbString & xb::xbString::Ltrunc ( xbUInt32  ulCnt)

Left truncate string.

Parameters
ulCntNumber of bytes to remove from the left.
Returns
Reference to this string.

◆ Mid()

xbString & xb::xbString::Mid ( xbUInt32  ulStartPos,
xbUInt32  ulTargLen 
)

Extract portion of data from string.

Parameters
ulStartPosStarting position
ulTargLenLength
Returns
Reference to string

◆ operator const char *()

xb::xbString::operator const char * ( ) const

Operator const char *.

Returns
Pointer to string data.

◆ operator!=() [1/2]

xbBool xb::xbString::operator!= ( const char *  s) const

operator !=

Parameters
sString to compare
Returns
xbTrue - Strings don't match.
zbFalse - Strings match.

◆ operator!=() [2/2]

xbBool xb::xbString::operator!= ( const xbString s) const

operator !=

Parameters
sString to compare
Returns
xbTrue - Strings don't match.
xbFalse - Strings match.

◆ operator+() [1/3]

xbString xb::xbString::operator+ ( const char *  s1)

Concatonate operator +.

Concatonate left string with right string returning reference to new string.

Parameters
s1Right string operator.

◆ operator+() [2/3]

xbString xb::xbString::operator+ ( const char  c)

Concatonate operator +.

Concatonate left string with right string returning reference to new string.

Parameters
cRight string operator.

◆ operator+() [3/3]

xbString xb::xbString::operator+ ( const xbString s1)

Concatonate operator +.

Concatonate left string with right string returning reference to new string.

Parameters
s1Right string operator.

◆ operator+=() [1/3]

xbString & xb::xbString::operator+= ( char  c)

Append operator +=.

Parameters
c- Append c to the string.

◆ operator+=() [2/3]

xbString & xb::xbString::operator+= ( const char *  s)

Append operator +=.

Parameters
s- Append s to the string.

◆ operator+=() [3/3]

xbString & xb::xbString::operator+= ( const xbString s)

Append operator +=.

Parameters
s- Append s to the string.

◆ operator-()

xbString xb::xbString::operator- ( const xbString s1)

Concatonate operator -.

Concatonate left string with right string returning reference to new string. Both strings are trimmed.

Parameters
s1Right string operator.

◆ operator-=() [1/3]

xbString & xb::xbString::operator-= ( char  c)

Append operator -=.

Append c to the right of this string, trimming right space on this string first.

Parameters
c- Append s to the right of the string value.

◆ operator-=() [2/3]

xbString & xb::xbString::operator-= ( const char *  s)

Append operator -=.

Append s to the right of this string, right trimming both strings.

Parameters
s- Append s to the right of the string value.

◆ operator-=() [3/3]

xbString & xb::xbString::operator-= ( const xbString s)

Append operator -=.

Append s to the right of this string, right trimming both strings.

Parameters
s- Append s to the right of the string value.

◆ operator<()

xbBool xb::xbString::operator< ( const xbString s) const

operator <

Parameters
sString to compare
Returns
xbTrue - Left string is less than the right string.
zbFalse - Left string is not less than the right string.

◆ operator<=()

xbBool xb::xbString::operator<= ( const xbString s) const

operator <=

Parameters
sString to compare
Returns
xbTrue - Left string is less than or equal to the right string.
zbFalse - Left string is not less than or equal to the right string.

◆ operator=() [1/2]

xbString & xb::xbString::operator= ( const char *  s)

Set operator =.

Parameters
s- Set the string to the string on the right of the equal sign.

◆ operator=() [2/2]

xbString & xb::xbString::operator= ( const xbString s)

Set operator =.

Parameters
s- Set the string to the string on the right of the equal sign.

◆ operator==() [1/2]

xbBool xb::xbString::operator== ( const char *  s) const

operator ==

Parameters
sString to compare
Returns
xbTrue - Strings match.
zbFalse - Strings don't match.

◆ operator==() [2/2]

xbBool xb::xbString::operator== ( const xbString s) const

operator ==

Parameters
sString to compare
Returns
xbTrue - Strings match.
zbFalse - Strings don't match.

◆ operator>()

xbBool xb::xbString::operator> ( const xbString s) const

operator >

Parameters
sString to compare
Returns
xbTrue - Left string is greater than the right string.
zbFalse - Left string is not greater than the right string.

◆ operator>=()

xbBool xb::xbString::operator>= ( const xbString s) const

operator >=

Parameters
sString to compare
Returns
xbTrue - Left string is greater than or equal to the right string.
zbFalse - Left string is not greater than or equal to the right string.

◆ operator[]() [1/2]

char & xb::xbString::operator[] ( xbInt32  n) const

operator []

Parameters
n- Offset into the string of the byte to retrieve.
Returns
c - The character to return from the offset within the [] brackets.

◆ operator[]() [2/2]

char & xb::xbString::operator[] ( xbUInt32  n) const

operator []

Parameters
n- Offset into the string of the byte to retrieve.
Returns
c - The character to return from the offset within the [] brackets.

◆ PadLeft()

xbString & xb::xbString::PadLeft ( char  c,
xbUInt32  ulNewLen 
)

Left pad string.

Parameters
cPadding character.
ulNewLenNew string length.
Returns
Reference to this string.

◆ PadRight()

xbString & xb::xbString::PadRight ( char  c,
xbUInt32  ulNewLen 
)

Right pad string.

Parameters
cPadding character.
ulNewLenNew string length.
Returns
Reference to this string.

◆ Pos() [1/3]

xbUInt32 xb::xbString::Pos ( char  c) const

Determine position of a given character.

Parameters
cSeek character
Returns
Position within string. Returns 0 if not found.

◆ Pos() [2/3]

xbUInt32 xb::xbString::Pos ( char  c,
xbUInt32  ulStartPos 
) const

Determine position of a given character.

Parameters
cSeek character
ulStartPosstarting position for search, first position is 1
Returns
Position within string. Returns 0 if not found.

◆ Pos() [3/3]

xbUInt32 xb::xbString::Pos ( const char *  s) const

Determine position of a given substring.

Parameters
sSubstring
Returns
Position within string. Returns 0 if not found.

◆ PutAt()

xbString & xb::xbString::PutAt ( xbUInt32  ulPos,
char  c 
)

Insert character into string.

Parameters
ulPosInsertion position.
cCharacter to insert.
Returns
Reference to this string.

◆ Remove()

xbString & xb::xbString::Remove ( xbUInt32  ulStartPos,
xbUInt32  ulDelSize 
)

Remove portion of string.

Parameters
ulStartPosStarting position for removal operation.
ulDelSizeSize of deletion.
Returns
Reference to string.

◆ Replace()

xbString & xb::xbString::Replace ( const char *  sReplace,
const char *  sReplaceWith,
xbInt16  iOption = 0 
)

Replace a value within a string with another value.

Parameters
sReplace- Character string to replace.
sReplaceWith- Character string to replace with
iOption- 0 = All occurrences, 1 = first occurrence
Returns
Reference to this string.

◆ Resize()

xbString & xb::xbString::Resize ( xbUInt32  ulSize)

Resize a string.

Parameters
ulSize- New string size, including null termination byte.
Returns
Reference to this string.

◆ Rtrim()

xbString & xb::xbString::Rtrim ( )

Right trim the string.

This routine removes any trailing white space on the string.

Returns
Reference to string.

◆ Set() [1/3]

xbString & xb::xbString::Set ( const char *  s)

Set the value of the string.

Note: This routine fails if you try to set the string to itself or some part of itself.

Parameters
sValue to set the string.
Returns
Reference to string.

◆ Set() [2/3]

xbString & xb::xbString::Set ( const char *  s,
xbUInt32  ulSize 
)

Set the value of the string.

Note: This routine fails if you try to set the string to itself or some part of itself.

Parameters
sValue to set the string.
ulSizeMaximum size of resultant string.
Returns
Reference to string.

◆ Set() [3/3]

xbString & xb::xbString::Set ( const xbString s)

Set the value of the string.

Parameters
sValue to set the string.
Returns
Reference to string.

◆ SetNum()

xbString & xb::xbString::SetNum ( xbInt32  lNum)

Set the string to long integer numeric value.

Parameters
lNumValue to set the string
Returns
Reference to this string.

◆ Sprintf()

xbString & xb::xbString::Sprintf ( const char *  sFormat,
  ... 
)

Printf routine for formatting a string.

See documentation on the standard C printf function for how to use this.

MyString.Sprintf( "a number %d some text %s", 100, "test text data" );

Parameters
sFormatA format specifier
Returns
Reference to a formatted string

◆ Str()

const char * xb::xbString::Str ( ) const

Return string data.

Returns
char * to string data or NULL if string is empty

◆ strncpy()

char * xb::xbString::strncpy ( char *  cDest,
xbUInt32  n 
) const

Copy all or part of string to character array.

Parameters
cDestpointer to destination buffer.
nNumber of bytest to copy. It is the responsibility of the application to verify the buffer is large enough to hold the string contents.
Returns
char * to result

◆ SwapChars()

xbString & xb::xbString::SwapChars ( char  cFrom,
char  cTo 
)

Swap characters.

Parameters
cFromcharacter to replace.
cTocharacter to replace with.
Returns
Reference to this string.

◆ ToLowerCase()

xbString & xb::xbString::ToLowerCase ( )

Replace all upper case charaters with lower case characters.

Returns
Reference to this string.

◆ ToUpperCase()

xbString & xb::xbString::ToUpperCase ( )

Replace all lower case charaters with lower case characters.

Returns
Reference to this string.

◆ Trim()

xbString & xb::xbString::Trim ( )

Trim all leading and trailing white space from string.

Returns
Reference to string.

◆ ValidLogicalValue()

xbBool xb::xbString::ValidLogicalValue ( ) const

Check for valid logical field data.

Valid logical data is one 'T', 'F', 'N' or 'Y'.

Returns
xbTrue if the data is valid logical data.
xbFalse if not valid logical data.

◆ ValidNumericValue()

xbBool xb::xbString::ValidNumericValue ( ) const

This function returns true if the data is valid numeric data.

Returns
xbTrue if valid numeric data.
xbFalse if not valid numeric daata.

◆ ZapChar()

xbString & xb::xbString::ZapChar ( char  c)

Remove every instance of a character from a string.

Parameters
ccharacter to remove from string.
Returns
Reference to this stirng.void

◆ ZapLeadingChar()

xbString & xb::xbString::ZapLeadingChar ( char  c)

Remove leading character from a string.

Parameters
ccharacter to remove from beginning of string.
Returns
Reference to this string.

◆ ZapTrailingChar()

xbString & xb::xbString::ZapTrailingChar ( char  c)

Remove trailing character from a string.

Parameters
ccharacter to remove from ending of string.
Returns
Reference to this string.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const xbString s 
)
friend

Stream insertion operator <<.

std::cout << MyString << std::endl;

Parameters
osOutput stream
sString to send to output stream

The documentation for this class was generated from the following files: