Open CASCADE Technology 6.6.0
Public Member Functions
NCollection_UtfString< Type > Class Template Reference

This template class represent constant UTF-* string. String stored in memory continuously, always NULL-terminated and can be used as standard C-string using ToCString() method. More...

#include <NCollection_UtfString.hxx>

Public Member Functions

NCollection_UtfIterator< Type > Iterator () const
Standard_Integer Size () const
Standard_Integer Length () const
Standard_Utf32Char GetChar (const Standard_Integer theCharIndex) const
 Retrieve Unicode symbol at specified position. Warning! This is a slow access. Iterator should be used for consecutive parsing.
const Type * GetCharBuffer (const Standard_Integer theCharIndex) const
 Retrieve string buffer at specified position. Warning! This is a slow access. Iterator should be used for consecutive parsing.
Standard_Utf32Char operator[] (const Standard_Integer theCharIndex) const
 Retrieve Unicode symbol at specified position. Warning! This is a slow access. Iterator should be used for consecutive parsing.
 NCollection_UtfString ()
 Initialize empty string.
 NCollection_UtfString (const NCollection_UtfString &theCopy)
 Copy constructor.
 NCollection_UtfString (const char *theCopyUtf8, const Standard_Integer theLength=-1)
 Copy constructor from NULL-terminated UTF-8 string.
 NCollection_UtfString (const Standard_Utf16Char *theCopyUtf16, const Standard_Integer theLength=-1)
 Copy constructor from NULL-terminated UTF-16 string.
 NCollection_UtfString (const Standard_Utf32Char *theCopyUtf32, const Standard_Integer theLength=-1)
 Copy constructor from NULL-terminated UTF-32 string.
 NCollection_UtfString (const Standard_WideChar *theCopyUtfWide, const Standard_Integer theLength=-1)
 Copy constructor from NULL-terminated wide UTF string.
template<typename TypeFrom >
void FromUnicode (const TypeFrom *theStringUtf, const Standard_Integer theLength=-1)
 Copy from NULL-terminated Unicode string.
void FromLocale (const char *theString, const Standard_Integer theLength=-1)
 Copy from NULL-terminated multibyte string in system locale. You should avoid this function unless extreme necessity.
 ~NCollection_UtfString ()
 Destructor.
bool IsEqual (const NCollection_UtfString &theCompare) const
 Compares this string with another one.
NCollection_UtfString SubString (const Standard_Integer theStart, const Standard_Integer theEnd) const
 Returns the substring.
const Type * ToCString () const
 Returns NULL-terminated Unicode string. Should not be modifed or deleted!
const NCollection_UtfString
< Standard_Utf8Char
ToUtf8 () const
const NCollection_UtfString
< Standard_Utf16Char
ToUtf16 () const
const NCollection_UtfString
< Standard_Utf32Char
ToUtf32 () const
const NCollection_UtfString
< Standard_WideChar
ToUtfWide () const
bool ToLocale (char *theBuffer, const Standard_Integer theSizeBytes) const
 Converts the string into multibyte string. You should avoid this function unless extreme necessity.
bool IsEmpty () const
void Clear ()
 Zero string.
compare operators
bool operator== (const NCollection_UtfString &theCompare) const
bool operator!= (const NCollection_UtfString &theCompare) const

assign operators

const NCollection_UtfStringoperator= (const NCollection_UtfString &theOther)
 Copy from another string.
const NCollection_UtfStringoperator= (const char *theStringUtf8)
 Copy from UTF-8 NULL-terminated string.
const NCollection_UtfStringoperator= (const Standard_WideChar *theStringUtfWide)
 Copy from wchar_t UTF NULL-terminated string.
NCollection_UtfStringoperator+= (const NCollection_UtfString &theAppend)
 Join strings.
NCollection_UtfString operator+ (const NCollection_UtfString &theLeft, const NCollection_UtfString &theRight)
 Join two strings.

Detailed Description

template<typename Type>
class NCollection_UtfString< Type >

Notice that changing the string is not allowed and any modifications should produce new string.


Constructor & Destructor Documentation

template<typename Type >
NCollection_UtfString< Type >::NCollection_UtfString ( )
template<typename Type >
NCollection_UtfString< Type >::NCollection_UtfString ( const NCollection_UtfString< Type > &  theCopy)
Parameters:
theCopystring to copy.
template<typename Type >
NCollection_UtfString< Type >::NCollection_UtfString ( const char *  theCopyUtf8,
const Standard_Integer  theLength = -1 
)
Parameters:
theCopyUtf8NULL-terminated UTF-8 string to copy
theLengththe length limit in Unicode symbols (NOT bytes!)
template<typename Type >
NCollection_UtfString< Type >::NCollection_UtfString ( const Standard_Utf16Char theCopyUtf16,
const Standard_Integer  theLength = -1 
)
Parameters:
theCopyUtf16NULL-terminated UTF-16 string to copy
theLengththe length limit in Unicode symbols (NOT bytes!)
template<typename Type >
NCollection_UtfString< Type >::NCollection_UtfString ( const Standard_Utf32Char theCopyUtf32,
const Standard_Integer  theLength = -1 
)
Parameters:
theCopyUtf32NULL-terminated UTF-32 string to copy
theLengththe length limit in Unicode symbols (NOT bytes!)
template<typename Type >
NCollection_UtfString< Type >::NCollection_UtfString ( const Standard_WideChar theCopyUtfWide,
const Standard_Integer  theLength = -1 
)
Parameters:
theCopyUtfWideNULL-terminated wide UTF string to copy
theLengththe length limit in Unicode symbols (NOT bytes!)
template<typename Type >
NCollection_UtfString< Type >::~NCollection_UtfString ( )

