OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TString Class Reference

Reference to reference counted string object TUString Lightweight reference object consisting of a pointer to actual object Facilitates copying and assignment with minimal string reallocations. More...

#include <owl/string.h>

Inheritance diagram for owl::TString:
ocf::TAutoString

Public Member Functions

 TString (const char *s=0)
 Construct a TString from any type of string.
 
 TString (const wchar_t *s)
 Construct a TString from a wide character array.
 
 TString (BSTR s, bool loan)
 Construct a TString from a BSTR (OLE String)
 
 TString (TSysStr &s, bool loan)
 Construct a TString from a System string (BSTR)
 
 TString (const tstring &s)
 Construct a TString from a string.
 
 TString (TUString *s)
 Construct a TString from a TUString.
 
 TString (const TString &src)
 Construct a TString from a TString (Copy Constructor)
 
 ~TString ()
 
int Length () const
 The length in characters of this string.
 
bool IsNull () const
 Is the string NULL?
 
bool IsWide () const
 Are the string contents any kind of wide?
 
TStringoperator= (const TString &s)
 Copy contents of TString s into this string.
 
TStringoperator= (const tstring &s)
 Copy contents of string s into this string.
 
TStringoperator= (const char *s)
 Copy contents of const char* s into this string.
 
TStringoperator= (char *s)
 Copy contents of char* s into this string.
 
TStringoperator= (const wchar_t *s)
 Copy contents of const wchar_t* s into this string.
 
TStringoperator= (wchar_t *s)
 Copy contents of wchar_t* s into this string.
 
 operator const char * () const
 Return string as a const char *.
 
 operator char * ()
 Return string as a char*.
 
 operator const wchar_t * () const
 Return string as a const wchar_t*.
 
 operator wchar_t * ()
 Return string as a wchar_t*.
 
BSTR AsBSTR () const
 Return a BSTR object owned by 'this' (not by the caller)
 
BSTR RelinquishSysStr () const
 Return a pointer (BSTR) to a copy of the string.
 
wchar_tRelinquishWide () const
 Return a pointer (wchar_t*) to a copy of the string.
 
charRelinquishNarrow () const
 Return a pointer (char*) to a copy of the string.
 
tcharRelinquish () const
 Return a pointer (tchar*) to a copy of the string.
 
TLangId GetLangId ()
 Get Language Id of this string.
 
void SetLangId (TLangId id)
 Set Language Id of this string.
 

Protected Attributes

TUStringS
 

Detailed Description

Reference to reference counted string object TUString Lightweight reference object consisting of a pointer to actual object Facilitates copying and assignment with minimal string reallocations.

Definition at line 67 of file string.h.

Constructor & Destructor Documentation

◆ TString() [1/7]

owl::TString::TString ( const char * s = 0)
inline

Construct a TString from any type of string.

Construct a TString from a character array.

Definition at line 245 of file string.h.

◆ TString() [2/7]

owl::TString::TString ( const wchar_t * s)
inline

Construct a TString from a wide character array.

Definition at line 254 of file string.h.

◆ TString() [3/7]

owl::TString::TString ( BSTR s,
bool loan )
inline

Construct a TString from a BSTR (OLE String)

Definition at line 263 of file string.h.

◆ TString() [4/7]

owl::TString::TString ( TSysStr & s,
bool loan )
inline

Construct a TString from a System string (BSTR)

Definition at line 272 of file string.h.

◆ TString() [5/7]

owl::TString::TString ( const tstring & s)
inline

Construct a TString from a string.

Definition at line 281 of file string.h.

◆ TString() [6/7]

owl::TString::TString ( TUString * s)
inline

Construct a TString from a TUString.

Definition at line 290 of file string.h.

◆ TString() [7/7]

owl::TString::TString ( const TString & src)
inline

Construct a TString from a TString (Copy Constructor)

Definition at line 299 of file string.h.

References S.

◆ ~TString()

owl::TString::~TString ( )
inline

Definition at line 309 of file string.h.

References S.

Member Function Documentation

◆ AsBSTR()

BSTR owl::TString::AsBSTR ( ) const
inline

