Software and Services, Portable Libraries  2019.Mar.01
A library for managing digital certificates
SoftwareAndServices::Library::Common::String Class Reference

This is a class that allows: More...

#include "<SaS/Common/String.hpp>"

+ Inheritance diagram for SoftwareAndServices::Library::Common::String:
+ Collaboration diagram for SoftwareAndServices::Library::Common::String:

Public Member Functions

 String ()
 Constructor. More...
 
 String (const String &existing)
 Constructor. More...
 
 String (const String *existing)
 Constructor. More...
 
 String (String &existing)
 Constructor. More...
 
 String (const char *str)
 Constructor. More...
 
 String (const char16_t *str)
 Constructor. More...
 
 String (const char32_t *str)
 Constructor. More...
 
 String (const wchar_t *wstr)
 Constructor. More...
 
const char32_t * Append (const char *newStrData, size_t charCount=0)
 append() Append newStrData up to charCount characters are appended. More...
 
const char32_t * Append (const wchar_t *newStrData, size_t charCount=0)
 append() Append newStrData up to charCount characters are appended. More...
 
const char32_t * Append (const char16_t *newStrData, size_t charCount=0)
 append() Append newStrData up to charCount characters are appended. More...
 
const char32_t * Append (const char32_t *newStrData, size_t charCount=0)
 append() Append newStrData up to charCount characters are appended. More...
 
const char32_t * Append (const String *newStrData, size_t charCount=0)
 append() Append newStrData up to charCount characters are appended. More...
 
const char32_t * Append (const String &newStrData, size_t charCount=0)
 append() Append newStrData up to charCount characters are appended. More...
 
const char32_t * Append (char binaryValue)
 Append character as an integer. More...
 
const char32_t * Append (unsigned char binaryValue)
 Append a 8 bit unsigned number after converting it to a string. More...
 
const char32_t * Append (short binaryValue)
 Append a 16 bit signed number after converting it to a string. More...
 
const char32_t * Append (unsigned short binaryValue)
 Append a 16 bit unsigned number after converting it to a string. More...
 
const char32_t * Append (int binaryValue)
 Append a 32 bit signed number after converting it to a string. More...
 
const char32_t * Append (unsigned int binaryValue)
 Append a 32 bit unsigned number after converting it to a string. More...
 
const char32_t * Append (long binaryValue)
 Append a 32/64 bit signed depending on the OS number after converting it to a string. More...
 
const char32_t * Append (unsigned long bianryValue)
 Append a 32/64 bit unsigned depending on the OS number after converting it to a string. More...
 
const char32_t * Append (long long binaryValue)
 Append a 64 bit signed number after converting it to a string. More...
 
const char32_t * Append (unsigned long long binaryValue)
 Append a 64 bit unsigned number after converting it to a string. More...
 
const char32_t * Append (const DateTime *dt)
 Returns appended in ISO format 'YYYYMMDDTHHMMSSZ' in Z. More...
 
const char32_t * Append (const DateTime &dt)
 Returns appended in ISO format 'YYYYMMDDTHHMMSSZ' in Z. More...
 
const char32_t * AppendChar (char newStrData)
 Append character as a single char. More...
 
const char32_t * AppendChar (wchar_t newStrData)
 Append character as a single char. More...
 
const char32_t * AppendChar (char16_t newStrData)
 Append character as a single char. More...
 
const char32_t * AppendChar (char32_t newStrData)
 Append character as a single char. More...
 
void Clear ()
 Remove all contents from the string. More...
 
virtual InstanceCount_t decInstance () const
 Decrement the instance. More...
 
void Empty ()
 
const char * Get () const
 get() - Get the value in multibyte format. More...
 
const char32_t * Get32 () const
 wget() - Get the value in (whcar_t) format. More...
 
virtual InstanceCount_t getInstance () const
 
bool GetLocale (int category, const char **locale) const
 getLocale() More...
 
void * GetMem () const
 A hook to a run time license. More...
 
virtual InstanceCount_t incInstance () const
 Increment the instance. More...
 
size_t Len () const
 len() - Get the string length (number of printable characters). More...
 
bool Lock () const
 lock() - Lock the string from usage - rarely needed in MT work. More...
 
size_t Octets () const
 octets() - Get the octet count of (char*) characters. More...
 
size_t Octets16 () const
 octets16() - Get the octet count of (char16_t*) characters. More...
 
size_t Octets32 () const
 octets32() - Get the octet count of (char32_t*) characters. More...
 
void operator delete (void *ToFree)
 
bool operator!= (String *Other) const
 != - Compare strings More...
 
bool operator!= (const String *Other) const
 != - Compare strings More...
 
bool operator!= (String &Other) const
 != - Compare strings More...
 
bool operator!= (const String &Other) const
 != - Compare strings More...
 
