Hide menu
Loading...
Searching...
No Matches
cadex::Base_String Class Reference

Wraps standard string. More...

#include <Base_String.hxx>

Public Types

typedef std::basic_string< char, std::char_traits< char >, Base_Allocator< char > > value_type
 Defines a type of a standard string with CAD Exchanger allocator.
 

Public Member Functions

 Base_String ()
 Constructor.
 
 Base_String (const Base_String &theOther)
 Constructor.
 
 Base_String (const char *theOther)
 Constructor.
 
 Base_String (const Base_UTF16String &theOther)
 Constructor.
 
 Base_String (const UTF16 *theOther)
 Constructor.
 
 Base_String (const value_type &theOther)
 Constructor.
 
 Base_String (const std::string &theOther)
 Constructor.
 
 Base_String (const TCollection_AsciiString &theOther)
 Constructor.
 
 Base_String (const TCollection_ExtendedString &theOther)
 Constructor.
 
 ~Base_String ()
 Destructor.
 
const value_typeString () const
 Returns an internal string representation.
 
value_typeString ()
 Returns an internal string representation.
 
void Clear ()
 Clears the contents.
 
const char * Data () const
 Returns an internal string buffer.
 
bool operator== (const Base_String &theOther) const
 Returns true if this equals theOther.
 
bool operator== (const char *theOther) const
 Returns true if this equals theOther.
 
bool operator!= (const Base_String &theOther) const
 Returns true if this does equal theOther.
 
bool operator!= (const char *theOther) const
 Returns true if this does equal theOther.
 
size_t Length () const
 Returns a string length in bytes.
 
bool IsEmpty () const
 Returns true if the string is empty.
 
Base_Stringoperator= (const Base_String &theOther)
 Assignment operator.
 
Base_Stringoperator= (const char *theOther)
 Assignment operator.
 
Base_Stringoperator= (const Base_UTF16String &theOther)
 Assignment operator.
 
Base_Stringoperator= (const UTF16 *theOther)
 Assignment operator.
 
Base_Stringoperator= (const std::string &theOther)
 Assignment operator.
 
Base_Stringoperator= (const value_type &theOther)
 Assignment operator.
 
Base_Stringoperator= (const TCollection_AsciiString &theOther)
 Assignment operator.
 
Base_Stringoperator= (const TCollection_ExtendedString &theOther)
 Assignment operator.
 

Detailed Description

Wraps standard string.

Constructor & Destructor Documentation

◆ Base_String() [1/9]

cadex::Base_String::Base_String ( )

Constructor.

Creates an empty string.

◆ Base_String() [2/9]

cadex::Base_String::Base_String ( const Base_String theOther)

Constructor.

Copies contents from another string.

◆ Base_String() [3/9]

cadex::Base_String::Base_String ( const char *  theOther)
explicit

Constructor.

Copies contents from another string.

◆ Base_String() [4/9]

cadex::Base_String::Base_String ( const Base_UTF16String theOther)

Constructor.

Converts the UTF16 string theOther to UTF8.

◆ Base_String() [5/9]

cadex::Base_String::Base_String ( const UTF16 theOther)
explicit

Constructor.

Copies contents from another string.

◆ Base_String() [6/9]

cadex::Base_String::Base_String ( const value_type theOther)
explicit

Constructor.

Copies contents from another string. This syntax may only be used if the build environment (i.e. compiler versions and flags) of the customer fully matches one of CAD Exchanger. Otherwise syntax with plain pointers should be used.

◆ Base_String() [7/9]

cadex::Base_String::Base_String ( const std::string &  theOther)
explicit

Constructor.

Copies contents from another string. This syntax may only be used if the build environment (i.e. compiler versions and flags) of the customer fully matches one of CAD Exchanger. Otherwise syntax with plain pointers should be used.

◆ Base_String() [8/9]

cadex::Base_String::Base_String ( const TCollection_AsciiString &  theOther)
explicit

Constructor.

Copies contents from another string.

◆ Base_String() [9/9]

cadex::Base_String::Base_String ( const TCollection_ExtendedString &  theOther)
explicit

Constructor.

Copies contents from another string.

◆ ~Base_String()

cadex::Base_String::~Base_String ( )

Destructor.

Destroys the object and frees all allocated resources.

Member Function Documentation

◆ Clear()

void cadex::Base_String::Clear ( )

Clears the contents.

IsEmpty() will return true after calling this method.

◆ IsEmpty()

bool cadex::Base_String::IsEmpty ( ) const

Returns true if the string is empty.

Returns true if the string length equals 0.

◆ Length()

size_t cadex::Base_String::Length ( ) const

Returns a string length in bytes.

As the string is in UTF-8 encoding the number of valuable characters can be smaller.

◆ operator=() [1/8]

Base_String & cadex::Base_String::operator= ( const Base_String theOther)

Assignment operator.

Copies contents from another string.

◆ operator=() [2/8]

Base_String & cadex::Base_String::operator= ( const Base_UTF16String theOther)

Assignment operator.

Copies contents from another string. Converts the UTF16 string theOther to UTF8.

◆ operator=() [3/8]

Base_String & cadex::Base_String::operator= ( const char *  theOther)

Assignment operator.

Copies contents from another string.

◆ operator=() [4/8]

Base_String & cadex::Base_String::operator= ( const std::string &  theOther)

Assignment operator.

Copies contents from another string. This syntax may only be used if the build environment (i.e. compiler versions and flags) of the customer fully matches one of CAD Exchanger. Otherwise syntax with plain pointers should be used.

◆ operator=() [5/8]

Base_String & cadex::Base_String::operator= ( const TCollection_AsciiString &  theOther)

Assignment operator.

Copies contents from another string.

◆ operator=() [6/8]

Base_String & cadex::Base_String::operator= ( const TCollection_ExtendedString &  theOther)

Assignment operator.

Copies contents from another string.

◆ operator=() [7/8]

Base_String & cadex::Base_String::operator= ( const UTF16 theOther)

Assignment operator.

Copies contents from another string.

◆ operator=() [8/8]

Base_String & cadex::Base_String::operator= ( const value_type theOther)

Assignment operator.

Copies contents from another string. This syntax may only be used if the build environment (i.e. compiler versions and flags) of the customer fully matches one of CAD Exchanger. Otherwise syntax with plain pointers should be used.