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

Privately used by TString to manage string pointers This is a reference counted union of various string representatons Constructors/destructors are private to enforce reference count model Create functions are used to facilitate rapid allocation schemes Null pointers are never stored; instead a static null object is ref'd. More...

#include <owl/string.h>

Public Member Functions

TUString * Assign (const TUString &s)
TUString * Assign (const tstring &s)
TUString * Assign (const char *s)
TUString * Assign (char *s)
TUString * Assign (const wchar_t *s)
TUString * Assign (wchar_t *s)
TUString * Assign (BSTR str, TLangId lang)
 operator const char * () const
 operator char * ()
 operator const wchar_t * () const
 operator wchar_t * ()
TUString & operator++ ()
 Preincrement operator only.
TUString & operator-- ()
 Predecrement operator only.
int Length () const
 Return appropriate string length.
bool IsNull () const
 Is the string a null string?
bool IsWide () const
 Are the string contents any kind of wide?
void RevokeBstr (BSTR s)
 Used to restore if Created with loan==true.
void ReleaseBstr (BSTR s)
 Used to unhook if Created with loan==true.
BSTR ConvertToBSTR ()

Static Public Member Functions

static TUString * Create (const char *str)
static TUString * Create (char *str)
static TUString * Create (const wchar_t *str)
static TUString * Create (wchar_t *str)
static TUString * Create (TSysStr &str, bool loan, TLangId lang=0)
static TUString * Create (BSTR str, bool loan, TLangId lang=0)
static TUString * Create (const tstring &str)
static wchar_t * ConvertAtoW (const char *src, size_t len=(size_t) -1)
static char * ConvertWtoA (const wchar_t *src, size_t len=(size_t) -1)
static BSTR ConvertAtoBSTR (const char *src)

Public Attributes

TLangId Lang

Friends

class TString

Detailed Description

Privately used by TString to manage string pointers This is a reference counted union of various string representatons Constructors/destructors are private to enforce reference count model Create functions are used to facilitate rapid allocation schemes Null pointers are never stored; instead a static null object is ref'd.

Definition at line 155 of file string.h.

Member Function Documentation

◆ Assign() [1/7]

TUString * owl::TUString::Assign ( BSTR str,
TLangId lang )

Definition at line 448 of file ustring.cpp.

References Create(), Lang, and owl::TOleAuto::SysStringLen().

◆ Assign() [2/7]

TUString * owl::TUString::Assign ( char * s)

Definition at line 401 of file ustring.cpp.

References Create().

◆ Assign() [3/7]

TUString * owl::TUString::Assign ( const char * s)

Definition at line 386 of file ustring.cpp.

References Create().

◆ Assign() [4/7]

TUString * owl::TUString::Assign ( const tstring & s)

Definition at line 369 of file ustring.cpp.

References Create().

◆ Assign() [5/7]

TUString * owl::TUString::Assign ( const TUString & s)

Definition at line 357 of file ustring.cpp.

References CONST_CAST.

◆ Assign() [6/7]

TUString * owl::TUString::Assign ( const wchar_t * s)

Definition at line 417 of file ustring.cpp.

References Create().

◆ Assign() [7/7]

TUString * owl::TUString::Assign ( wchar_t * s)

Definition at line 432 of file ustring.cpp.

References Create(), wcscpy(), and wcslen().

◆ ConvertAtoBSTR()

BSTR owl::TUString::ConvertAtoBSTR ( const char * src)
static

Definition at line 90 of file ustring.cpp.

References alloca.

◆ ConvertAtoW()

wchar_t * owl::TUString::ConvertAtoW ( const char * src,
size_t len = (size_t)-1 )
static

Definition at line 57 of file ustring.cpp.

◆ ConvertToBSTR()

BSTR owl::TUString::ConvertToBSTR ( )

Definition at line 194 of file ustring.cpp.

References CHECK, ConvertAtoBSTR(), and owl::SysAllocString().

◆ ConvertWtoA()

char * owl::TUString::ConvertWtoA ( const wchar_t * src,
size_t len = (size_t)-1 )
static

Definition at line 21 of file ustring.cpp.

References wcslen().

◆ Create() [1/7]

TUString * owl::TUString::Create ( BSTR str,
bool loan,
TLangId lang = 0 )
static

Definition at line 331 of file ustring.cpp.

References owl::TOleAuto::SysFreeString(), and owl::TOleAuto::SysStringLen().

◆ Create() [2/7]

TUString * owl::TUString::Create ( char * str)
static

Definition at line 313 of file ustring.cpp.

◆ Create() [3/7]

TUString * owl::TUString::Create ( const char * str)
static

Definition at line 307 of file ustring.cpp.

◆ Create() [4/7]

TUString * owl::TUString::Create ( const tstring & str)
static

Definition at line 347 of file ustring.cpp.

◆ Create() [5/7]

TUString * owl::TUString::Create ( const wchar_t * str)
static

Definition at line 319 of file ustring.cpp.

◆ Create() [6/7]

TUString * owl::TUString::Create ( TSysStr & str,
bool loan,
TLangId lang = 0 )
static

Definition at line 341 of file ustring.cpp.

References Create().

◆ Create() [7/7]

TUString * owl::TUString::Create ( wchar_t * str)
static

Definition at line 325 of file ustring.cpp.

◆ IsNull()

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

Is the string a null string?

Return true if string is empty.

Definition at line 514 of file string.h.

◆ IsWide()

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

Are the string contents any kind of wide?

Return true if string uses wide character set.

Definition at line 522 of file string.h.

◆ Length()

int owl::TUString::Length ( ) const

Return appropriate string length.

Definition at line 527 of file ustring.cpp.

References owl::TOleAuto::SysStringLen(), and wcslen().

◆ operator char *()

owl::TUString::operator char * ( )

Definition at line 490 of file ustring.cpp.

◆ operator const char *()

owl::TUString::operator const char * ( ) const

Definition at line 469 of file ustring.cpp.

References CONST_CAST.

◆ operator const wchar_t *()

owl::TUString::operator const wchar_t * ( ) const

Definition at line 496 of file ustring.cpp.

References CONST_CAST.

◆ operator wchar_t *()

owl::TUString::operator wchar_t * ( )

Definition at line 517 of file ustring.cpp.

◆ operator++()

TUString & owl::TUString::operator++ ( )
inline

Preincrement operator only.

Increment reference counter for this string.

Definition at line 494 of file string.h.

◆ operator--()

TUString & owl::TUString::operator-- ( )
inline

Predecrement operator only.

Decrement reference counter for this string.

Definition at line 503 of file string.h.

◆ ReleaseBstr()

void owl::TUString::ReleaseBstr ( BSTR s)

Used to unhook if Created with loan==true.

Definition at line 563 of file ustring.cpp.

References owl::TOleAuto::SysFreeString().

◆ RevokeBstr()

void owl::TUString::RevokeBstr ( BSTR s)

Used to restore if Created with loan==true.

Definition at line 548 of file ustring.cpp.

◆ TString

friend class TString
friend

Definition at line 243 of file string.h.

References TString.

Member Data Documentation

◆ Lang

TLangId owl::TUString::Lang

Definition at line 184 of file string.h.


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