bool operator!= (const char *Other) const
 != - Compare strings More...
 
String operator+ (const String &Other)
 operator plus (+) - Append string to the current object, return a new object More...
 
String operator+ (const String *Other)
 operator plus (+) - Append string to the current object, return a new object More...
 
String operator+ (const char *Other)
 operator plus (+) - Append string to the current object, return a new object More...
 
String operator+ (const wchar_t *Other)
 operator plus (+) - Append string to the current object, return a new object More...
 
String operator+ (const char16_t *Other)
 operator plus (+) - Append string to the current object, return a new object More...
 
String operator+ (const char32_t *Other)
 operator plus (+) - Append string to the current object, return a new object More...
 
Stringoperator+= (const String &Other)
 += - Append string More...
 
Stringoperator+= (const String *Other)
 += - Append string More...
 
Stringoperator+= (const char *Other)
 += - Append string More...
 
Stringoperator+= (const wchar_t *Other)
 += - Append string More...
 
Stringoperator+= (const char16_t *Other)
 += - Append string More...
 
Stringoperator+= (const char32_t *Other)
 += - Append string More...
 
bool operator< (String *Other) const
 < - Compare strings More...
 
bool operator< (const String *Other) const
 < - Compare strings More...
 
bool operator< (String &Other) const
 < - Compare strings More...
 
bool operator< (const String &Other) const
 < - Compare strings More...
 
bool operator< (const char *Other) const
 < - Compare strings More...
 
bool operator<= (String *Other) const
 <= - Compare strings More...
 
bool operator<= (const String *Other) const
 <= - Compare strings More...
 
bool operator<= (String &Other) const
 <= - Compare strings More...
 
bool operator<= (const String &Other) const
 <= - Compare strings More...
 
bool operator<= (const char *Other) const
 <= - Compare strings More...
 
Stringoperator= (const String &CopyFrom)
 = - Copy operator. More...
 
Stringoperator= (const char *CopyFrom)
 = - Copy operator. More...
 
Stringoperator= (const wchar_t *CopyFrom)
 = - Copy operator. More...
 
Stringoperator= (const char16_t *CopyFrom)
 = - Copy operator. More...
 
Stringoperator= (const char32_t *CopyFrom)
 = - Copy operator. More...
 
bool operator== (String *Other) const
 == - Compare strings More...
 
bool operator== (const String *other) const
 == - Compare strings More...
 
bool operator== (String &Other) const
 == - Compare strings More...
 
bool operator== (const String &Other) const
 == - Compare strings More...
 
bool operator== (const char *Other) const
 == - Compare strings More...
 
bool operator> (String *Other) const
 
  • Compare strings
More...
 
bool operator> (const String *Other) const
 
  • Compare strings
More...
 
bool operator> (String &Other) const
 
  • Compare strings
More...
 
bool operator> (const String &Other) const
 
  • Compare strings
More...
 
bool operator> (const char *Other) const
 
  • Compare strings
More...
 
bool operator>= (String *Other) const
 >= - Compare strings More...
 
bool operator>= (const String *Other) const
 >= - Compare strings More...
 
bool operator>= (String &Other) const
 >= - Compare strings More...
 
bool operator>= (const String &Other) const
 >= - Compare strings More...
 
bool operator>= (const char *Other) const
 >= - Compare strings More...
 
uint32_t Read (File &Fp)
 Read this object from File. More...
 
bool SetLocale (int category, const char *locale)
 SetLocale() More...
 
size_t sprintf (const char *format,...)
 Like POSIX C sprintf, append the formatted string to this object. More...
 
size_t sprintf (const wchar_t *format,...)
 Like POSIX C sprintf, append the formatted string to this object. More...
 
size_t sprintf (const char16_t *format,...)
 Like POSIX C sprintf, append the formatted string to this object. More...
 
size_t sprintf (const char32_t *format,...)
 Like POSIX C sprintf, append the formatted string to this object. More...
 
size_t sprintf (const String *format,...)
 Like POSIX C sprintf, append the formatted string to this object. More...
 
void ToLower ()
 Convert the string to lower case in place. More...
 
void ToUpper ()
 Convert the string to UPPER case in place. More...
 
bool TryLock () const
 lock() - Lock the string from usage - rarely needed in MT work. More...
 
bool Unlock () const
 lock() - Lock the string from usage - rarely needed in MT work. More...
 
const wchar_t * WGet () const
 wget() - Get the value in (whcar_t) format. More...
 
size_t WOctets () const
 woctets() - Get the octet count of (wchar_t*) characters. More...
 
uint32_t Write (File &Fp)
 Write this object to File. More...
 
virtual bool_t xdr (XDR *xdrs)
 Read/Write the string in XDR format. More...
 

Static Public Member Functions

static StringToLower (const char *SomeString)
 Create a new String from the (char*) converted to lower case. More...
 
