50 #ifndef vtkUnicodeString_h 51 #define vtkUnicodeString_h 53 #include "vtkCommonCoreModule.h" 68 #define vtkSuperExtraExtendedTemplateMacro(call) \ 69 vtkExtraExtendedTemplateMacro(call); \ 70 vtkTemplateMacroCase(VTK_UNICODE_STRING, vtkUnicodeString, call) 100 std::string::const_iterator Position;
125 static bool is_utf8(
const char*);
163 value_type
at(size_type
offset)
const;
182 std::vector<vtkTypeUInt16>
utf16_str()
const;
187 void utf16_str(std::vector<vtkTypeUInt16>& result)
const;
226 void append(size_type count, value_type character);
235 void assign(size_type count, value_type character);
276 class back_insert_iterator;
static vtkUnicodeString from_utf16(const vtkTypeUInt16 *)
Constructs a string from a null-terminated sequence of UTF-16 encoded characters. ...
VTKCOMMONCORE_EXPORT bool operator>=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
static bool is_utf8(const char *)
Tests a sequence of bytes, returning true iff they are a valid UTF-8 sequence.
vtkUnicodeString & operator=(const vtkUnicodeString &)
Replaces the current sequence with a deep copy of another.
vtkUnicodeString fold_case() const
Returns a copy of the current sequence, modified so that differences in case are eliminated.
value_type operator[](size_type offset) const
Returns the Unicode character at the given character offset within the sequence.
VTKCOMMONCORE_EXPORT bool operator<=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
void append(const vtkUnicodeString &value)
Append Unicode to the current sequence.
void push_back(value_type)
Append a Unicode character to the end of the sequence.
std::string::difference_type difference_type
vtkUnicodeStringValueType value_type
VTKCOMMONCORE_EXPORT bool operator<(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
VTKCOMMONCORE_EXPORT bool operator>(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
size_type byte_count() const
Returns the number of bytes (not characters) in the sequence.
size_type character_count() const
Returns the number of characters (not bytes) in the sequence.
int compare(const vtkUnicodeString &) const
Returns a negative value if the sequence compares less-than the operand sequence, zero if the two seq...
vtkUnicodeString & operator+=(value_type)
Append a Unicode character to the end of the sequence.
static vtkUnicodeString from_utf8(const char *)
Constructs a string from a null-terminated sequence of UTF-8 encoded characters.
const char * utf8_str() const
Returns the sequence as a null-terminated sequence of UTF-8 encoded characters.
std::vector< vtkTypeUInt16 > utf16_str() const
Returns the sequence as a collection of UTF-16 encoded characters.
void swap(vtkUnicodeString &)
Swap the sequences stored by two strings.
void assign(const vtkUnicodeString &value)
Replace the current sequence with another.
static const size_type npos
The largest representable value of size_type, used as a special-code.
std::bidirectional_iterator_tag iterator_category
value_type at(size_type offset) const
Returns the Unicode character at the given character offset within the sequence, or throws std::out_o...
const_iterator end() const
Returns a forward iterator that points just beyond the end of the sequence.
VTKCOMMONCORE_EXPORT bool operator!=(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkUnicodeString substr(size_type offset=0, size_type count=npos) const
Returns a subset of the current sequence that up-to 'count' characters in length, starting at charact...
void clear()
Resets the string to an empty sequence.
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkVector< A, Size > operator*(const vtkVector< A, Size > &v1, const vtkVector< A, Size > &v2)
bool empty() const
Returns true if the string contains an empty sequence.
vtkTypeUInt32 vtkUnicodeStringValueType
std::string::size_type size_type
vtkUnicodeString()
Constructs an empty string.
vtkUnicodeStringValueType value_type
String class that stores Unicode text.
const_iterator begin() const
Returns a forward iterator that points at the first element of the sequence (or just beyond the end o...