AcString

Class Hierarchy

AcHeapOperators
    AcString

C++

class AcString : public AcHeapOperators;

File

AcString.h

Description

AcString is a compiler-neutral string class. It provides functions for converting between multibyte (ANSI) strings and Unicode, and it is MIF (M+nxxyy) and CIF (U+xxxx) aware.

Remarks

All char arguments are assumed to be codes in the current code page, unless otherwise specified.

In places where a single char value is passed, the value cannot be a leading byte of a double-byte char, except where noted.

Notes

  1. All wchar_t arguments are assumed to be "widechar" Unicode values.
  2. The pointer returned from utf8Ptr() and kwszPtr() is valid until the next time this AcString is modified.
  3. Never cast away const from a pointer obtained by utf8Ptr() or kwszPtr() buffer, in order to modify the buffer directly. These buffers may be shared by multiple AcString instances. Instead, to operate on buffers directly, first call getBuffer() to obtain a pointer.
  4. Although utf8Ptr() is a const member function, it may reallocate the string's internal buffer and thus invalidate pointers returned by a previous kwszPtr() call utf8Ptr() is the only const method which can modify the AcString.
  5. kwszPtr(), constPtr(), kTCharPtr(), kACharPtr() and operator const wchar_t *() are all equivalent. They return a pointer to the null-terminated widechar string. The redundancy is for historical reasons.
  6. All index values (also known as position values) are 0-based. For example, in the string "abcd", the 'c' character has position 2.

Links

AcString Constructor, AcString Enumerations, AcString Methods, AcString Operators