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?
TString & operator= (const TString &s)
 Copy contents of TString s into this string.
TString & operator= (const tstring &s)
 Copy contents of string s into this string.
TString & operator= (const char *s)
 Copy contents of const char* s into this string.
TString & operator= (char *s)
 Copy contents of char* s into this string.
TString & operator= (const wchar_t *s)
 Copy contents of const wchar_t* s into this string.
TString & operator= (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_t * RelinquishWide () const
 Return a pointer (wchar_t*) to a copy of the string.
char * RelinquishNarrow () const
 Return a pointer (char*) to a copy of the string.
tchar * Relinquish () 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

TUString * S

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 255 of file string.h.

References TString(), and S.

◆ TString() [2/7]

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

Construct a TString from a wide character array.

Definition at line 264 of file string.h.

References S.

◆ TString() [3/7]

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

Construct a TString from a BSTR (OLE String).

Definition at line 273 of file string.h.

References S.

◆ TString() [4/7]

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

Construct a TString from a System string (BSTR).

Definition at line 282 of file string.h.

References S.

◆ TString() [5/7]

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

Construct a TString from a string.

Definition at line 291 of file string.h.

References S.

◆ TString() [6/7]

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

Construct a TString from a TUString.

Definition at line 300 of file string.h.

References S.

◆ TString() [7/7]

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

Construct a TString from a TString (Copy Constructor).

Definition at line 309 of file string.h.

References TString(), and S.

◆ ~TString()

owl::TString::~TString ( )
inline

Definition at line 319 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 431 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 475 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 335 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 343 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 327 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 407 of file string.h.

References S.

◆ operator const char *()

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

Return string as a const char *.

Definition at line 399 of file string.h.

References S.

◆ operator const wchar_t *()

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

Return string as a const wchar_t*.

Definition at line 415 of file string.h.

References S.

◆ operator wchar_t *()

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

Return string as a wchar_t*.

Definition at line 423 of file string.h.

References S.

◆ operator=() [1/6]

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

Copy contents of char* s into this string.

Definition at line 375 of file string.h.

References TString(), 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 367 of file string.h.

References TString(), 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 351 of file string.h.

References TString(), 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 359 of file string.h.

References TString(), 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 383 of file string.h.

References TString(), 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 391 of file string.h.

References TString(), 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 463 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 455 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 439 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 447 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 484 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: