The first variant can be used as an lvalue. If there is no such substring, then the null substring is returned. Returns the first substring starting after index start that matches the regular expression re. Operator()(const RWCRegexp& re, size_t start=0) const Operator()(const RWCRegexp& re, size_t start=0) If the library was built using the RW_DEBUG flag, and start and len are out of range, then an exception of type RWBoundsErr will occur. The sum of start plus len must be less than or equal to the string length. NOTE - This function returns an RWCSubString in implementations of the Essential Tools Module built without the C++ Standard Library. Returns an RWCSubString of self with length len, starting at index start. Operator()(size_t start, size_t len) const In this case, if the index is out of range, then an exception of type RWBoundsErr will occur. RWCString a("There is no joy in Beantown.") RWCConstSubString supports substring extractions on const RWCString instances. This is detected in the debug version of the library.Ī separate class RWCSubString supports substring extraction and modification operations. Parameters of type " const char*" must not be passed a value of zero. In any case, class RWCString can handle embedded nulls. Nevertheless, you should be aware of this and program defensively. In practice, it is a rare MBCS that uses embedded nulls. Hence, MBCS cannot be counted on being null terminated. One or more bytes of a multibyte character can be zero. Hence, if the string is known to be nothing but SBCS, then RWCString::length() is much to be preferred. Note that the latter is much slower because it must determine the number of bytes in every character. Use function RWCString::length() to get the number of bytes in a string, function RWCString::mbLength() to get the number of characters. There are two things that must be kept in mind when working with MBCS:īecause characters can be more than one byte long, the number of bytes in a string can, in general, be greater than the number of characters in the string. Refer to the class reference entry for RWClassicCString when dealing with non-standard library builds.Īpplications that perform many RWCString->basic_string conversions may be able to obtain significant speed improvements by using this C++ Standard Library implementation.Īlthough the class is primarily intended to be used to handle single-byte character sets (SBCS such as ASCII or ISO Latin-1), with care it can be used to handle multibyte character sets (MBCS). In builds that do not depend on the C++ Standard Library, RWCString is a typedef for RWClassicCString. RWCString is based on the std::string from the C++ Standard Library. To manipulate wide character strings, use RWWString. NOTE - RWCString is designed for use with multibyte character sequences. Module: Essential Tools Module Group: String Processing ClassesĬlass RWCString offers powerful and convenient facilities for manipulating strings. Rogue Wave web site: Home Page | Main Documentation Page RWCString
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |