9 #ifndef __platform_dualstring_h__ 10 #define __platform_dualstring_h__ 15 #if defined(FE_OS) && FE_OS==FE_FREEBSD 16 #define FESTRING_WIDE __wchar_t 17 #define FESTR_MB2WC(x,y,z) mbstowcs((FESTRING_WIDE*)x,(const char*)y,z) 18 #define FESTR_WC2MB(x,y,z) wcstombs((char*)x,(const FESTRING_WIDE*)y,z) 20 #define FESTRING_WIDE wchar_t 21 #define FESTR_MB2WC(x,y,z) mbstowcs(x,(char*)y,z) 22 #define FESTR_WC2MB(x,y,z) wcstombs((char*)x,y,z) 25 #define FESTRING_WIDE_SIZE sizeof(FESTRING_WIDE) 64 void newBuffer(U32 size);
65 void deleteBuffer(
void);
68 FESTRING_U8* m_pBuffer8;
69 FESTRING_WIDE* m_pBufferWide;
97 operator const FESTRING_I8 *(void)
const 102 operator const FESTRING_U8 *(void)
const 106 operator const FESTRING_WIDE *(void)
const 114 {
return operator=((
const FESTRING_U8 *)operand); };
127 BWORD operator<(
const DualString &operand)
const 128 {
return compare(operand) < 0; }
166 const FESTRING_I8 *
raw(
void)
const {
return (FESTRING_I8 *)
rawU8(); };
169 const FESTRING_I8 *
c_str(
void)
const {
return (FESTRING_I8 *)
rawU8(); };
172 const FESTRING_U8 *
rawU8(
void)
const;
175 const FESTRING_WIDE *
rawWide(
void)
const;
179 void output(std::ostream &ostrm)
const;
180 void input(std::istream &istrm);
194 void forceCase(BWORD upper);
195 static U32 strlenWide(
const FESTRING_WIDE *buffer);
198 void confirmWide(
void);
200 virtual Rep *newRep(
void);
201 virtual void deleteRep(
void);
210 if(s1.
compare(s2)) {
return false; }
231 if(s1.
compare(s2)) {
return true; }
const FESTRING_I8 * c_str(void) const
Return the contents of the 8-bit buffer cast as signed bytes.
Definition: DualString.h:169
const FESTRING_I8 * raw(void) const
Return the contents of the 8-bit buffer cast as signed bytes.
Definition: DualString.h:166
Automatically reference-counted string container.
Definition: DualString.h:57
U32 length(void) const
Return the number of represented characters, but not necessarily the size of any buffer.
Definition: DualString.cc:276
DualString & cat(std::list< DualString > &strList, DualString sep="")
Concatenate the strings in a list.
Definition: DualString.cc:467
kernel
Definition: namespace.dox:3
DualString & sPrintf(const char *fmt,...)
Populate the string in the manner of sprintf().
Definition: DualString.cc:435
I32 compare(const DualString &operand) const
Standard string compare: returns -1, 0, or 1 if the string is alphabetically less than...
Definition: DualString.cc:367
BWORD operator!=(const DualString &s1, const DualString &s2)
Compare two DualString's (reverse logic)
Definition: DualString.h:229
const FESTRING_U8 * rawU8(void) const
Return the contents of the 8-bit buffer cast as unsigned bytes.
Definition: DualString.cc:308
BWORD operator==(const DualString &s1, const DualString &s2)
Compare two DualString's.
Definition: DualString.h:208
DualString & operator=(const FESTRING_I8 *operand)
Compare to a signed byte buffer (using 8-bit).
Definition: DualString.h:113
DualString(void)
Construct an empty string.
Definition: DualString.cc:15
DualString & vsPrintf(const char *fmt, va_list ap)
Populate using variable arg format.
Definition: DualString.cc:483
void forceLowercase(void)
Force all applicable characters to lower case.
Definition: DualString.h:142
DualString & catf(const char *fmt,...)
Populate the string as with SPrintf(), but by concatenating the results to the existing string...
Definition: DualString.cc:449
void forceUppercase(void)
Force all applicable characters to upper case.
Definition: DualString.h:140
BWORD dotMatch(const DualString &operand) const
Compares to another string assuming the given string is a dot-delimited ordered list containing optio...
Definition: DualString.cc:393
const FESTRING_WIDE * rawWide(void) const
Return the contents of the wide buffer cast in native unicode format.
Definition: DualString.cc:318
void output(std::ostream &ostrm) const
Definition: DualString.cc:513
DualString errorDualString(int error)
Return a string for an FE_ERRNO code.
Definition: DualString.cc:584
DualString copy(void) const
Returns a new string with a copied underlying representation.
Definition: DualString.cc:292
DualString & operator=(const DualString &operand)
Compare to another DualString.
Definition: DualString.cc:246