SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Inserts the contents of a Unicode string into an output stream, padding it with a designated fill character. More...
#include <rw/tools/bustring.h>
Public Member Functions | |
Pad (const Pad &source) | |
Pad (const RWBasicUString &ustr, RWUChar32 codePoint=RWBasicUString::DefaultFillCharacter) | |
Public Attributes | |
const RWUChar16 * | data_ |
size_t | length_ |
RWUChar32 | codePoint_ |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &os, const RWBasicUString::Pad &pad) |
Defines an iostream manipulator that can be used to insert the contents of a Unicode string into an output stream, padding the Unicode string with a specified fill character until the entire width()
of the output stream has been filled with code points.
If the length of the Unicode string is greater than the width()
of the output stream, or if the width()
of the output stream is zero, the entire contents of the Unicode string is inserted into the stream and no padding occurs.
A Pad instance is only valid as long as the source string remains unchanged. Do not create persistent instances of this class. It should only be instantiated as a temporary in an insertion expression.
RWBasicUString ustr = ...; std::cout << RWBasicUString::Pad(ustr,static_cast<RWUChar32>('.')) << std::endl;
RWBasicUString::Pad::Pad | ( | const Pad & | source | ) | [inline] |
Constructs a copy of source.
RWBasicUString::Pad::Pad | ( | const RWBasicUString & | ustr, | |
RWUChar32 | codePoint = RWBasicUString::DefaultFillCharacter | |||
) | [inline] |
Constructs a manipulator instance. The default fill character, specified in the second parameter, is the Unicode space character.
std::ostream & operator<< | ( | std::ostream & | os, | |
const RWBasicUString::Pad & | pad | |||
) | [related] |
Writes the sequence of bytes that are produced when the contents of the RWBasicUString used to construct pad are converted into a UTF-8 representation.
If os.width()
is greater than the number of code points contained in the source string, the output is padded using the code point specified as a parameter to pad. If os.width()
is less than the number of code points contained the source string, the entire contents of the string are inserted into the output stream.
Any padding is inserted after the string if the ios_base::left
format flag is set, or before if ios_base::right
is set or neither flag is set.
RWConversionErr | Thrown to report conversion errors. | |
std::ios_base::failure | Thrown to report any errors detected while performing stream operations. |
The code point used to pad the string. The default code point is the Unicode space character.
The string to pad.
size_t RWBasicUString::Pad::length_ |
The code unit length of the array referenced by data_.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.