Return a BSTR object owned by 'this' (not by the caller)

Definition at line 421 of file string.h.

References owl::TUString::ConvertToBSTR(), and S.

◆ GetLangId()

TLangId owl::TString::GetLangId ( )
inline

Get Language Id of this string.

Definition at line 465 of file string.h.

References owl::TUString::Lang, and S.

◆ IsNull()

bool owl::TString::IsNull ( ) const
inline

Is the string NULL?

Return true if string is empty.

Definition at line 325 of file string.h.

References owl::TUString::IsNull(), and S.

◆ IsWide()

bool owl::TString::IsWide ( ) const
inline

Are the string contents any kind of wide?

Return true if string uses wide character set.

Definition at line 333 of file string.h.

References owl::TUString::IsWide(), and S.

◆ Length()

int owl::TString::Length ( ) const
inline

The length in characters of this string.

Definition at line 317 of file string.h.

References owl::TUString::Length(), and S.

◆ operator char *()

owl::TString::operator char * ( )
inline

Return string as a char*.

Definition at line 397 of file string.h.

◆ operator const char *()

owl::TString::operator const char * ( ) const
inline

Return string as a const char *.

Definition at line 389 of file string.h.

◆ operator const wchar_t *()

owl::TString::operator const wchar_t * ( ) const
inline

Return string as a const wchar_t*.

Definition at line 405 of file string.h.

◆ operator wchar_t *()

owl::TString::operator wchar_t * ( )
inline

Return string as a wchar_t*.

Definition at line 413 of file string.h.

◆ operator=() [1/6]

TString & owl::TString::operator= ( char * s)
inline

Copy contents of char* s into this string.

Definition at line 365 of file string.h.

References owl::TUString::Assign(), and S.

◆ operator=() [2/6]

TString & owl::TString::operator= ( const char * s)
inline

Copy contents of const char* s into this string.

Definition at line 357 of file string.h.

References owl::TUString::Assign(), and S.

◆ operator=() [3/6]

TString & owl::TString::operator= ( const TString & s)
inline

Copy contents of TString s into this string.

Definition at line 341 of file string.h.

References owl::TUString::Assign(), and S.

◆ operator=() [4/6]

TString & owl::TString::operator= ( const tstring & s)
inline

Copy contents of string s into this string.

Definition at line 349 of file string.h.

References owl::TUString::Assign(), and S.

◆ operator=() [5/6]

TString & owl::TString::operator= ( const wchar_t * s)
inline

Copy contents of const wchar_t* s into this string.

Definition at line 373 of file string.h.

References owl::TUString::Assign(), and S.

◆ operator=() [6/6]

TString & owl::TString::operator= ( wchar_t * s)
inline

Copy contents of wchar_t* s into this string.

Definition at line 381 of file string.h.

References owl::TUString::Assign(), and S.

◆ Relinquish()

tchar * owl::TString::Relinquish ( ) const
inline

Return a pointer (tchar*) to a copy of the string.

Definition at line 453 of file string.h.

References RelinquishNarrow(), and RelinquishWide().

◆ RelinquishNarrow()

char * owl::TString::RelinquishNarrow ( ) const
inline

Return a pointer (char*) to a copy of the string.

Definition at line 445 of file string.h.

References S, and strnewdup().

◆ RelinquishSysStr()

BSTR owl::TString::RelinquishSysStr ( ) const
inline

Return a pointer (BSTR) to a copy of the string.

Definition at line 429 of file string.h.

References S, and owl::TOleAuto::SysAllocString().

◆ RelinquishWide()

wchar_t * owl::TString::RelinquishWide ( ) const
inline

Return a pointer (wchar_t*) to a copy of the string.

Definition at line 437 of file string.h.

References S, and strnewdup().

◆ SetLangId()

void owl::TString::SetLangId ( TLangId id)
inline

Set Language Id of this string.

Definition at line 474 of file string.h.

References owl::TUString::Lang, and S.

Member Data Documentation

◆ S

TUString* owl::TString::S
protected

Definition at line 121 of file string.h.


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