Home How To Online Documentation Support Download Order





Enums and Typedefs

Class Members


SAString object

SAString is a subsidiary class. The SAString class provides support for manipulating strings. It is intended to replace and extend the functionality normally provided by the C run-time library string package. The SAString class supplies member functions and operators for simplified string handling. The class also provides constructors and operators for constructing, assigning, and comparing SAString objects and standard C++ string data types.

SAString is based on the SAChar data type. If the symbol SA_UNICODE is defined for your program, SAChar is defined as type wchar_t, a 16-bit character type; otherwise, it is defined as char, the normal 8-bit character type (default, SA_UNICODE is not defined). Under Unicode, then, SAString objects are composed of 16-bit characters. Without Unicode, they are composed of 8-bit char type.

When not using SA_UNICODE, SAString is enabled for multibyte character sets. Note that for multibyte strings, SAString still counts, returns, and manipulates strings based on 8-bit characters, and your application must interpret multibyte lead and trail bytes itself.

SAString objects follow “value semantics.” A SAString object represents a unique value. Think of a SAString as an actual string, not as a pointer to a string.

A SAString object represents a sequence of a variable number of characters. SAString objects can be thought of as arrays of characters.

When SAString objects are copied, the Library increments a reference count rather than copying the data. This makes passing parameters by value and returning SAString objects by value more efficient. These operations cause the copy constructor to be called, sometimes more than once. Incrementing a reference count reduces that overhead for these common operations and makes using SAString a more attractive option.

As each copy is destroyed, the reference count in the original object is decremented. The original SAString object is not destroyed until its reference count is reduced to zero.

Problems and Questions

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com.