RAD Studio VCL Reference
|
System::AnsiStringT is the C++ analog for the Delphi long string type.
AnsiStringT<unsigned short CP> = class(AnsiStringBase);
template <unsigned short CP> class AnsiStringT : public AnsiStringBase;
System::AnsiStringT exists to provide a place for methods/members that are common to all instantiations of the template class AnsiStringT<CodePage>. AnsiString itself is a typedef that is equivalent to AnsiStringT<0>. You should never deal directly with System::AnsiStringT.
System::AnsiStringT is a template class that you use when handling a Delphi AnsiString that has a code page specified with it.
Delphi uses several string types. One important long string type is commonly known as System::AnsiString. Support for this type includes the following features:
System::AnsiStringT is a template class that holds code for each specific code page. Despite its name, System::AnsiStringT is not restricted to the ANSI character set, and can use any character set supported by the current locale definition, including multi-byte or Unicode character sets.
System::AnsiStringT variables that have not been assigned an initial value contain a zero-length string.
To use the C++ streaming operators (<< and >>) with System::AnsiStringT, you must iostream before including system.hpp and use AnsiStringT::c_str() to return the internal string representation. The following example demonstrates the usage of AnsiString with stream operators:
#include <iostream> #include <system.hpp> int main() { AnsiString HelloStr = "hello"; std::cout << HelloStr.c_str(); }
How to Handle Delphi AnsiString Code Page Specification in C++
System::AnsiStringT::[]
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|