static StringToLower (const wchar_t *SomeString)
 Create a new String from the (wchar_t*) converted to lower case. More...
 
static StringToLower (const char16_t *SomeString)
 Create a new String from the (char16_t*) converted to lower case. More...
 
static StringToLower (const char32_t *SomeString)
 Create a new String from the (char32_t*) converted to lower case. More...
 
static StringToLower (const String *SomeString)
 Create a new String from the (String*) converted to lower case. More...
 
static StringToUpper (const char *SomeString)
 Create a new String from the (char*) converted to UPPER case. More...
 
static StringToUpper (const wchar_t *SomeString)
 Create a new String from the (wchar_t*) converted to UPPER case. More...
 
static StringToUpper (const char16_t *SomeString)
 Create a new String from the (char16_t*) converted to UPPER case. More...
 
static StringToUpper (const char32_t *SomeString)
 Create a new String from the (char32_t*) converted to UPPER case. More...
 
static StringToUpper (const String *SomeString)
 Create a new String from the (String*) converted to UPPER case. More...
 
static bool_t xdr_String (XDR *xdrs, String *Pointer)
 Read/Write the String in XDR format. More...
 
static int xdr_String (XDR *xdrs, void *Pointer)
 Read/Write the String in XDR format. More...
 
static bool_t xdr_T (XDR *xdrs, String *Pointer)
 Read/Write the XDR object. More...
 
static bool_t xdr_T (XDR *xdrs, void *Pointer)
 Read/Write the XDR object. More...
 

Detailed Description

This is a class that allows:

  • Conversion between multibyte and wide characters.
  • Does reference counting of the object.

I wrote this before the STD::string class existed or was compatible on multiple platforms.

I still use it on Windows to convert between multibyte and wchar_t character strings when calling DLL's compile from open source where they do not map directly to the windows character sets.

Definition at line 114 of file String.hpp.

Constructor & Destructor Documentation

◆ String() [1/8]

SoftwareAndServices::Library::Common::String::String ( )

Constructor.

◆ String() [2/8]

SoftwareAndServices::Library::Common::String::String ( const String existing)

Constructor.

Parameters
existingA REF to an existing string.

◆ String() [3/8]

SoftwareAndServices::Library::Common::String::String ( const String existing)

Constructor.

Parameters
existingA pointer to an existing string.

◆ String() [4/8]

SoftwareAndServices::Library::Common::String::String ( String existing)

Constructor.

On WIN32, when the existing String is not CONST then then the template macros fail to declare themselves as mutable, so this additional constructor is needed only on windows.

Parameters
existingA REF to an existing string.

◆ String() [5/8]

SoftwareAndServices::Library::Common::String::String ( const char *  str)

Constructor.

Parameters
strA C string to be used to initialize the data

◆ String() [6/8]

SoftwareAndServices::Library::Common::String::String ( const char16_t *  str)

Constructor.

Parameters
strA C string to be used to initialize the data

◆ String() [7/8]

SoftwareAndServices::Library::Common::String::String ( const char32_t *  str)

Constructor.

Parameters
strA C string to be used to initialize the data

◆ String() [8/8]

SoftwareAndServices::Library::Common::String::String ( const wchar_t *  wstr)

Constructor.

Parameters
wstrA wchar_t (also a Windows 'string' data type).

Member Function Documentation