Member Function Documentation

template<typename Type >
void NCollection_UtfString< Type >::Clear ( )
template<typename Type >
void NCollection_UtfString< Type >::FromLocale ( const char *  theString,
const Standard_Integer  theLength = -1 
)
Parameters:
theStringNULL-terminated multibyte string
theLengththe length limit in Unicode symbols
template<typename Type >
template<typename TypeFrom >
void NCollection_UtfString< Type >::FromUnicode ( const TypeFrom *  theStringUtf,
const Standard_Integer  theLength = -1 
)
Parameters:
theStringUtfNULL-terminated Unicode string
theLengththe length limit in Unicode symbols
template<typename Type >
Standard_Utf32Char NCollection_UtfString< Type >::GetChar ( const Standard_Integer  theCharIndex) const
Parameters:
theCharIndexthe index of the symbol, should be lesser than Length()
Returns:
the Unicode symbol value
template<typename Type >
const Type* NCollection_UtfString< Type >::GetCharBuffer ( const Standard_Integer  theCharIndex) const
Parameters:
theCharIndexthe index of the symbol, should be lesser than Length()
Returns:
the pointer to the symbol
template<typename Type >
bool NCollection_UtfString< Type >::IsEmpty ( ) const [inline]
Returns:
true if string is empty
template<typename Type >
bool NCollection_UtfString< Type >::IsEqual ( const NCollection_UtfString< Type > &  theCompare) const
template<typename Type >
NCollection_UtfIterator<Type> NCollection_UtfString< Type >::Iterator ( ) const [inline]
template<typename Type >
Standard_Integer NCollection_UtfString< Type >::Length ( void  ) const [inline]
Returns:
the length of the string in Unicode symbols
template<typename Type >
bool NCollection_UtfString< Type >::operator!= ( const NCollection_UtfString< Type > &  theCompare) const
template<typename Type >
NCollection_UtfString& NCollection_UtfString< Type >::operator+= ( const NCollection_UtfString< Type > &  theAppend)
template<typename Type >
const NCollection_UtfString& NCollection_UtfString< Type >::operator= ( const Standard_WideChar theStringUtfWide)
template<typename Type >
const NCollection_UtfString& NCollection_UtfString< Type >::operator= ( const NCollection_UtfString< Type > &  theOther)
template<typename Type >
const NCollection_UtfString& NCollection_UtfString< Type >::operator= ( const char *  theStringUtf8)
template<typename Type >
bool NCollection_UtfString< Type >::operator== ( const NCollection_UtfString< Type > &  theCompare) const [inline]
template<typename Type >
Standard_Utf32Char NCollection_UtfString< Type >::operator[] ( const Standard_Integer  theCharIndex) const [inline]
template<typename Type >
Standard_Integer NCollection_UtfString< Type >::Size ( ) const [inline]
Returns:
the size of the buffer, excluding NULL-termination symbol
template<typename Type >
NCollection_UtfString NCollection_UtfString< Type >::SubString ( const Standard_Integer  theStart,
const Standard_Integer  theEnd 
) const
Parameters:
theStartstart index (inclusive) of subString
theEndend index (exclusive) of subString
Returns:
the substring
template<typename Type >
const Type* NCollection_UtfString< Type >::ToCString ( ) const [inline]
Returns:
(const Type* ) pointer to string
template<typename Type >
bool NCollection_UtfString< Type >::ToLocale ( char *  theBuffer,
const Standard_Integer  theSizeBytes 
) const
Parameters:
theBufferoutput buffer
theSizeBytesbuffer size in bytes
Returns:
true on success
template<typename Type >
const NCollection_UtfString<Standard_Utf16Char> NCollection_UtfString< Type >::ToUtf16 ( ) const
Returns:
copy in UTF-16 format
template<typename Type >
const NCollection_UtfString<Standard_Utf32Char> NCollection_UtfString< Type >::ToUtf32 ( ) const
Returns:
copy in UTF-32 format
template<typename Type >
const NCollection_UtfString<Standard_Utf8Char> NCollection_UtfString< Type >::ToUtf8 ( ) const
Returns:
copy in UTF-8 format
template<typename Type >
const NCollection_UtfString<Standard_WideChar> NCollection_UtfString< Type >::ToUtfWide ( ) const
Returns:
copy in wide format (UTF-16 on Windows and UTF-32 on Linux)

Friends And Related Function Documentation

template<typename Type >
NCollection_UtfString operator+ ( const NCollection_UtfString< Type > &  theLeft,
const NCollection_UtfString< Type > &  theRight 
) [friend]

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines