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

TUStringAssign (const TUString &s)
 
TUStringAssign (const tstring &s)
 
TUStringAssign (const char *s)
 
TUStringAssign (char *s)
 
TUStringAssign (const wchar_t *s)
 
TUStringAssign (wchar_t *s)
 
TUStringAssign (BSTR str, TLangId lang)
 
 operator const char * () const
 
 operator char * ()
 
 operator const wchar_t * () const
 
 operator wchar_t * ()
 
TUStringoperator++ ()
 Preincrement operator only.
 
TUStringoperator-- ()
 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 TUStringCreate (const char *str)
 
static TUStringCreate (char *str)
 
static TUStringCreate (const wchar_t *str)
 
static TUStringCreate (wchar_t *str)
 
static TUStringCreate (TSysStr &str, bool loan, TLangId lang=0)
 
static TUStringCreate (BSTR str, bool loan, TLangId lang=0)
 
static TUStringCreate (const tstring &str)
 
static wchar_tConvertAtoW (const char *src, size_t len=(size_t) -1)
 
static charConvertWtoA (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 145 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 Bstr, Create(), Lang, and owl::TOleAuto::SysStringLen().

◆ Assign() [2/7]

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

Definition at line 401 of file ustring.cpp.

References Copy, and Create().

◆ Assign() [3/7]

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

Definition at line 386 of file ustring.cpp.

References Const, and 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(), and WConst.

◆ Assign() [7/7]

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

Definition at line 432 of file ustring.cpp.

References Create(), WCopy, 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 Bstr, CHECK, Const, ConvertAtoBSTR(), Copy, owl::SysAllocString(), and WConst.

◆ 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 504 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 512 of file string.h.

◆ Length()

int owl::TUString::Length ( ) const

Return appropriate string length.

Definition at line 527 of file ustring.cpp.

References Bstr, Const, Copy, owl::TOleAuto::SysStringLen(), WConst, WCopy, 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 484 of file string.h.

◆ operator--()

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

Predecrement operator only.

Decrement reference counter for this string.

Definition at line 493 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 Bstr, and 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.

References Bstr.

Friends And Related Symbol Documentation

◆ TString

Definition at line 233 of file string.h.

Member Data Documentation

◆ Bstr

BSTR owl::TUString::Bstr

Copy of pointer, owned here.

Definition at line 226 of file string.h.

◆ Const

const char* owl::TUString::Const

Passed-in string, NOT owned here, read-only.

Definition at line 222 of file string.h.

◆ Copy

char* owl::TUString::Copy

Local copy, must be deleted, read-write.

Definition at line 223 of file string.h.

◆ Lang

TLangId owl::TUString::Lang

Definition at line 174 of file string.h.

◆ StringMem

char owl::TUString::StringMem[sizeof(tstring)]

Placeholder for string:: object.

Definition at line 227 of file string.h.

◆ WConst

const wchar_t* owl::TUString::WConst

Unicode version of Const (Win32)

Definition at line 224 of file string.h.

◆ WCopy

wchar_t* owl::TUString::WCopy

Unicode version of Copy (Win32)

Definition at line 225 of file string.h.


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