◆ Append() [1/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( const char *  newStrData,
size_t  charCount = 0 
)

append() Append newStrData up to charCount characters are appended.

Returns
The resulting char32_t string.

◆ Append() [2/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( const wchar_t *  newStrData,
size_t  charCount = 0 
)

append() Append newStrData up to charCount characters are appended.

Returns
The resulting char32_t string.

◆ Append() [3/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( const char16_t *  newStrData,
size_t  charCount = 0 
)

append() Append newStrData up to charCount characters are appended.

Returns
The resulting char32_t string.

◆ Append() [4/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( const char32_t *  newStrData,
size_t  charCount = 0 
)

append() Append newStrData up to charCount characters are appended.

Returns
The resulting char32_t string.

◆ Append() [5/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( const String newStrData,
size_t  charCount = 0 
)

append() Append newStrData up to charCount characters are appended.

Returns
The resulting char32_t string.

◆ Append() [6/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( const String newStrData,
size_t  charCount = 0 
)

append() Append newStrData up to charCount characters are appended.

Returns
The resulting char32_t string.

◆ Append() [7/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( char  binaryValue)

Append character as an integer.

Append a 8 bit signed number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [8/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( unsigned char  binaryValue)

Append a 8 bit unsigned number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [9/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( short  binaryValue)

Append a 16 bit signed number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [10/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( unsigned short  binaryValue)

Append a 16 bit unsigned number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [11/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( int  binaryValue)

Append a 32 bit signed number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [12/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( unsigned int  binaryValue)

Append a 32 bit unsigned number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [13/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( long  binaryValue)

Append a 32/64 bit signed depending on the OS number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [14/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( unsigned long  bianryValue)

Append a 32/64 bit unsigned depending on the OS number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [15/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( long long  binaryValue)

Append a 64 bit signed number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [16/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( unsigned long long  binaryValue)

Append a 64 bit unsigned number after converting it to a string.

Returns
The resulting char32_t string.

◆ Append() [17/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( const DateTime dt)

Returns appended in ISO format 'YYYYMMDDTHHMMSSZ' in Z.

Parameters
dtThe DateTime object pointer to append.
Returns
The resulting char32_t string.

◆ Append() [18/18]

const char32_t* SoftwareAndServices::Library::Common::String::Append ( const DateTime dt)

Returns appended in ISO format 'YYYYMMDDTHHMMSSZ' in Z.

Parameters
dtThe DateTime object to append.
Returns
The resulting char32_t string.

◆ AppendChar() [1/4]

const char32_t* SoftwareAndServices::Library::Common::String::AppendChar ( char  newStrData)

Append character as a single char.

Returns
The resulting char32_t string.

◆ AppendChar() [2/4]

const char32_t* SoftwareAndServices::Library::Common::String::AppendChar ( wchar_t  newStrData)

Append character as a single char.

Returns
The resulting char32_t string.

◆ AppendChar() [3/4]

const char32_t* SoftwareAndServices::Library::Common::String::AppendChar ( char16_t  newStrData)

Append character as a single char.

Returns
The resulting char32_t string.

◆ AppendChar() [4/4]

const char32_t* SoftwareAndServices::Library::Common::String::AppendChar ( char32_t  newStrData)

Append character as a single char.

Returns
The resulting char32_t string.

◆ Clear()

void SoftwareAndServices::Library::Common::String::Clear ( )

Remove all contents from the string.

◆ decInstance()

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< String >::decInstance ( ) const
inlinevirtualinherited

Decrement the instance.

Returns
The instance count, after decrementing it.

Definition at line 129 of file instance.hpp.

◆ Empty()

void SoftwareAndServices::Library::Common::String::Empty ( )
Deprecated:
Use clear
See also
clear()

◆ Get()

const char* SoftwareAndServices::Library::Common::String::Get ( ) const

get() - Get the value in multibyte format.

Returns
The value in multibyte format, converts if needed form input charset.
Exceptions
(Error*)when the input charset can not be converted to this objects output charset. The error number will be EILSEQ when invalid multibyte sequence has been encountered in the input. The error number will be EINVAL when an incomplete multibyte sequence has been encountered in the input.

◆ Get32()

const char32_t* SoftwareAndServices::Library::Common::String::Get32 ( ) const

wget() - Get the value in (whcar_t) format.

Returns
The value in char32_t format, converts if needed form input charset.
Exceptions
(Error*)when the input charset can not be converted to this objects output charset. The error number will be EILSEQ when invalid multibyte sequence has been encountered in the input. The error number will be EINVAL when an incomplete multibyte sequence has been encountered in the input.

◆ getInstance()

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< String >::getInstance ( ) const
inlinevirtualinherited
Returns
The current instance count.

Definition at line 118 of file instance.hpp.

◆ GetLocale()

bool SoftwareAndServices::Library::Common::String::GetLocale ( int  category,
const char **  locale 
) const

getLocale()

Get the current locale name.

Parameters
categoryLC_CTYPE Character classification and case conversion.

LC_COLLATE Collation order.

LC_TIME Date and time formats.

LC_NUMERIC Non-monetary numeric formats.

LC_MONETARY Monetary formats.

LC_MESSAGES Formats of informative and diagnostic messages and interactive responses.

Parameters
localeThe string will be filled with the locale name.
Returns
TRUE if locale is valid.

◆ GetMem()

void* SoftwareAndServices::Library::Common::String::GetMem ( ) const

A hook to a run time license.

◆ incInstance()

virtual InstanceCount_t SoftwareAndServices::Library::Common::instance< String >::incInstance ( ) const
inlinevirtualinherited

Increment the instance.

Returns
The instance value, after incrementing it.

Definition at line 109 of file instance.hpp.

◆ Len()

size_t SoftwareAndServices::Library::Common::String::Len ( ) const

len() - Get the string length (number of printable characters).

Returns
The number of printable characters in the value.

◆ Lock()

bool SoftwareAndServices::Library::Common::String::Lock ( ) const

lock() - Lock the string from usage - rarely needed in MT work.

Returns
TRUE if you get the lock.

◆ Octets()

size_t SoftwareAndServices::Library::Common::String::Octets ( ) const

octets() - Get the octet count of (char*) characters.

Returns
The octet count.

◆ Octets16()

size_t SoftwareAndServices::Library::Common::String::Octets16 ( ) const

octets16() - Get the octet count of (char16_t*) characters.

Returns
The octet count.

◆ Octets32()

size_t SoftwareAndServices::Library::Common::String::Octets32 ( ) const

octets32() - Get the octet count of (char32_t*) characters.

Returns
The octet count.

◆ operator!=() [1/5]

bool SoftwareAndServices::Library::Common::String::operator!= ( String Other) const

!= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator!=() [2/5]

bool SoftwareAndServices::Library::Common::String::operator!= ( const String Other) const

!= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator!=() [3/5]

bool SoftwareAndServices::Library::Common::String::operator!= ( String Other) const

!= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator!=() [4/5]

bool SoftwareAndServices::Library::Common::String::operator!= ( const String Other) const

!= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator!=() [5/5]

bool SoftwareAndServices::Library::Common::String::operator!= ( const char *  Other) const

!= - Compare strings

Parameters
OtherThe existing (char*) to compare to.
Returns
The state of the compare.

◆ operator+() [1/6]

String SoftwareAndServices::Library::Common::String::operator+ ( const String Other)

operator plus (+) - Append string to the current object, return a new object

Parameters
OtherThe string to append from.
Returns
The updated String.

◆ operator+() [2/6]

String SoftwareAndServices::Library::Common::String::operator+ ( const String Other)

operator plus (+) - Append string to the current object, return a new object

Parameters
OtherThe string to append from.
Returns
The updated String.

◆ operator+() [3/6]

String SoftwareAndServices::Library::Common::String::operator+ ( const char *  Other)

operator plus (+) - Append string to the current object, return a new object

Parameters
OtherThe string to append from.
Returns
The updated String.

◆ operator+() [4/6]

String SoftwareAndServices::Library::Common::String::operator+ ( const wchar_t *  Other)

operator plus (+) - Append string to the current object, return a new object

Parameters
OtherThe string to append from.
Returns
The updated String.

◆ operator+() [5/6]

String SoftwareAndServices::Library::Common::String::operator+ ( const char16_t *  Other)

operator plus (+) - Append string to the current object, return a new object

Parameters
OtherThe string to append from.
Returns
The updated String.

◆ operator+() [6/6]

String SoftwareAndServices::Library::Common::String::operator+ ( const char32_t *  Other)

operator plus (+) - Append string to the current object, return a new object

Parameters
OtherThe string to append from.
Returns
The updated String.

◆ operator+=() [1/6]

String& SoftwareAndServices::Library::Common::String::operator+= ( const String Other)

+= - Append string

Parameters
OtherThe existing String to compare append.
Returns
The updated String.

◆ operator+=() [2/6]

String& SoftwareAndServices::Library::Common::String::operator+= ( const String Other)

+= - Append string

Parameters
OtherThe existing String to compare append.
Returns
The updated String.

◆ operator+=() [3/6]

String& SoftwareAndServices::Library::Common::String::operator+= ( const char *  Other)

+= - Append string

Parameters
OtherThe existing String to compare append.
Returns
The updated String.

◆ operator+=() [4/6]

String& SoftwareAndServices::Library::Common::String::operator+= ( const wchar_t *  Other)

+= - Append string

Parameters
OtherThe existing String to compare append.
Returns
The updated String.

◆ operator+=() [5/6]

String& SoftwareAndServices::Library::Common::String::operator+= ( const char16_t *  Other)

+= - Append string

Parameters
OtherThe existing String to compare append.
Returns
The updated String.

◆ operator+=() [6/6]

String& SoftwareAndServices::Library::Common::String::operator+= ( const char32_t *  Other)

+= - Append string

Parameters
OtherThe existing String to compare append.
Returns
The updated String.

◆ operator<() [1/5]

bool SoftwareAndServices::Library::Common::String::operator< ( String Other) const

< - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator<() [2/5]

bool SoftwareAndServices::Library::Common::String::operator< ( const String Other) const

< - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator<() [3/5]

bool SoftwareAndServices::Library::Common::String::operator< ( String Other) const

< - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator<() [4/5]

bool SoftwareAndServices::Library::Common::String::operator< ( const String Other) const

< - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator<() [5/5]

bool SoftwareAndServices::Library::Common::String::operator< ( const char *  Other) const

< - Compare strings

Parameters
OtherThe existing (char*) to compare to.
Returns
The state of the compare.

◆ operator<=() [1/5]

bool SoftwareAndServices::Library::Common::String::operator<= ( String Other) const

<= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator<=() [2/5]

bool SoftwareAndServices::Library::Common::String::operator<= ( const String Other) const

<= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator<=() [3/5]

bool SoftwareAndServices::Library::Common::String::operator<= ( String Other) const

<= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator<=() [4/5]

bool SoftwareAndServices::Library::Common::String::operator<= ( const String Other) const

<= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator<=() [5/5]

bool SoftwareAndServices::Library::Common::String::operator<= ( const char *  Other) const

<= - Compare strings

Parameters
OtherThe existing (char*) to compare to.
Returns
The state of the compare.

◆ operator=() [1/5]

String& SoftwareAndServices::Library::Common::String::operator= ( const String CopyFrom)

= - Copy operator.

This does not copy the object, it copies the string. If the CopyFrom object is a different character set, then it converts it to this objects input character set.

Parameters
CopyFromThe existing String to copy from.
Returns
This updated.
Exceptions
(Error*)when CopyFrom charset can not be converted to this objects charset. The error number will be EILSEQ when invalid multibyte sequence has been encountered in the input. The error number will be EINVAL when an incomplete multibyte sequence has been encountered in the input.

◆ operator=() [2/5]

String& SoftwareAndServices::Library::Common::String::operator= ( const char *  CopyFrom)

= - Copy operator.

Parameters
CopyFromThe existing string to copy from. This does not copy the object, it copies the string. If the CopyFrom string is a different character set, then it converts it to this objects input character set.
Exceptions
(Error*)when CopyFrom charset can not be converted to this objects charset. The error number will be EILSEQ when invalid multibyte sequence has been encountered in the input. The error number will be EINVAL when an incomplete multibyte sequence has been encountered in the input.
Returns
This updated.

◆ operator=() [3/5]

String& SoftwareAndServices::Library::Common::String::operator= ( const wchar_t *  CopyFrom)

= - Copy operator.

Parameters
CopyFromThe existing string to copy from. This does not copy the object, it copies the string. If the CopyFrom string is a different character set, then it converts it to this objects input character set.
Exceptions
(Error*)when CopyFrom charset can not be converted to this objects charset. The error number will be EILSEQ when invalid multibyte sequence has been encountered in the input. The error number will be EINVAL when an incomplete multibyte sequence has been encountered in the input.
Returns
This updated.

◆ operator=() [4/5]

String& SoftwareAndServices::Library::Common::String::operator= ( const char16_t *  CopyFrom)

= - Copy operator.

Parameters
CopyFromThe existing string to copy from. This does not copy the object, it copies the string. If the CopyFrom string is a different character set, then it converts it to this objects input character set.
Exceptions
(Error*)when CopyFrom charset can not be converted to this objects charset. The error number will be EILSEQ when invalid multibyte sequence has been encountered in the input. The error number will be EINVAL when an incomplete multibyte sequence has been encountered in the input.
Returns
This updated.

◆ operator=() [5/5]

String& SoftwareAndServices::Library::Common::String::operator= ( const char32_t *  CopyFrom)

= - Copy operator.

Parameters
CopyFromThe existing string to copy from. This does not copy the object, it copies the string. If the CopyFrom string is a different character set, then it converts it to this objects input character set.
Exceptions
(Error*)when CopyFrom charset can not be converted to this objects charset. The error number will be EILSEQ when invalid multibyte sequence has been encountered in the input. The error number will be EINVAL when an incomplete multibyte sequence has been encountered in the input.
Returns
This updated.

◆ operator==() [1/5]

bool SoftwareAndServices::Library::Common::String::operator== ( String Other) const

== - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator==() [2/5]

bool SoftwareAndServices::Library::Common::String::operator== ( const String other) const

== - Compare strings

Returns
The state of the compare.

◆ operator==() [3/5]

bool SoftwareAndServices::Library::Common::String::operator== ( String Other) const

== - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator==() [4/5]

bool SoftwareAndServices::Library::Common::String::operator== ( const String Other) const

== - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator==() [5/5]

bool SoftwareAndServices::Library::Common::String::operator== ( const char *  Other) const

== - Compare strings

Parameters
OtherThe existing (char*) to compare to.
Returns
The state of the compare.

◆ operator>() [1/5]

bool SoftwareAndServices::Library::Common::String::operator> ( String Other) const

  • Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator>() [2/5]

bool SoftwareAndServices::Library::Common::String::operator> ( const String Other) const

  • Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator>() [3/5]

bool SoftwareAndServices::Library::Common::String::operator> ( String Other) const

  • Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator>() [4/5]

bool SoftwareAndServices::Library::Common::String::operator> ( const String Other) const

  • Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator>() [5/5]

bool SoftwareAndServices::Library::Common::String::operator> ( const char *  Other) const

  • Compare strings

Parameters
OtherThe existing (char*) to compare to.
Returns
The state of the compare.

◆ operator>=() [1/5]

bool SoftwareAndServices::Library::Common::String::operator>= ( String Other) const

>= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator>=() [2/5]

bool SoftwareAndServices::Library::Common::String::operator>= ( const String Other) const

>= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator>=() [3/5]

bool SoftwareAndServices::Library::Common::String::operator>= ( String Other) const

>= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator>=() [4/5]

bool SoftwareAndServices::Library::Common::String::operator>= ( const String Other) const

>= - Compare strings

Parameters
OtherThe existing String to compare to.
Returns
The state of the compare.

◆ operator>=() [5/5]

bool SoftwareAndServices::Library::Common::String::operator>= ( const char *  Other) const

>= - Compare strings

Parameters
OtherThe existing (char*) to compare to.
Returns
The state of the compare.

◆ Read()

uint32_t SoftwareAndServices::Library::Common::String::Read ( File Fp)

Read this object from File.

Read the number of octets in network byte order (uint32_t) then the octets.

Returns
the number of octets read.
Exceptions
Errorfrom File on error.

◆ SetLocale()

bool SoftwareAndServices::Library::Common::String::SetLocale ( int  category,
const char *  locale 
)

SetLocale()

MUST BE set PRIOR to adding/appending data or the results are unpredictable.

NOTE: THIS IS GLOBAL TO THE APPLICATION AND WILL EFFECT ALL STRINGS AND ALL CODE THAT IS AND RELATED TO THIS LIBRARY SET. THIS IS AN OS LEVEL CALL!

As no OS allows one program to run in multiple locales at the same time, the default is the 'C' LOCALE or the currently used locale.

Parameters
categoryThe location category (LC_ALL for example).
localeThe local to use.
Returns
TRUE if locale is known and set.

◆ sprintf() [1/5]

size_t SoftwareAndServices::Library::Common::String::sprintf ( const char *  format,
  ... 
)

Like POSIX C sprintf, append the formatted string to this object.

Parameters
formatThe initial part of the formatted string and includes the format of the results appended.
Returns
The number of characters in the string (strlen()).

◆ sprintf() [2/5]

size_t SoftwareAndServices::Library::Common::String::sprintf ( const wchar_t *  format,
  ... 
)

Like POSIX C sprintf, append the formatted string to this object.

Parameters
formatThe initial part of the formatted string and includes the format of the results appended.
Returns
The number of characters in the string (strlen()).

◆ sprintf() [3/5]

size_t SoftwareAndServices::Library::Common::String::sprintf ( const char16_t *  format,
  ... 
)

Like POSIX C sprintf, append the formatted string to this object.

Parameters
formatThe initial part of the formatted string and includes the format of the results appended.
Returns
The number of characters in the string (strlen()).

◆ sprintf() [4/5]

size_t SoftwareAndServices::Library::Common::String::sprintf ( const char32_t *  format,
  ... 
)

Like POSIX C sprintf, append the formatted string to this object.

Parameters
formatThe initial part of the formatted string and includes the format of the results appended.
Returns
The number of characters in the string (strlen()).

◆ sprintf() [5/5]

size_t SoftwareAndServices::Library::Common::String::sprintf ( const String format,
  ... 
)

Like POSIX C sprintf, append the formatted string to this object.

Parameters
formatThe initial part of the formatted string and includes the format of the results appended.
Returns
The number of characters in the string (strlen()).

◆ ToLower() [1/6]

void SoftwareAndServices::Library::Common::String::ToLower ( )

Convert the string to lower case in place.

◆ ToLower() [2/6]

static String* SoftwareAndServices::Library::Common::String::ToLower ( const char *  SomeString)
static

Create a new String from the (char*) converted to lower case.

Parameters
SomeStringA string to covert to lower case.
Returns
A new (String*) with SomeString converted to lower case.

◆ ToLower() [3/6]

static String* SoftwareAndServices::Library::Common::String::ToLower ( const wchar_t *  SomeString)
static

Create a new String from the (wchar_t*) converted to lower case.

Parameters
SomeStringA string to covert to lower case.
Returns
A new (String*) with SomeString converted to lower case.

◆ ToLower() [4/6]

static String* SoftwareAndServices::Library::Common::String::ToLower ( const char16_t *  SomeString)
static

Create a new String from the (char16_t*) converted to lower case.

Parameters
SomeStringA string to covert to lower case.
Returns
A new (String*) with SomeString converted to lower case.

◆ ToLower() [5/6]

static String* SoftwareAndServices::Library::Common::String::ToLower ( const char32_t *  SomeString)
static

Create a new String from the (char32_t*) converted to lower case.

Parameters
SomeStringA string to covert to lower case.
Returns
A new (String*) with SomeString converted to lower case.

◆ ToLower() [6/6]

static String* SoftwareAndServices::Library::Common::String::ToLower ( const String SomeString)
static

Create a new String from the (String*) converted to lower case.

Parameters
SomeStringA string to covert to lower case.
Returns
A new (String*) with SomeString converted to lower case.

◆ ToUpper() [1/6]

void SoftwareAndServices::Library::Common::String::ToUpper ( )

Convert the string to UPPER case in place.

◆ ToUpper() [2/6]

static String* SoftwareAndServices::Library::Common::String::ToUpper ( const char *  SomeString)
static

Create a new String from the (char*) converted to UPPER case.

Parameters
SomeStringA string to covert to UPPER case.
Returns
A new (String*) with SomeString converted to UPPER case.

◆ ToUpper() [3/6]

static String* SoftwareAndServices::Library::Common::String::ToUpper ( const wchar_t *  SomeString)
static

Create a new String from the (wchar_t*) converted to UPPER case.

Parameters
SomeStringA string to covert to UPPER case.
Returns
A new (String*) with SomeString converted to UPPER case.

◆ ToUpper() [4/6]

static String* SoftwareAndServices::Library::Common::String::ToUpper ( const char16_t *  SomeString)
static

Create a new String from the (char16_t*) converted to UPPER case.

Parameters
SomeStringA string to covert to UPPER case.
Returns
A new (String*) with SomeString converted to UPPER case.

◆ ToUpper() [5/6]

static String* SoftwareAndServices::Library::Common::String::ToUpper ( const char32_t *  SomeString)
static

Create a new String from the (char32_t*) converted to UPPER case.

Parameters
SomeStringA string to covert to UPPER case.
Returns
A new (String*) with SomeString converted to UPPER case.

◆ ToUpper() [6/6]

static String* SoftwareAndServices::Library::Common::String::ToUpper ( const String SomeString)
static

Create a new String from the (String*) converted to UPPER case.

Parameters
SomeStringA string to covert to UPPER case.
Returns
A new (String*) with SomeString converted to UPPER case.

◆ TryLock()

bool SoftwareAndServices::Library::Common::String::TryLock ( ) const

lock() - Lock the string from usage - rarely needed in MT work.

Hangs until acquired.

Returns
TRUE if you get the lock.

◆ Unlock()

bool SoftwareAndServices::Library::Common::String::Unlock ( ) const

lock() - Lock the string from usage - rarely needed in MT work.

Returns with OUT hanging if already locked.

Returns
TRUE if you unlock the lock.

◆ WGet()

const wchar_t* SoftwareAndServices::Library::Common::String::WGet ( ) const

wget() - Get the value in (whcar_t) format.

Returns
The value in wchar_t format, converts if needed form input charset.
Exceptions
(Error*)when the input charset can not be converted to this objects output charset. The error number will be EILSEQ when invalid multibyte sequence has been encountered in the input. The error number will be EINVAL when an incomplete multibyte sequence has been encountered in the input.

◆ WOctets()

size_t SoftwareAndServices::Library::Common::String::WOctets ( ) const

woctets() - Get the octet count of (wchar_t*) characters.

Returns
The octet count.

◆ Write()

uint32_t SoftwareAndServices::Library::Common::String::Write ( File Fp)

Write this object to File.

Write the number of octets in network byte order (uint32_t) then the octets.

Returns
the number of octets written.
Exceptions
Errorfrom File on error.

◆ xdr()

virtual bool_t SoftwareAndServices::Library::Common::String::xdr ( XDR xdrs)
virtual

Read/Write the string in XDR format.

Parameters
xdrsAn initialized XDR object.

Implements SoftwareAndServices::Library::Common::XdrSerialize< String >.

◆ xdr_String() [1/2]

static bool_t SoftwareAndServices::Library::Common::String::xdr_String ( XDR xdrs,
String Pointer 
)
static

Read/Write the String in XDR format.

Parameters
xdrsAn initialized XDR object.
Pointerto the String object to be written.

◆ xdr_String() [2/2]

static int SoftwareAndServices::Library::Common::String::xdr_String ( XDR xdrs,
void *  Pointer 
)
static

Read/Write the String in XDR format.

Parameters
xdrsAn initialized XDR object.
Pointerto the String object to be written.

◆ xdr_T() [1/2]

static bool_t SoftwareAndServices::Library::Common::XdrSerialize< String >::xdr_T ( XDR xdrs,
String Pointer 
)
staticinherited

Read/Write the XDR object.

Parameters
xdrsAn initialized XDR object.
PointerA Pointer to the object.
Returns
true if seralized. Returs false if xdrs is nullptr, or there is a serialization problem.

◆ xdr_T() [2/2]

static bool_t SoftwareAndServices::Library::Common::XdrSerialize< String >::xdr_T ( XDR xdrs,
void *  Pointer 
)
staticinherited

Read/Write the XDR object.

Parameters
xdrsAn initialized XDR object.
PointerA Pointer to the object.
Returns
true if seralized. Returs false if xdrs is nullptr, or there is a serialization problem.

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