API Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
String.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: String
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Buffer.h>
35#include <NDEVR/StringStream.h>
36#include <cmath>
37namespace NDEVR
38{
39 /**--------------------------------------------------------------------------------------------------
40 \brief The core String class for the NDEVR API.
41
42 This String class:
43 - Explicitly uses Unicode (UTF8)
44 - Easy functions for converting to anything (getAs<class>())
45 - Inherits faster Buffer class
46 - Provides a quick way to easily convert classes to and from a string in a modular way.
47
48 See StringStream for details on providing a definition that will allow any object to be used as a
49 constructor for String, or convert a String into any object using getAs<...>()
50
51 The string container is guaranteed to be null-terminated meaning that c_str() and begin() will
52 both point directly into the data structure.
53
54 TranslatedString should be used, when possible, for any data that will be displayed to the user.
55
56 Strings can be used in case statements using string.hash[upper/lower]()
57 \code
58 switch (string.hashUpper())
59 {
60 case String::hash("DEFAULT"): value = CompressionMode::e_default; break;
61 case String::hash("BEST"): value = CompressionMode::e_best; break;
62 case String::hash("NONE"): value = CompressionMode::e_none; break;
63 }
64 \endcode
65 Since the String is null terminated, declaring a String using String(256) will allocate
66 257 bytes on the heap. Thus for memory management, block sizes should be one smaller.
67 */
68 class String : public Buffer<char, uint04, ObjectAllocator<true>, BufferAllocator<char, uint04, true>>
69 {
70 public:
71 /**
72 \brief Constructor used to create an empty String*
73 */
75 /**
76 \brief Copy Constructor
77 */
79 /**
80 \brief Move contructor (No new memory allocation).
81 */
82 NDEVR_BASE_API String(String&& string) noexcept;
83
84 /**
85 \brief String Constructor for static char arrays.
86 \param[in] string The array of characters making up the string. Should be in Unicode (UTF8)
87 */
88 template<std::size_t N>
89 String(const char (&string)[N])
90 : Buffer(string, str_len(string))
91 {}
92 /**
93 \brief String Constructor for static wchar arrays of UTF16 data.
94 \param[in] string UTF16 array of characters making up the string, will be converted to UTF8.
95 */
96 template<std::size_t N>
97 String(const wchar(&string)[N])
98 {
99 addUTF16AsUTF8(string);
100 }
101 /**
102 \brief String Constructor for null terminated array of chars
103 \param[in] string The array of characters making up the string. Should be in Unicode (UTF8) and
104 null terminated.
105 */
106 String(const char* string)
107 : Buffer(string, string == nullptr ? 0 : str_len(string))
108 {}
109 /**
110 \brief String Constructor char arrays when the size is known. Slightly faster than iterating
111 over a null-terminated array.
112 \param[in] string The array of characters making up the string. Should be in Unicode (UTF8)
113 \param[in] size The size of the string
114 */
115 NDEVR_BASE_API String(const char* const string, uint04 size);
116
117 /**
118 \brief String Constructor creates a string of a size and fills it with a character
119 \param[in] size The size of the string
120 \param[in] value The value to set all characters in the string to.
121 */
122 String(uint04 size, const char& value)
123 : Buffer(size, value)
124 {}
125
126 /**
127 \brief String Constructor that creates a string based off an object. To use this function an object
128 must have overwritten StringStream<t_type>::toString.
129 \param[in] value The value to use as a reference to generate a string representation.
130 */
131 template<class t_type>
132 explicit String(const t_type& value)
133 {
134 StringStream<t_type>::toString(value, *this);
135 }
136
137 /**
138 \brief Converts a string into an object. To use this function an object
139 must have overwritten StringStream<t_type>::fromString.
140 \returns The object value of this string.
141 */
142 template <class t_type>
143 t_type getAs() const
144 {
145 t_type value;
147 return value;
148 }
149 /**
150 \brief Converts an object into a TranslatedString. To use this function an object
151 must have overwritten StringStream<t_type>::toDisplayString.
152 \returns The user-friendly string representation of this object.
153 */
154 template<class t_type>
155 static TranslatedString DisplayString(const t_type& value);
156 /**
157 \brief Tests if this String starts with the specified prefix.
158 \param[in] s the value to test against the start of this string.
159 \param[in] ignore_case whether or not to check using case sensitivity.
160 \returns true if the String begins with this value
161 */
162 NDEVR_BASE_API bool beginsWith(const String& s, bool ignore_case = false) const;
163
164 /**
165 \brief Tests if this String ends with the specified suffix.
166 \param[in] s the value to test against the start of this string.
167 \param[in] ignore_case whether or not to check using case sensitivity.
168 \returns true if the String begins with this value
169 */
170 NDEVR_BASE_API bool endsWith(const String& s, bool ignore_case = false) const;
171
172 /**
173 \brief Tests if this String contains the specified substring.
174 \param[in] sub_string the value to test for containment.
175 \param[in] ignore_case whether or not to check using case sensitivity.
176 \returns true if the String contains this value
177 */
178 NDEVR_BASE_API bool hasSubString(const String& sub_string, bool ignore_case = false) const;
179
180 /**
181 \brief Tests if this String contains the specified substring.
182 \param[in] sub_string the value to test for containment.
183 \param[in] ignore_case whether or not to check using case sensitivity.
184 \returns true if the String contains this value
185 */
186 NDEVR_BASE_API bool hasSubString(const char* sub_string, bool ignore_case = false) const;
187
188 /**
189 \brief Given a substring specified by the input, returns the first index of that string, if it exists.
190 \param[in] sub_string the value to find in the String
191 \param[in] ignore_case whether or not to check using case sensitivity.
192 \param[in] start_index The index of where to begin searching for the sub_string.
193 \returns The first index pointing to the beginning of the substring, if it exists. If it is not
194 found, Constant<uint04>::Invalid is returned.
195 */
196 NDEVR_BASE_API uint04 indexOf(const String& sub_string, bool ignore_case = false, uint04 start_index = 0) const;
197
198 /**
199 \brief Given a substring specified by the input, returns the first index of that string, if it exists.
200 \param[in] sub_string the value to find in the String
201 \returns The first index pointing to the beginning of the substring, if it exists. If it is not
202 found, Constant<uint04>::Invalid is returned.
203 */
204 NDEVR_BASE_API uint04 indexOf(const char& sub_string) const { return Buffer::indexOf(sub_string); }
205
206 /**
207 \brief Given a substring specified by the input, returns the first index of that string, if it exists.
208 \param[in] sub_string the value to find in the String
209 \param[in] start_pos The index of where to begin searching for the sub_string.
210 \returns The first index pointing to the beginning of the substring, if it exists. If it is not
211 found, Constant<uint04>::Invalid is returned.
212 */
213 NDEVR_BASE_API uint04 indexOf(const char& sub_string, uint04 start_pos) const { return Buffer::indexOf(sub_string, start_pos); }
214
215 /**
216 \brief Given a substring specified by the input, returns the first index of that string, if it exists.
217 \param[in] sub_string the value to find in the String
218 \param[in] start_pos The index of where to begin searching for the sub_string.
219 \param[in] size The max span to continue searching for the sub_string. The sub_string must entirely
220 reside within the span from start_pos to sie to be valid.
221 \returns The first index pointing to the beginning of the substring, if it exists. If it is not
222 found, Constant<uint04>::Invalid is returned.
223 */
224 NDEVR_BASE_API uint04 indexOf(const char& sub_string, uint04 start_pos, uint04 size) const { return Buffer::indexOf(sub_string, start_pos, size); }
225
226 /**
227 \brief Given a substring specified by the input, returns the first index of that string, if it exists.
228 \param[in] sub_string the value to find in the String
229 \param[in] ignore_case whether or not to check using case sensitivity.
230 \param[in] start_index The index of where to begin searching for the sub_string.
231 \returns The first index pointing to the beginning of the substring, if it exists. If it is not
232 found, Constant<uint04>::Invalid is returned.
233 */
234 NDEVR_BASE_API uint04 indexOf(const char* sub_string, bool ignore_case = false, uint04 start_index = 0) const;
235
236 /**
237 \brief Given a substring specified by the input, returns the first index of that string, if it exists.
238 \param[in] sub_string the value to find in the String
239 \param[in] ignore_case whether or not to check using case sensitivity.
240 \param[in] start_index The index of where to begin searching for the sub_string.
241 \param[in] size The max span to continue searching for the sub_string. The sub_string must entirely
242 reside within the span from start_pos to sie to be valid.
243 \returns The first index pointing to the beginning of the substring, if it exists. If it is not
244 found, Constant<uint04>::Invalid is returned.
245 */
246 NDEVR_BASE_API uint04 indexOf(const char* sub_string, bool ignore_case, uint04 start_index, uint04 size) const;
247
248 /**
249 \brief Given a substring specified by the input, returns the first index of that string, if it exists.
250 \param[in] sub_string the value to find in the String
251 \param[in] escape_char The char that when encountered, ends the search.
252 \param[in] ignore_case whether or not to check using case sensitivity.
253 \param[in] start_index The index of where to begin searching for the sub_string.
254 \returns The first index pointing to the beginning of the substring, if it exists. If it is not
255 found, Constant<uint04>::Invalid is returned.
256 */
257 NDEVR_BASE_API uint04 indexOf(const char* sub_string, char escape_char, bool ignore_case = false, uint04 start_index = 0) const;
258
259 /**
260 \brief Given a substring specified by the input, returns the last index of that string, if it exists.
261 \param[in] sub_string the value to find in the String
262 \param[in] ignore_case whether or not to check using case sensitivity.
263 \returns The last index of pointing to the beginning of the substring, if it exists. If it does not
264 exist, Constant<uint04>::Invalid is returned.
265 */
266 NDEVR_BASE_API uint04 lastIndexOf(const char* sub_string, bool ignore_case = false) const;
267
268 /**
269 \brief Given a value specified by the input, returns the last index of that char, if it exists.
270 \param[in] value the value to find in the String
271 \param[in] ignore_case whether or not to check using case sensitivity.
272 \returns The last index of pointing to the beginning of the substring, if it exists. If it does not
273 exist, Constant<uint04>::Invalid is returned.
274 */
275 NDEVR_BASE_API uint04 lastIndexOf(const char value, bool ignore_case = false) const;
276
277 /**
278 \brief Replaces ALL instances of a given substring with the provided replacement.
279 \param[in] sub_string The subsring to replace
280 \param[in] replace_sub_string The string to replace ALL instances of the provided sub_string with.
281 \param[in] ignore_case whether or not to check using case sensitivity checks. This will not
282 affect the replacement value, only which parts to replace.
283 \returns A reference to this String.
284 */
285 NDEVR_BASE_API String& replace(const String& sub_string, const String& replace_sub_string, bool ignore_case = false);
286
287 /**
288 \brief Replaces ALL instances of the given substrings with the provided replacements. This allows safe
289 replacement when the replacement string might contain the same data being replaced.
290
291 \param[in] sub_string The subsrings to replace
292 \param[in] replace_sub_string The strings to replace ALL instances of the provided sub_string with.
293 \param[in] ignore_case whether or not to check using case sensitivity checks. This will not
294 affect the replacement value, only which parts to replace.
295 \returns A reference to this String.
296 */
297 NDEVR_BASE_API String& replace(const Buffer<String, uint04, ObjectAllocator<false>>& sub_string, const Buffer<String, uint04, ObjectAllocator<false>>& replace_sub_string, bool ignore_case = false);
298
299 /**
300 \brief Given a delimiter, breaks the string into subsections, returning an array of each subsection.
301 If the String is empty, an empty String will be appended to the output if preserve_empty is true.
302
303 For example, String("The quick, dog,,jumped").splitString(',', true) would
304 return {"The quick", " dog", "", "jumped"}
305
306 \param[in] delimiter The delimiter to split the string
307 \param[in] preserve_empty If true, when two delimiters are encountered, an empty string is added to
308 the return Buffer. If false, there will be no added empty strings.
309 \returns A Buffer of substrings that were broken apart from this string using the delimiter.
310 */
311 NDEVR_BASE_API Buffer<String, uint04, ObjectAllocator<false>> splitString(char delimiter, bool preserve_empty = true) const;
312
313 /**
314 \brief Given multiple delimiter, breaks the string into subsections, returning an array of each subsection.
315 If the String is empty, an empty String will be appended to the output if preserve_empty is true.
316 For example, String("The quick, dog,,jumped").splitString({',', ' '}, true) would
317 return {"The", "quick", "dog", "", "jumped"}
318 \param[in] delimiter The delimiter to split the string
319 \param[in] preserve_empty If true, when two delimiters are encountered, an empty string is added to
320 the return Buffer. If false, there will be no added empty strings.
321 \returns A Buffer of substrings that were broken apart from this string using the delimiters.
322 */
323 NDEVR_BASE_API Buffer<String, uint04, ObjectAllocator<false>> splitString(const Buffer<char>& delimiter, bool preserve_empty = true) const;
324
325 /**
326 \brief Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given Buffer.
327 If the String is empty, an empty Buffer will be appended if preserve_empty is true.
328 \param[in] delimiter The delimiter to split the string
329 \param[in] preserve_empty If true, when two delimiters are encountered, an empty string is added to
330 the return Buffer. If false, there will be no added empty strings.
331 \param[out] strings will be appended with substrings that were broken apart from this string using the delimiter.
332 */
333 NDEVR_BASE_API void splitString(char delimiter, Buffer<String, uint04, ObjectAllocator<false>>& strings, bool preserve_empty = true) const;
334
335 /**
336 \brief Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given Buffer.
337 If the String is empty, an empty String will be appended if preserve_empty is true.
338 \param[in] delimiter The delimiter to split the string
339 \param[in] preserve_empty If true, when two delimiters are encountered, an empty string is added to
340 the return Buffer. If false, there will be no added empty strings.
341 \param[out] strings will be appended with substrings that were broken apart from this string using the delimiter.
342 */
343 NDEVR_BASE_API void splitString(const Buffer<char>& delimiter, Buffer<String, uint04, ObjectAllocator<false>>& strings, bool preserve_empty = true) const;
344
345 /**
346 \brief Used to access the raw memory of this string.
347 \returns A pointer to the internal memory of the string which is guaranteed to be null terminated.
348 */
349 NDEVR_BASE_API const char* c_str() const;
350
351 /**
352 \brief Checks whether two strings match in a case-insensitive way.
353 \param[in] s The string to compare against
354 \returns True if the strings match in a case insensitive way.
355 */
356 NDEVR_BASE_API bool isSameNoCase(const String& s) const;
357
358 /**
359 \brief Checks whether two strings match allowing '*' to be used as a wildcard pattern.
360 For example, String(\"Hello\").matchesWildcard(\"*ll*\") would return true.
361 \param[in] pattern The pattern used to check the string against.
362 \returns true if the string matches a given wild card pattern.
363 */
364 NDEVR_BASE_API bool matchesWildcard(const String& pattern) const;
365 /**
366 \brief Appends a string to the back of this string.
367 \param[in] string The string to append.
368 \returns A reference to this string.
369 */
371 /**
372 \brief Creates a simple, quick hash of the object. See hash(const char* value)
373 for details of the implementation.
374 \returns A hash value for this string.
375 */
377 /**
378 \brief Creates a simple, quick hash of the object. See hash(const char* value)
379 for details of the implementation.
380 \returns A hash value for this string as if it were all uppercase.
381 */
383 /**
384 \brief Creates a simple, quick hash of the object. See hash(const char* value)
385 for details of the implementation.
386 \returns A hash value for this string as if where all lowercase.
387 */
389 /**
390 \brief Creates a substring from a given start position, to the end of the string
391 \param[in] start The index where to start the substring.
392 \returns the substring starting at start.
393 */
395 /**
396 \brief Creates a substring from a given start position, to the given end position, non-inclusive of the
397 end index. If the end index is greater than the size of the string, all data past start is returned.
398 \param[in] start the index where to start the substring.
399 \param[in] end the index where to end the substring (non-inclusive).
400 \returns the substring starting at start, going until end index or the end of the string.
401 */
403 /**
404 \brief Trims any white space (tabs, spaces, etc) from the beginning and end of the string.
405 \returns A reference to this String.
406 */
408 /**
409 \brief Used for formatting, will, if necessary, add white space so that the string becomes a
410 certain length. desired_right_alignment_location Will try and align the string to a location by
411 prepending whitspace. desired_string_size will append space to try and make the string a given size.
412 \param[in] desired_string_size The size the string should be once whitespace is added to the end.
413 \param[in] desired_right_alignment_location If the string is smaller than desired_right_alignment_location
414 will add whitespace until the rightmost terminating index is equal to desired_right_alignment_location.
415 \param[in] whitespace the character to use for whitespace.
416 \returns A reference to this String.
417 */
418 NDEVR_BASE_API String& addWhiteSpace(uint04 desired_string_size, uint04 desired_right_alignment_location = 0, char whitespace = ' ');
419 /**
420 \brief For a string representing a number, makes the decimals equal to the the provided value
421 Example: String("1000000").formatNumberString(2); will make "1000000.00"
422 \warning Undefined behavior if this string does not represent a single number.
423 \param[in] decimals the set number of decimals the string should have.
424 \returns A reference to this String.
425 */
427 /**
428 \brief For a string representing a number, makes the decimals equal to the the provided value and
429 adds comma seperators if number is large enough
430 \warning Undefined behavior if this string does not represent a single number.
431 Example: String("1000000").formatNumberString(true, 2); will make "1,000,000.00"
432
433 \param[in] add_comma Adds comma seperators if number is large enough
434 \param[in] decimals the set number of decimals the string should have.
435 \returns A reference to this String.
436 */
437 NDEVR_BASE_API String& formatNumberString(bool add_comma, uint04 decimals);
438 /**
439 \brief Modifies the contents of this string, that represents a given number using the provided rules.
440 \warning Undefined behavior if this string does not represent a single number.
441 \param[in] add_comma Adds comma seperators if number is large enough
442 \param[in] min_decimals The minimum number of decimals the formatted number should have (will add 0's to end)
443 \param[in] max_decimals The maximum number of decimals the formatted number should have (will remove more decimals)
444 \param[in] min_digits The minimum number of digits the formatted number should have (will add 0's to the begining)
445 \param[in] decimal The character to use as the decimal ('.')
446 \param[in] comma The character to use as the comma (',')
447 \returns A reference to this String.
448 */
449 NDEVR_BASE_API String& formatNumberString(bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, char decimal = '.', char comma = ',');
450 /**
451 \brief Formats the string to be a title, capitalizing important characters and replacing underscores with spaces
452 \returns A reference to this String.
453 */
455 /**
456 \brief Removes any characters that aren't numbers or letters with other options available.
457 \param[in] remove_tab Whether or not to remove tabs
458 \param[in] remove_space Whether or not to remove spaces
459 \param[in] remove_new_line Whether or not to remove new lines '\\n'
460 \param[in] remove_r Whether or not to remove carage return '\\r'
461 \param[in] remove_numbers Whether or not to remove numbers.
462 \returns A reference to this String.
463 */
464 NDEVR_BASE_API String& removeNonAlphaNumeric(bool remove_tab = true, bool remove_space = true, bool remove_new_line = true, bool remove_r = true, bool remove_numbers = false);
465 /**
466 \brief Removes anything that is not a number or decimal ('0'-'9' or .)
467 \returns A reference to this String.
468 */
470 /**
471 \brief Shortans the string to the max size provided. If string is longer, searches for
472 an ideal place to insert "..."
473 \param[in] size The max size of the new string.
474 \returns The shortened String
475 */
477 /**
478 \brief Finds key areas to insert new lines such that the rows are at most, the
479 length provided.
480 \param[in] max_line_size The max size of any row of the resulting string
481 \returns A string with the new lines inserted appropriately
482 */
484 /**
485 \brief Looks in the string for key markers that might be an index, and attempts
486 to increment the index. If no index is found a "1" will be inserted to the end
487 of the string.
488 \returns A string that represents an incremented index
489 */
491 /**
492 \brief changes all lower case characters into upper case characters.
493 \returns A string in all upper case
494 */
496 /**
497 \brief changes all upper case characters into lower case characters.
498 \returns A string in all lower case
499 */
501 /**
502 \brief Checks to see if the string is a numeric string.
503 \returns true if the string could be representing a number, false if some non-numeric data is present.
504 */
506 /**
507 \brief Converts a hex value into an unsigned 4 byte number
508 \returns the hex value of this string or Constant<uint04>::Invalid if this is not a hex string.
509 */
511 /**
512 \brief Converts a unicode null terminated string of UTF16 wchars into UTF8 and
513 appends it to the end of the String
514 \param[in] unicode The UTF16 null-terminated string of chars to append to this string
515 */
516 NDEVR_BASE_API void addUTF16AsUTF8(const wchar* unicode);
517 /**
518 \brief Converts a single unicode character at advance into UTF8 and appends it to the end
519 of the String
520 \param[in] unicode The UTF16 string of chars to append to this string
521 \param[in,out] advance the location in unicode to append, will be incremented based on number of
522 UT16 characters consumed (1 or 2).
523 */
524 NDEVR_BASE_API bool addUTF16CharAsUTF8(const wchar* unicode, uint04& advance);
525 /**
526 \brief Converts a single unicode character UTF16 character into one or more UTF8 characters and
527 appends them to the end of this String.
528 \param[in] object The UTF16 encoded object to append.
529 */
530 void addWChar(const wchar& object);
531
532 String& operator=(const String& value)
533 {
534 Buffer::operator=(value);
535 return *this;
536 }
537
538 String& operator=(String&& value) noexcept
539 {
540 Buffer::operator=(std::move(value));
541 return *this;
542 }
543 bool operator==(const String& value) const
544 {
545 if (value.size() != size())
546 return false;
547 for (uint04 i = 0; i < size(); i++)
548 {
549 if (value[i] != (*this)[i])
550 return false;
551 }
552 return true;
553 }
554 bool operator==(const char* const value) const
555 {
556 for (uint04 i = 0; i < size(); i++)
557 {
558 if (value[i] != (*this)[i])
559 return false;
560 }
561 return value[size()] == '\0';//check if strings are same size
562 }
563 template<std::size_t t_size>
564 bool operator==(const char(&string)[t_size])
565 {
566 if (t_size <= size())
567 return false;
568 if (string[size()] != '\0')
569 return false;
570 return memcmp(string, begin(), sizeof(char) * size()) == 0;
571 }
572
573 bool operator!=(const char* const value) const
574 {
575 for (uint04 i = 0; i < size(); i++)
576 {
577 if (value[i] != (*this)[i])
578 return true;
579 }
580 return value[size()] != '\0';//check if strings are same size
581 }
582 template<std::size_t t_size>
583 bool operator!=(const char(&string)[t_size])
584 {
585 if (t_size <= size())
586 return true;
587 if (string[size()] != '\0')
588 return true;
589 return memcmp(string, begin(), sizeof(char) * size()) != 0;
590 }
591 bool operator!=(const String& value) const
592 {
593 if (value.size() != size())
594 return true;
595 for (uint04 i = 0; i < size(); i++)
596 {
597 if (value[i] != (*this)[i])
598 return true;
599 }
600 return false;//check if strings are same size
601 }
602 NDEVR_BASE_API bool operator<(const String& value) const;
603 NDEVR_BASE_API bool operator>(const String& value) const;
604
605 operator uint08() const
606 {
607 return hash();
608 }
609 operator uint04() const
610 {
612 }
613 size_t operator()() const
614 {
615 return cast<size_t>(hash());
616 }
617 public:
618 /**
619 \brief Converts a number into a char string. For example 0 will become 'A' and 27 will become 'AA'
620 \param[in] number The number to convert to a character representation.
621 */
623 /**
624 Converts a single unicode character at advance into UTF8 and and returns it as a String
625 \param[in] unicode The UTF16 string of chars to append to this string
626 \param[in,out] advance the location in unicode to append, will be incremented based on number of
627 UT16 characters consumed (1 or 2).
628 */
629 NDEVR_BASE_API static String UTF16toUTF8(const wchar* unicode, uint04& advance);
630 /**
631 \brief Checks whether a given character is a whitespace character or not.
632 \param[in] s the character to check against.
633 \returns true if the character is considered by the software to be whitespace, false if not.
634 */
635 NDEVR_BASE_API static bool IsWhiteSpace(char s);
636 /**
637 \brief Creates a string from a given number using the provided rules.
638 \warning If the value is Invalid, the resulting string will be \"NaN\".
639 \param[in] value The value to convert to a string.
640 \param[in] add_comma Adds comma seperators if number is large enough
641 \param[in] min_decimals The minimum number of decimals the formatted number should have (will add 0's to end)
642 \param[in] max_decimals The maximum number of decimals the formatted number should have (will remove more decimals)
643 \param[in] min_digits The minimum number of digits the formatted number should have (will add 0's to the begining)
644 \param[in] decimal The character to use as the decimal ('.')
645 \param[in] comma The character to use as the comma (',')
646 \returns A reference to this String.
647 */
648 NDEVR_BASE_API static String NumberString(fltp08 value, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, char decimal = '.', char comma = ',');
649 /**
650 \brief Converts a unicode null terminated string of chars into a UTF16 wchar and
651 increments advance by the ammount of characters consumed to make the
652 UTF16 character.
653 \param[in] utf8 the UTF8 value to convert to UTF16.
654 \param[in,out] advance The advance from the start of utf8 which will be incremented by
655 this function.
656 \returns A UTF16 unicode character.
657 */
658 NDEVR_BASE_API static wchar UTF8toUTF16(const char* utf8, uint04& advance);
659 /**
660 \brief Converts the memory of the given object into a hexidecimal string.
661 \param[in] value The value to convert to a hex form.
662 \returns A string filled with the hex values representing the given object
663 */
665 /**
666 \brief Converts the memory of the given object into a hexidecimal string.
667 \param[in] value The value to convert to a hex form.
668 \returns A string filled with the hex values representing the given object
669 */
670 NDEVR_BASE_API static String ToHex(char value);
671 /**
672 \brief Converts the memory of the given object into a hexidecimal string.
673 \param[in] value The value to convert to a hex form.
674 \returns A string filled with the hex values representing the given object
675 */
676 template<class t_object>
677 static typename std::enable_if<ObjectInfo<t_object>::Integer, String>::type ToHex(t_object value)
678 {
679 String hex;
680 uint04 byte_size = cast<uint04>(sizeof(t_object));
681 hex.setSize(2 * byte_size);
682 for (uint04 i = 0; i < byte_size; i++)
683 {
684 String local_hex = ToHex(rcast<uint01>(value % 256));
685 hex[2 * (byte_size - i - 1) + 0] = local_hex[0];
686 hex[2 * (byte_size - i - 1) + 1] = local_hex[1];
687 value /= cast<t_object>(256);
688 }
689 return hex;
690 }
691 /**
692 \brief Converts a buffer of objects into a hexidecimal string.
693 \param[in] values The values to convert to a hex form.
694 \returns A string filled with the hex values representing the given object
695 */
696 template<class t_object, class t_allocator, class t_buff>
698 {
699 String hex;
700 hex.ensureCapacity(values.size() * 2 * sizeof(t_object));
701 for (uint04 i = 0; i < values.size(); i++)
702 {
703 hex += ToHex(values[i]);
704 }
705 return hex;
706 }
707 /**
708 \brief Converts a string of any type of data (assumed to be binary) into a hex representation.
709 \param[in] values Raw binary data in the form of a string.
710 \returns A string filled with the hex values representing the given object
711 */
712 static String ToHex(const String& values)
713 {
714 String hex;
715 hex.ensureCapacity(values.size());
716 for (uint04 i = 0; i < values.size(); i++)
717 {
718 hex += ToHex(values[i]);
719 }
720 return hex;
721 }
722 /**
723 \brief Converts a vector into a hex representation.
724 \param[in] values Raw binary data in the form of a string.
725 \returns A string filled with the hex values representing the given object
726 */
727 template<uint01 t_size, class t_type>
728 static String ToHex(const Vector<t_size, t_type>& values)
729 {
730 String hex;
731 hex.ensureCapacity(cast<uint04>(t_size) * 2 * sizeof(t_type));
732 for (uint01 i = 0; i < t_size; i++)
733 {
734 hex += ToHex(values[i]);
735 }
736 return hex;
737 }
738 /**
739 \brief Compares two strings given their alpha-numeric determined value.
740 \returns True if left is LESS than right.
741 */
742 NDEVR_BASE_API static bool AlphaNumericCompare(const String& left, const String& right);
743
744 /**
745 \brief constexpr method to get the length of a null-terminated string at compile time
746 \param[in] value A null terminated string.
747 \returns the length of the string.
748 */
749 static constexpr uint04 str_len(const char* value)
750 {
751 const char* n_value = value;
752 for (; *n_value; ++n_value)
753 {
754 }
755 return cast<uint04>(n_value - value);
756 }
757 /**
758 \brief constexpr method to get the UTF8 length of a null-terminated string at compile time
759 \warning This is not designed to get the length of the wchar* array, but rather the length
760 of a char* array that represents this array.
761 \param[in] value A null-terminated UTF16 wchar string.
762 \returns the length of the String object that would be created from this object.
763 */
764 static constexpr uint04 str_len(const wchar* value)
765 {
766 uint04 count = 0;
767 const wchar* n_value = value;
768 for (; *n_value; ++n_value)
769 {
770 if (*n_value < 0x80)
771 {
772 count += 1;
773 }
774 else if (*n_value < 0x800)
775 {
776 count += 2;
777 }
778 else
779 {
780 uint04 cp = (*n_value << 16);
781 ++n_value;
782 cp += *n_value;
783 if (cp < 0x10000)
784 count += 3;
785 else
786 count += 4;
787 }
788 }
789 return count;
790 }
791#if _MSC_VER
792#pragma warning( disable : 4307)
793#endif
794 /**
795 \brief constexpr method to hash a value. Also provides the hashing method used throughout the
796 API to hash strings.
797 \returns A hash value.
798 \warning This is not designed to get the length of the wchar* array, but rather the length
799 of a char* array that represents this array.
800 */
801 static constexpr uint08 hash(const char* value)
802 {
803 uint08 hash_value = 5381U;
804 for (const char* n_value = value; *n_value; n_value++)
805 {
806 hash_value = ((hash_value << 5) + hash_value) + cast<uint08>(*n_value);
807 }
808 return hash_value;
809 }
810 private:
811 // The preprocessing function for Boyer Moore's bad character heuristic
812 static void BadCharHeuristic(const char* str, uint04 size, sint04 badchar[256], bool ignore_case);
813 static uint04 Search(const char* txt, const char* pat, uint04 size_m, uint04 size_n, bool ignore_case);
814 };
815 /**--------------------------------------------------------------------------------------------------
816 \brief Iterates over a UTF8 encoded string and returns the values as UTF16
817 **/
819 {
820 UTF8Iterator(const String& string);
822 protected:
825 };
826
827 inline String operator+(const String& string_a, const String& string_b)
828 {
829 String s;
830 s.ensureCapacity(string_a.size() + string_b.size());
831 s.addAll(string_a);
832 s.addAll(string_b);
833 return s;
834 }
835 inline String operator+(String&& v1, const String& v2)
836 {
837 v1.addAll(v2);
838 return std::move(v1);
839 }
840 inline String operator+(String&& v1, String&& v2)
841 {
842 v1.addAll(v2);
843 return std::move(v1);
844 }
845
846 inline String operator+(String&& v1, const char*& v2)
847 {
849 return std::move(v1);
850 }
851
852 inline String operator+(String&& v1, const char& v2)
853 {
854 v1.add(v2);
855 return std::move(v1);
856 }
857
858 inline String operator+(const String& v1, const char& v2)
859 {
860 String s(v1);
861 s.add(v2);
862 return s;
863 }
864
865 inline String operator+(const char*& v1, const String& v2)
866 {
867 String s;
869 s.ensureCapacity(v2.size() + size);
870 s.addAll(v1, size);
871 s.addAll(v2);
872 return s;
873 }
874
875 template<size_t t_size>
876 inline String operator+(String&& v1, const char(&v2)[t_size])
877 {
879 return std::move(v1);
880 }
881 template<size_t t_size>
882 inline String operator+(const String& v1, const char(&v2)[t_size])
883 {
884 String combined(v1);
885 combined.addAll(v2, cast<uint04>(String::str_len(v2)));
886 return combined;
887 }
888
889 inline String& operator+=(String& string, const String& value)
890 {
891 string.addAll(value);
892 return string;
893 }
894 template<size_t t_size>
895 inline String& operator+=(String& v1, const char(&v2)[t_size])
896 {
897 v1.addAll(v2);
898 return v1;
899 }
900
901 template<size_t t_size>
902 inline String operator+(const char(&v1)[t_size], const String& v2)
903 {
904 String s;
905 uint04 size = String::str_len(v1);
906 s.ensureCapacity(v2.size() + size);
907 s.addAll(v1, size);
908 s.addAll(v2);
909 return s;
910 }
911 template<size_t t_size>
912 inline bool operator==(const char(&v1)[t_size], const String& v2)
913 {
914 return v2 == v1;
915 }
916 inline bool operator==(const char*& v1, const String& v2)
917 {
918 return v2 == v1;
919 }
920 template<size_t t_size>
921 inline String operator+(const char(&v1)[t_size], String&& v2)
922 {
923 String s;
924 uint04 size = String::str_len(v1);
925 s.ensureCapacity(v2.size() + size);
926 s.addAll((char*)v1, size);
927 s.addAll(v2);
928 return s;
929 }
930 template<class t_to>
931 constexpr t_to cast(const String& value)
932 {
933 return static_cast<t_to>(value.getAs<t_to>());
934 }
935 template<>
936 struct ObjectInfo<String, false, true>
937 {
938 static const uint01 Dimensions = 0;
939 static const bool Vector = false;
940 static const bool Buffer = true;
941 static const bool Primitive = false;
942 static const bool Pointer = false;
943 static const bool Unsigned = false;
944 static const bool Float = false;
945 static const bool Integer = false;
946 static const bool Number = false;
947 static const bool Enum = false;
948 static const bool String = true;
949 static const bool Color = false;
950 static const bool Boolean = false;
951 static constexpr ObjectInfo<char, false, false> VectorSub() { return ObjectInfo<char, false, false>(); }
952 };
953
954 template<> inline const String Constant<String>::Invalid = String();
955 template<>
956 constexpr bool IsInvalid(const String& value)
957 {
958 return value.size() == 0;
959 }
960};
961
962
963namespace std//Define things to allow use within std libs
964{
965 template <>
966 struct hash<NDEVR::String>
967 {
968 std::size_t operator()(const NDEVR::String& s) const noexcept
969 {
970 return static_cast<size_t>(s.hash());
971 }
972 };
973 NDEVR_BASE_API istream& operator>>(istream& in, NDEVR::String& string);
974 NDEVR_BASE_API ostream& operator<<(ostream& in, const NDEVR::String& string);
975};
#define NDEVR_BASE_API
Definition DLLInfo.h:57
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Buffer & operator=(const Buffer &buffer)
Definition Buffer.hpp:932
void add(t_type &&object)
Adds object to the end of the buffer.
Definition Buffer.hpp:186
void addAll(const Buffer< t_type, t_other_index_type, t_other_memory_allocator, t_other_memory_manager > &buffer)
Definition Buffer.hpp:243
void setSize(t_index_type new_size)
Definition Buffer.hpp:803
t_index_type indexOf(const t_type &element) const
Definition Buffer.hpp:559
void ensureCapacity(t_index_type new_capacity, bool ensure_not_greater=false, bool ensure_not_less=true)
Definition Buffer.hpp:519
Definition MemoryManager.h:261
The core String class for the NDEVR API.
Definition String.h:69
String(uint04 size, const char &value)
String Constructor creates a string of a size and fills it with a character.
Definition String.h:122
const char * c_str() const
Used to access the raw memory of this string.
uint08 hashLower() const
Creates a simple, quick hash of the object. See hash(const char* value) for details of the implementa...
uint04 indexOf(const char &sub_string) const
Given a substring specified by the input, returns the first index of that string, if it exists.
Definition String.h:204
String predictNextStringIncrement() const
Looks in the string for key markers that might be an index, and attempts to increment the index....
static String UTF16toUTF8(const wchar *unicode, uint04 &advance)
bool addUTF16CharAsUTF8(const wchar *unicode, uint04 &advance)
Converts a single unicode character at advance into UTF8 and appends it to the end of the String.
bool operator<(const String &value) const
bool hasSubString(const String &sub_string, bool ignore_case=false) const
Tests if this String contains the specified substring.
static bool AlphaNumericCompare(const String &left, const String &right)
Compares two strings given their alpha-numeric determined value.
uint04 fromHex() const
Converts a hex value into an unsigned 4 byte number.
String & addWhiteSpace(uint04 desired_string_size, uint04 desired_right_alignment_location=0, char whitespace=' ')
Used for formatting, will, if necessary, add white space so that the string becomes a certain length....
String & removeNonAlphaNumeric(bool remove_tab=true, bool remove_space=true, bool remove_new_line=true, bool remove_r=true, bool remove_numbers=false)
Removes any characters that aren't numbers or letters with other options available.
bool isNumeric() const
Checks to see if the string is a numeric string.
void splitString(const Buffer< char > &delimiter, Buffer< String, uint04, ObjectAllocator< false > > &strings, bool preserve_empty=true) const
Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given...
static constexpr uint08 hash(const char *value)
constexpr method to hash a value. Also provides the hashing method used throughout the API to hash st...
Definition String.h:801
bool operator==(const char *const value) const
Definition String.h:554
static String ToHex(char value)
Converts the memory of the given object into a hexidecimal string.
static constexpr uint04 str_len(const char *value)
constexpr method to get the length of a null-terminated string at compile time
Definition String.h:749
static String ConvertToCharString(uint04 number)
Converts a number into a char string. For example 0 will become 'A' and 27 will become 'AA'.
String(const t_type &value)
String Constructor that creates a string based off an object. To use this function an object must hav...
Definition String.h:132
String shortenString(uint04 size) const
Shortans the string to the max size provided. If string is longer, searches for an ideal place to ins...
String & formatNumberString(bool add_comma, uint04 decimals)
For a string representing a number, makes the decimals equal to the the provided value and adds comma...
size_t operator()() const
Definition String.h:613
String(const char *const string, uint04 size)
String Constructor char arrays when the size is known. Slightly faster than iterating over a null-ter...
String & operator=(String &&value) noexcept
Definition String.h:538
static wchar UTF8toUTF16(const char *utf8, uint04 &advance)
Converts a unicode null terminated string of chars into a UTF16 wchar and increments advance by the a...
uint04 indexOf(const char *sub_string, bool ignore_case=false, uint04 start_index=0) const
Given a substring specified by the input, returns the first index of that string, if it exists.
String substr(uint04 start, uint04 end) const
Creates a substring from a given start position, to the given end position, non-inclusive of the end ...
uint04 indexOf(const char *sub_string, char escape_char, bool ignore_case=false, uint04 start_index=0) const
Given a substring specified by the input, returns the first index of that string, if it exists.
bool isSameNoCase(const String &s) const
Checks whether two strings match in a case-insensitive way.
static String ToHex(const String &values)
Converts a string of any type of data (assumed to be binary) into a hex representation.
Definition String.h:712
bool operator==(const String &value) const
Definition String.h:543
bool hasSubString(const char *sub_string, bool ignore_case=false) const
Tests if this String contains the specified substring.
String()
Constructor used to create an empty String*.
String(const String &string)
Copy Constructor.
bool operator!=(const String &value) const
Definition String.h:591
String(String &&string) noexcept
Move contructor (No new memory allocation).
String & formatAsTitleString()
Formats the string to be a title, capitalizing important characters and replacing underscores with sp...
void addWChar(const wchar &object)
Converts a single unicode character UTF16 character into one or more UTF8 characters and appends them...
uint04 lastIndexOf(const char value, bool ignore_case=false) const
Given a value specified by the input, returns the last index of that char, if it exists.
bool operator==(const char(&string)[t_size])
Definition String.h:564
uint04 indexOf(const char &sub_string, uint04 start_pos) const
Given a substring specified by the input, returns the first index of that string, if it exists.
Definition String.h:213
void addUTF16AsUTF8(const wchar *unicode)
Converts a unicode null terminated string of UTF16 wchars into UTF8 and appends it to the end of the ...
String(const char *string)
String Constructor for null terminated array of chars.
Definition String.h:106
static constexpr uint04 str_len(const wchar *value)
constexpr method to get the UTF8 length of a null-terminated string at compile time
Definition String.h:764
String & trimWhiteSpace()
Trims any white space (tabs, spaces, etc) from the beginning and end of the string.
String substr(uint04 start) const
Creates a substring from a given start position, to the end of the string.
t_type getAs() const
Converts a string into an object. To use this function an object must have overwritten StringStream<t...
Definition String.h:143
String & replace(const String &sub_string, const String &replace_sub_string, bool ignore_case=false)
Replaces ALL instances of a given substring with the provided replacement.
String(const char(&string)[N])
String Constructor for static char arrays.
Definition String.h:89
String & formatNumberString(bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, char decimal='.', char comma=',')
Modifies the contents of this string, that represents a given number using the provided rules.
String & formatNumberString(uint04 decimals)
For a string representing a number, makes the decimals equal to the the provided value Example: Strin...
uint04 indexOf(const String &sub_string, bool ignore_case=false, uint04 start_index=0) const
Given a substring specified by the input, returns the first index of that string, if it exists.
String insertNewLines(uint04 max_line_size) const
Finds key areas to insert new lines such that the rows are at most, the length provided.
uint04 indexOf(const char *sub_string, bool ignore_case, uint04 start_index, uint04 size) const
Given a substring specified by the input, returns the first index of that string, if it exists.
static String ToHex(const Buffer< t_object, t_allocator, t_buff > &values)
Converts a buffer of objects into a hexidecimal string.
Definition String.h:697
String(const wchar(&string)[N])
String Constructor for static wchar arrays of UTF16 data.
Definition String.h:97
static String ToHex(uint01 value)
Converts the memory of the given object into a hexidecimal string.
Buffer< String, uint04, ObjectAllocator< false > > splitString(const Buffer< char > &delimiter, bool preserve_empty=true) const
Given multiple delimiter, breaks the string into subsections, returning an array of each subsection....
String & operator=(const String &value)
Definition String.h:532
static bool IsWhiteSpace(char s)
Checks whether a given character is a whitespace character or not.
String & replace(const Buffer< String, uint04, ObjectAllocator< false > > &sub_string, const Buffer< String, uint04, ObjectAllocator< false > > &replace_sub_string, bool ignore_case=false)
Replaces ALL instances of the given substrings with the provided replacements. This allows safe repla...
String & removeNonNumeric()
Removes anything that is not a number or decimal ('0'-'9' or .)
String toUpper() const
changes all lower case characters into upper case characters.
uint08 hashUpper() const
Creates a simple, quick hash of the object. See hash(const char* value) for details of the implementa...
static String ToHex(const Vector< t_size, t_type > &values)
Converts a vector into a hex representation.
Definition String.h:728
bool operator!=(const char *const value) const
Definition String.h:573
bool matchesWildcard(const String &pattern) const
Checks whether two strings match allowing '' to be used as a wildcard pattern. For example,...
String & append(const String &string)
Appends a string to the back of this string.
static TranslatedString DisplayString(const t_type &value)
Converts an object into a TranslatedString. To use this function an object must have overwritten Stri...
Definition TranslatedString.h:54
uint04 indexOf(const char &sub_string, uint04 start_pos, uint04 size) const
Given a substring specified by the input, returns the first index of that string, if it exists.
Definition String.h:224
bool operator!=(const char(&string)[t_size])
Definition String.h:583
static String NumberString(fltp08 value, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, char decimal='.', char comma=',')
Creates a string from a given number using the provided rules.
uint08 hash() const
Creates a simple, quick hash of the object. See hash(const char* value) for details of the implementa...
bool operator>(const String &value) const
String toLower() const
changes all upper case characters into lower case characters.
void splitString(char delimiter, Buffer< String, uint04, ObjectAllocator< false > > &strings, bool preserve_empty=true) const
Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given...
uint04 lastIndexOf(const char *sub_string, bool ignore_case=false) const
Given a substring specified by the input, returns the last index of that string, if it exists.
bool endsWith(const String &s, bool ignore_case=false) const
Tests if this String ends with the specified suffix.
Buffer< String, uint04, ObjectAllocator< false > > splitString(char delimiter, bool preserve_empty=true) const
Given a delimiter, breaks the string into subsections, returning an array of each subsection....
static std::enable_if< ObjectInfo< t_object >::Integer, String >::type ToHex(t_object value)
Converts the memory of the given object into a hexidecimal string.
Definition String.h:677
bool beginsWith(const String &s, bool ignore_case=false) const
Tests if this String starts with the specified prefix.
static void toString(const t_type &value, String &string)
Logic for converting an object to an NDEVR API String allowing it to be used automatically with the S...
static void fromString(const String &string, t_type &value)
Logic for converting an object from an NDEVR API String allowing it to be used automatically with get...
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:64
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
bool operator==(const char(&v1)[t_size], const String &v2)
Definition String.h:912
wchar_t wchar
Allias for wchar_t, a value that represents a character of two bytes in size.
Definition BaseValues.hpp:155
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
constexpr t_to rcast(t_from value)
Casts the given value. Is equivalent to reinterpret_cast except allows for the option of special case...
Definition BaseValues.hpp:403
String operator+(const String &string_a, const String &string_b)
Definition String.h:827
String & operator+=(String &string, const String &value)
Definition String.h:889
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:106
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Definition File.h:211
istream & operator>>(istream &in, NDEVR::String &string)
ostream & operator<<(ostream &in, const NDEVR::String &string)
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Iterates over a UTF8 encoded string and returns the values as UTF16.
Definition String.h:819
UTF8Iterator(const String &string)
const String & string
Definition String.h:823
uint04 m_position
Definition String.h:824