API Documentation
Loading...
Searching...
No Matches
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 software.
41
42 - Explicitly uses Unicode (UTF8)
43 - Easy functions for converting to anything (getAs<class>())
44 - Inherits faster Buffer class
45 *-----------------------------------------------------------------------------------------------**/
46 class String : public Buffer<char, uint04, ObjectAllocator<true>, BufferAllocator<char, uint04, true>>
47 {
48 public:
51 NDEVR_BASE_API String(String&& string) noexcept;
52
53 template<std::size_t N>
54 String(const char (&string)[N])
55 : Buffer(string, str_len(string))
56 {}
57 template<std::size_t N>
58 String(const wchar(&string)[N])
59 {
60 addUnicodeAsUTF8(string);
61 }
62 String(const char* string)
63 : Buffer(string, string == nullptr ? 0 : str_len(string))
64 {}
65 NDEVR_BASE_API String(const char* const string, uint04 size);
66
67 String(uint04 size, const char& value)
68 : Buffer(size, value)
69 {}
70
71 template<class t_type>
72 explicit String(const t_type& value)
73 {
75 }
76
77 // ----------------------------------------------------------------------------
78 // Tests if this starts with the specified prefix.
79 // ----------------------------------------------------------------------------
80 NDEVR_BASE_API bool beginsWith(const String& s, bool ignore_case = false) const;
81
82 // ----------------------------------------------------------------------------
83 // Tests if this ends with the specified postfix.
84 // ----------------------------------------------------------------------------
85 NDEVR_BASE_API bool endsWith(const String& s, bool ignore_case = false) const;
86
87 // ----------------------------------------------------------------------------
88 // Given a substtring specified by the input, returns the first index of that
89 // string, if it exists. If it does not exist, Math::getNull<uint04>() is
90 // returned. start_index specifies an index to begin checking at. All values
91 // prior to start_index will not be checked.
92 // ----------------------------------------------------------------------------
93 NDEVR_BASE_API uint04 indexOf(const String& sub_string, bool ignore_case = false, uint04 start_index = 0) const;
94 NDEVR_BASE_API uint04 indexOf(const char& sub_string) const { return Buffer::indexOf(sub_string); }
95 NDEVR_BASE_API uint04 indexOf(const char& sub_string, uint04 start_pos) const { return Buffer::indexOf(sub_string, start_pos); }
96 NDEVR_BASE_API uint04 indexOf(const char& sub_string, uint04 start_pos, uint04 size) const { return Buffer::indexOf(sub_string, start_pos, size); }
97 NDEVR_BASE_API uint04 indexOf(const char* sub_string, bool ignore_case = false, uint04 start_index = 0) const;
98 NDEVR_BASE_API uint04 indexOf(const char* sub_string, bool ignore_case, uint04 start_index, uint04 size) const;
99 NDEVR_BASE_API uint04 indexOf(const char* sub_string, char escape_char, bool ignore_case = false, uint04 start_index = 0) const;
100 NDEVR_BASE_API uint04 lastIndexOf(const char* sub_string, bool ignore_case = false) const;
101 NDEVR_BASE_API uint04 lastIndexOf(const char value, bool ignore_case = false) const;
102 NDEVR_BASE_API bool hasSubString(const String& sub_string, bool ignore_case = false) const;
103 NDEVR_BASE_API bool hasSubString(const char* sub_string, bool ignore_case = false) const;
104
105 NDEVR_BASE_API String& replace(const String& sub_string, const String& replace_sub_string, bool ignore_case = false);
106 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);
107
108 NDEVR_BASE_API Buffer<String, uint04, ObjectAllocator<false>> splitString(char delimiter, bool preserve_empty = true) const;
109 NDEVR_BASE_API Buffer<String, uint04, ObjectAllocator<false>> splitString(const Buffer<char>& delimiter, bool preserve_empty = true) const;
110 NDEVR_BASE_API void splitString(char delimiter, Buffer<String, uint04, ObjectAllocator<false>>& strings, bool preserve_empty = true) const;
111 NDEVR_BASE_API void splitString(const Buffer<char>& delimiter, Buffer<String, uint04, ObjectAllocator<false>>& strings, bool preserve_empty = true) const;
112
114
116 NDEVR_BASE_API const char* c_str() const;
117
118 NDEVR_BASE_API bool isSameNoCase(const String& s) const;
119 NDEVR_BASE_API bool matchesWildcard(const String& pattern) const;
124
125 NDEVR_BASE_API static bool AlphaNumericCompare(const String& left, const String& right);
126
127 template<class t_type>
128 static TranslatedString DisplayString(const t_type& value);
129
130 static constexpr uint04 str_len(const char* value)
131 {
132 const char* n_value = value;
133 for (; *n_value; ++n_value)
134 {}
135 return cast<uint04>(n_value - value);
136 }
137 static constexpr uint04 str_len(const wchar* value)
138 {
139 uint04 count = 0;
140 const wchar* n_value = value;
141 for (; *n_value; ++n_value)
142 {
143 if (*n_value < 0x80)
144 {
145 count += 1;
146 }
147 else if (*n_value < 0x800)
148 {
149 count += 2;
150 }
151 else
152 {
153 uint04 cp = (*n_value << 16);
154 ++n_value;
155 cp += *n_value;
156 if (cp < 0x10000)
157 count += 3;
158 else
159 count += 4;
160 }
161 }
162 return count;
163 }
164#if _MSC_VER
165#pragma warning( disable : 4307)
166#endif
167 static constexpr uint08 hash(const char* value)
168 {
169 uint08 hash_value = 5381U;
170 for (const char* n_value = value; *n_value; n_value++)
171 {
172 hash_value = ((hash_value << 5) + hash_value) + cast<uint08>(*n_value);
173 }
174 return hash_value;
175 }
176 operator uint08() const
177 {
178 return hash();
179 }
180 operator uint04() const
181 {
183 }
184 size_t operator()() const
185 {
186 return cast<size_t>(hash());
187 }
190 NDEVR_BASE_API static bool IsWhiteSpace(char s);
192 NDEVR_BASE_API String& addWhiteSpace(uint04 desired_string_size, uint04 desired_right_alignment_location = 0, char whitespace = ' ');
194 NDEVR_BASE_API String& formatNumberString(bool add_comma, uint04 decimals);
195 NDEVR_BASE_API String& formatNumberString(bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, char decimal = '.', char comma = ',');
196 NDEVR_BASE_API static String NumberString(fltp08 value, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, char decimal = '.', char comma = ',');
198
199 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);
203
205
207
209
214 NDEVR_BASE_API static String toHex(char value);
215 NDEVR_BASE_API static wchar UTF8toUnicode(const char* utf8, uint04& advance);
217 NDEVR_BASE_API bool addUnicodeCharAsUTF8(const wchar* unicode, uint04& advance);
218 NDEVR_BASE_API static String UnicodetoUTF8(const wchar* unicode, uint04& advance);
219
220 void addWChar(const wchar& object);
221
222 template<class t_object>
223 static typename std::enable_if<ObjectInfo<t_object>::Integer, String>::type toHex(t_object value)
224 {
225 String hex;
226 uint04 byte_size = cast<uint04>(sizeof(t_object));
227 hex.setSize(2 * byte_size);
228 for (uint04 i = 0; i < byte_size; i++)
229 {
230 String local_hex = toHex(rcast<uint01>(value % 256));
231 hex[2 * (byte_size - i - 1) + 0] = local_hex[0];
232 hex[2 * (byte_size - i - 1) + 1] = local_hex[1];
233 value /= cast<t_object>(256);
234 }
235 return hex;
236 }
237 template<class t_object, class t_allocator, class t_buff>
239 {
240 String hex;
241 hex.ensureCapacity(values.size() * 2 * sizeof(t_object));
242 for (uint04 i = 0; i < values.size(); i++)
243 {
244 hex += toHex(values[i]);
245 }
246 return hex;
247 }
248 static String toHex(const String& values)
249 {
250 String hex;
251 hex.ensureCapacity(values.size());
252 for (uint04 i = 0; i < values.size(); i++)
253 {
254 hex += toHex(values[i]);
255 }
256 return hex;
257 }
258 template<uint01 t_size, class t_type>
259 static String toHex(const Vector<t_size, t_type>& values)
260 {
261 String hex;
262 hex.ensureCapacity(cast<uint04>(t_size) * 2 * sizeof(t_type));
263 for (uint01 i = 0; i < t_size; i++)
264 {
265 hex += toHex(values[i]);
266 }
267 return hex;
268 }
269
270 String& operator=(const String& value)
271 {
272 Buffer::operator=(value);
273 return *this;
274 }
275
276 String& operator=(String&& value) noexcept
277 {
278 Buffer::operator=(std::move(value));
279 return *this;
280 }
281 bool operator==(const String& value) const
282 {
283 if(value.size() != size())
284 return false;
285 for(uint04 i = 0; i < size(); i++)
286 {
287 if(value[i] != (*this)[i])
288 return false;
289 }
290 return true;
291 }
292 bool operator==(const char* const value) const
293 {
294 for(uint04 i = 0; i < size(); i++)
295 {
296 if(value[i] != (*this)[i])
297 return false;
298 }
299 return value[size()] == '\0';//check if strings are same size
300 }
301 template<std::size_t t_size>
302 bool operator==(const char(&string)[t_size])
303 {
304 if(t_size <= size())
305 return false;
306 if(string[size()] != '\0')
307 return false;
308 return memcmp(string, begin(), sizeof(char) * size()) == 0;
309 }
310
311 bool operator!=(const char* const value) const
312 {
313 for(uint04 i = 0; i < size(); i++)
314 {
315 if(value[i] != (*this)[i])
316 return true;
317 }
318 return value[size()] != '\0';//check if strings are same size
319 }
320 template<std::size_t t_size>
321 bool operator!=(const char(&string)[t_size])
322 {
323 if(t_size <= size())
324 return true;
325 if(string[size()] != '\0')
326 return true;
327 return memcmp(string, begin(), sizeof(char) * size()) != 0;
328 }
329 bool operator!=(const String& value) const
330 {
331 if(value.size() != size())
332 return true;
333 for(uint04 i = 0; i < size(); i++)
334 {
335 if(value[i] != (*this)[i])
336 return true;
337 }
338 return false;//check if strings are same size
339 }
340 template <class t_type>
341 t_type getAs() const
342 {
343 t_type value;
345 return value;
346 }
347 NDEVR_BASE_API bool operator<(const String& value) const;
348 NDEVR_BASE_API bool operator>(const String& value) const;
349 private:
350 // The preprocessing function for Boyer Moore's bad character heuristic
351 static void BadCharHeuristic(const char* str, uint04 size, sint04 badchar[256], bool ignore_case);
352 static uint04 Search(const char* txt, const char* pat, uint04 size_m, uint04 size_n, bool ignore_case);
353 };
355 {
356 UTF8Iterator(const String& string);
358 protected:
361 };
362
363 inline String operator+(const String& string_a, const String& string_b)
364 {
365 String s;
366 s.ensureCapacity(string_a.size() + string_b.size());
367 s.addAll(string_a);
368 s.addAll(string_b);
369 return s;
370 }
371 inline String operator+(String&& v1, const String& v2)
372 {
373 v1.addAll(v2);
374 return std::move(v1);
375 }
376 inline String operator+(String&& v1, String&& v2)
377 {
378 v1.addAll(v2);
379 return std::move(v1);
380 }
381
382 inline String operator+(String&& v1, const char*& v2)
383 {
385 return std::move(v1);
386 }
387
388 inline String operator+(String&& v1, const char& v2)
389 {
390 v1.add(v2);
391 return std::move(v1);
392 }
393
394 inline String operator+(const String& v1, const char& v2)
395 {
396 String s(v1);
397 s.add(v2);
398 return s;
399 }
400
401 inline String operator+(const char*& v1, const String& v2)
402 {
403 String s;
405 s.ensureCapacity(v2.size() + size);
406 s.addAll(v1, size);
407 s.addAll(v2);
408 return s;
409 }
410
411 template<size_t t_size>
412 inline String operator+(String&& v1, const char(&v2)[t_size])
413 {
415 return std::move(v1);
416 }
417 template<size_t t_size>
418 inline String operator+(const String& v1, const char(&v2)[t_size])
419 {
420 String combined(v1);
421 combined.addAll(v2, cast<uint04>(String::str_len(v2)));
422 return combined;
423 }
424
425 inline String& operator+=(String& string, const String& value)
426 {
427 string.addAll(value);
428 return string;
429 }
430 template<size_t t_size>
431 inline String& operator+=(String& v1, const char(&v2)[t_size])
432 {
433 v1.addAll(v2);
434 return v1;
435 }
436
437 template<size_t t_size>
438 inline String operator+(const char(&v1)[t_size], const String& v2)
439 {
440 String s;
441 uint04 size = String::str_len(v1);
442 s.ensureCapacity(v2.size() + size);
443 s.addAll(v1, size);
444 s.addAll(v2);
445 return s;
446 }
447 template<size_t t_size>
448 inline bool operator==(const char(&v1)[t_size], const String& v2)
449 {
450 return v2 == v1;
451 }
452 inline bool operator==(const char*& v1, const String& v2)
453 {
454 return v2 == v1;
455 }
456 template<size_t t_size>
457 inline String operator+(const char(&v1)[t_size], String&& v2)
458 {
459 String s;
460 uint04 size = String::str_len(v1);
461 s.ensureCapacity(v2.size() + size);
462 s.addAll((char*)v1, size);
463 s.addAll(v2);
464 return s;
465 }
466 template<class t_to>
467 constexpr t_to cast(const String& value)
468 {
469 return static_cast<t_to>(value.getAs<t_to>());
470 }
471 template<>
472 struct ObjectInfo<String, false, true>
473 {
474 static const uint01 Dimensions = 0;
475 static const bool Vector = false;
476 static const bool Buffer = true;
477 static const bool Primitive = false;
478 static const bool Pointer = false;
479 static const bool Unsigned = false;
480 static const bool Float = false;
481 static const bool Integer = false;
482 static const bool Number = false;
483 static const bool Enum = false;
484 static const bool String = true;
485 static const bool Color = false;
486 static const bool Boolean = false;
487 static constexpr ObjectInfo<char, false, false> VectorSub() { return ObjectInfo<char, false, false>(); }
488 };
489
490 template<> inline const String Constant<String>::Invalid = String();
491 template<>
492 constexpr bool IsInvalid(const String& value)
493 {
494 return value.size() == 0;
495 }
496};
497
498
499namespace std//Define things to allow use within std libs
500{
501 template <>
502 struct hash<NDEVR::String>
503 {
504 std::size_t operator()(const NDEVR::String& s) const noexcept
505 {
506 return static_cast<size_t>(s.hash());
507 }
508 };
509 NDEVR_BASE_API istream& operator>>(istream& in, NDEVR::String& string);
510 NDEVR_BASE_API ostream& operator<<(ostream& in, const NDEVR::String& string);
511};
#define NDEVR_BASE_API
Definition DLLInfo.h:78
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:59
Buffer & operator=(const Buffer &buffer)
Definition Buffer.hpp:1653
void add(t_type &&object)
Definition Buffer.hpp:211
void addAll(const Buffer< t_type, t_other_index_type, t_other_memory_allocator, t_other_memory_manager > &buffer)
Definition Buffer.hpp:276
void setSize(t_index_type new_size)
Definition Buffer.hpp:1330
t_index_type indexOf(const t_type &element) const
Definition Buffer.hpp:864
void ensureCapacity(t_index_type new_capacity, bool ensure_not_greater=false, bool ensure_not_less=true)
Definition Buffer.hpp:770
Definition MemoryManager.h:261
The core String class for the software.
Definition String.h:47
String(uint04 size, const char &value)
Definition String.h:67
NDEVR_BASE_API String toLower() const
NDEVR_BASE_API bool hasSubString(const char *sub_string, bool ignore_case=false) const
NDEVR_BASE_API String & trimWhiteSpace()
NDEVR_BASE_API void splitString(const Buffer< char > &delimiter, Buffer< String, uint04, ObjectAllocator< false > > &strings, bool preserve_empty=true) const
NDEVR_BASE_API String & formatNumberString(bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, char decimal='.', char comma=',')
NDEVR_BASE_API uint04 lastIndexOf(const char *sub_string, bool ignore_case=false) const
static NDEVR_BASE_API String toHex(char value)
NDEVR_BASE_API uint04 indexOf(const char *sub_string, bool ignore_case=false, uint04 start_index=0) const
static NDEVR_BASE_API bool IsWhiteSpace(char s)
NDEVR_BASE_API Buffer< String, uint04, ObjectAllocator< false > > splitStringLength(uint04 max_chars_per_line) const
static NDEVR_BASE_API String UnicodetoUTF8(const wchar *unicode, uint04 &advance)
NDEVR_BASE_API String formatTitleString() const
NDEVR_BASE_API String shortenString(uint04 size) const
NDEVR_BASE_API uint04 indexOf(const String &sub_string, bool ignore_case=false, uint04 start_index=0) const
NDEVR_BASE_API String & append(const String &string)
NDEVR_BASE_API void splitString(char delimiter, Buffer< String, uint04, ObjectAllocator< false > > &strings, bool preserve_empty=true) const
NDEVR_BASE_API String substr(uint04 start) const
NDEVR_BASE_API String toUpper() const
static constexpr uint08 hash(const char *value)
Definition String.h:167
bool operator==(const char *const value) const
Definition String.h:292
NDEVR_BASE_API bool matchesWildcard(const String &pattern) const
static constexpr uint04 str_len(const char *value)
Definition String.h:130
String(const t_type &value)
Definition String.h:72
NDEVR_BASE_API String & removeNonNumeric()
size_t operator()() const
Definition String.h:184
NDEVR_BASE_API bool operator<(const String &value) const
NDEVR_BASE_API bool beginsWith(const String &s, bool ignore_case=false) const
NDEVR_BASE_API uint04 lastIndexOf(const char value, bool ignore_case=false) const
NDEVR_BASE_API uint08 hashUpper() const
NDEVR_BASE_API uint04 indexOf(const char &sub_string, uint04 start_pos, uint04 size) const
Definition String.h:96
String & operator=(String &&value) noexcept
Definition String.h:276
NDEVR_BASE_API String & replace(const String &sub_string, const String &replace_sub_string, bool ignore_case=false)
static String toHex(const String &values)
Definition String.h:248
NDEVR_BASE_API bool hasSubString(const String &sub_string, bool ignore_case=false) const
NDEVR_BASE_API uint04 indexOf(const char *sub_string, bool ignore_case, uint04 start_index, uint04 size) const
bool operator==(const String &value) const
Definition String.h:281
static String toHex(const Buffer< t_object, t_allocator, t_buff > &values)
Definition String.h:238
bool operator!=(const String &value) const
Definition String.h:329
NDEVR_BASE_API uint08 hashLower() const
NDEVR_BASE_API String()
NDEVR_BASE_API Buffer< String, uint04, ObjectAllocator< false > > splitString(char delimiter, bool preserve_empty=true) const
void addWChar(const wchar &object)
NDEVR_BASE_API String & formatNumberString(bool add_comma, uint04 decimals)
static std::enable_if< ObjectInfo< t_object >::Integer, String >::type toHex(t_object value)
Definition String.h:223
bool operator==(const char(&string)[t_size])
Definition String.h:302
NDEVR_BASE_API uint04 indexOf(const char &sub_string, uint04 start_pos) const
Definition String.h:95
static NDEVR_BASE_API bool AlphaNumericCompare(const String &left, const String &right)
NDEVR_BASE_API String(String &&string) noexcept
NDEVR_BASE_API String & formatNumberString(uint04 decimals)
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)
String(const char *string)
Definition String.h:62
static constexpr uint04 str_len(const wchar *value)
Definition String.h:137
static NDEVR_BASE_API wchar UTF8toUnicode(const char *utf8, uint04 &advance)
t_type getAs() const
Definition String.h:341
static String toHex(const Vector< t_size, t_type > &values)
Definition String.h:259
String(const char(&string)[N])
Definition String.h:54
NDEVR_BASE_API bool isNumeric() const
static NDEVR_BASE_API String ConvertToCharString(uint04 number)
NDEVR_BASE_API bool isSameNoCase(const String &s) const
static NDEVR_BASE_API String NumberString(fltp08 value, bool add_comma, uint04 min_decimals, uint04 max_decimals, uint04 min_digits, char decimal='.', char comma=',')
NDEVR_BASE_API void addUnicodeAsUTF8(const wchar *unicode)
String(const wchar(&string)[N])
Definition String.h:58
NDEVR_BASE_API String substr(uint04 start, uint04 end) const
String & operator=(const String &value)
Definition String.h:270
static NDEVR_BASE_API String toHex(uint01 value)
NDEVR_BASE_API uint04 fromHex() const
bool operator!=(const char *const value) const
Definition String.h:311
NDEVR_BASE_API bool addUnicodeCharAsUTF8(const wchar *unicode, uint04 &advance)
NDEVR_BASE_API const char * c_str() const
NDEVR_BASE_API Buffer< String, uint04, ObjectAllocator< false > > splitStringLength(fltp04 length, fltp04(&font_width)[256]) const
static TranslatedString DisplayString(const t_type &value)
Definition TranslatedString.h:54
NDEVR_BASE_API String insertNewLines(uint04 max_line_size) const
NDEVR_BASE_API String predictNextStringIncrement() const
NDEVR_BASE_API bool operator>(const String &value) const
bool operator!=(const char(&string)[t_size])
Definition String.h:321
NDEVR_BASE_API bool endsWith(const String &s, bool ignore_case=false) const
NDEVR_BASE_API uint04 indexOf(const char &sub_string) const
Definition String.h:94
NDEVR_BASE_API Buffer< String, uint04, ObjectAllocator< false > > splitString(const Buffer< char > &delimiter, bool preserve_empty=true) const
NDEVR_BASE_API String & addWhiteSpace(uint04 desired_string_size, uint04 desired_right_alignment_location=0, char whitespace=' ')
NDEVR_BASE_API uint08 hash() const
NDEVR_BASE_API uint04 indexOf(const char *sub_string, char escape_char, bool ignore_case=false, uint04 start_index=0) const
NDEVR_BASE_API String(const String &string)
NDEVR_BASE_API String(const char *const string, uint04 size)
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)
static void toString(const t_type &value, String &string)
static void fromString(const String &string, t_type &value)
Any text displayed to the user should be defined as a TranslatedString which allows the.
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:62
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:177
bool operator==(const char(&v1)[t_size], const String &v2)
Definition String.h:448
wchar_t wchar
Allias for wchar_t, a value that represents a character of two bytes in size.
Definition BaseValues.hpp:151
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:125
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:78
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:400
String operator+(const String &string_a, const String &string_b)
Definition String.h:363
String & operator+=(String &string, const String &value)
Definition String.h:425
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:104
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:94
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:379
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:146
Definition File.h:210
NDEVR_BASE_API ostream & operator<<(ostream &in, const NDEVR::String &string)
NDEVR_BASE_API istream & operator>>(istream &in, NDEVR::String &string)
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved.
Definition BaseValues.hpp:230
Definition String.h:355
UTF8Iterator(const String &string)
const String & string
Definition String.h:359
uint04 m_position
Definition String.h:360