NDEVR
API Documentation
StringView.h
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/ObjectInfo.h>
36#include <NDEVR/StringStream.h>
37namespace NDEVR
38{
39 class String;
42 typedef AlocatingAlignedBuffer<String, sizeof(char*) == 4 ? 8 : 16> StringBuffer;
58 {
59 public:
60 friend class UTF8Iterator;
64 constexpr StringView()
65 {}
66
70 constexpr StringView(StringView&& other) noexcept
71 : m_start(other.m_start)
72 , m_size(other.m_size)
73 {}
74
78 constexpr StringView(const StringView& other) noexcept
79 : m_start(other.m_start)
80 , m_size(other.m_size)
81 {}
82
86 template<std::size_t N>
87 constexpr StringView(const char(&string)[N])
88 : StringView(string, str_len(string))
89 {}
90
95 constexpr StringView(const char* string)
96 : StringView(string, string == nullptr ? 0 : str_len(string))
97 {
98 }
99
105 constexpr StringView(const char* const string, uint04 size)
106 : m_start(string)
107 , m_size(size)
108 {
109 //lib_assert(!contains('\0'), "Bad string");
110 }
111
113 explicit StringView(String&& s) = delete;
118 explicit NDEVR_BASE_API constexpr StringView(const String& s);
124 template <class t_type>
125 [[nodiscard]] t_type getAs() const
126 {
127 t_type value;
129 return value;
130 }
131
137 NDEVR_BASE_API bool beginsWith(const StringView& s, bool ignore_case = false) const;
138
145 NDEVR_BASE_API bool endsWith(const StringView& s, bool ignore_case = false) const;
146
153 NDEVR_BASE_API bool hasSubString(const StringView& sub_string, bool ignore_case = false, uint04 initial_index = 0) const;
154
155
164 NDEVR_BASE_API uint04 indexOf(const StringView& sub_string, bool ignore_case = false, uint04 start_index = 0) const;
172 template<size_t t_size>
173 inline uint04 indexOf(const char(&value)[t_size], bool ignore_case, uint04 start_index = 0) const
174 {
175 StringView view(value, StringView::str_len(value));
176 return indexOf(view, ignore_case, start_index);
177 }
178
184 NDEVR_BASE_API uint04 indexOf(const char& sub_string) const;
185
193 NDEVR_BASE_API uint04 indexOf(const char& sub_string, uint04 start_pos) const;
194
204 NDEVR_BASE_API uint04 indexOf(const char& sub_string, uint04 start_pos, uint04 size) const;
205
216 NDEVR_BASE_API uint04 indexOf(const char* sub_string, bool ignore_case, uint04 start_index, uint04 size) const;
226 NDEVR_BASE_API uint04 indexOf(const char* sub_string, char escape_char, bool ignore_case = false, uint04 start_index = 0) const;
227
235 NDEVR_BASE_API uint04 lastIndexOf(const char* sub_string, bool ignore_case = false) const;
236
244 NDEVR_BASE_API uint04 lastIndexOf(const char value, bool ignore_case = false) const;
245
258 NDEVR_BASE_API StringViewBuffer split(char delimiter, bool preserve_empty = true) const;
259
266 NDEVR_BASE_API StringView splitPart(char delimiter, uint04 index) const;
277 NDEVR_BASE_API StringViewBuffer split(const Buffer<char>& delimiter, bool preserve_empty = true) const;
278
287 NDEVR_BASE_API void splitString(char delimiter, StringViewBuffer& strings, bool preserve_empty = true) const;
288
297 NDEVR_BASE_API void splitString(const Buffer<char>& delimiter, StringViewBuffer& strings, bool preserve_empty = true) const;
298
299
305 NDEVR_BASE_API bool isSameNoCase(const StringView& s) const;
306
313 NDEVR_BASE_API bool matchesWildcard(const StringView& pattern) const;
314
320 [[nodiscard]] constexpr const char& operator[](const uint04 idx) const
321 {
322 return m_start[idx];
323 }
324
330 NDEVR_BASE_API constexpr uint08 hash() const
331 {
332 uint08 hash = 5381;//random number
333 for (uint04 i = 0; i < size(); i++)//while string is not null
334 hash = ((hash << 5) + hash) + cast<sint04>((*this)[i]); // hash * 33 + c
335 return hash;
336 }
337
342 static constexpr uint08 hash(const char* value)
343 {
344 uint08 hash_value = 5381U;
345 for (const char* n_value = value; *n_value; n_value++)
346 {
347 hash_value = ((hash_value << 5) + hash_value) + cast<uint08>(*n_value);
348 }
349 return hash_value;
350 }
351
356 NDEVR_BASE_API constexpr uint08 hashUpper() const
357 {
358 uint08 hash = 5381;
359 for (uint04 i = 0; i < size(); i++)//while string is not null
360 {
361 char upper = cast<char>(toupper((*this)[i]));
362 hash = ((hash << 5) + hash) + cast<sint04>(upper); // hash * 33 + c
363 }
364 return hash;
365 }
366
372 NDEVR_BASE_API constexpr uint08 hashLower() const
373 {
374 uint08 hash = 5381;
375 for (uint04 i = 0; i < size(); i++)//while string is not null
376 hash = ((hash << 5) + hash) + cast<sint04>(tolower((*this)[i])); // hash * 33 + c
377 return hash;
378 }
379
384 NDEVR_BASE_API StringView substr(uint04 start) const;
392 NDEVR_BASE_API StringView substr(uint04 start, uint04 end) const;
393
398 NDEVR_BASE_API uint04 fromHex() const;
399
413 NDEVR_BASE_API StringAllocatingView insertNewLines(uint04 max_line_size) const;
420 NDEVR_BASE_API String predictNextStringIncrement() const;
425 NDEVR_BASE_API StringAllocatingView toUpper() const;
430 NDEVR_BASE_API StringAllocatingView toLower() const;
435 constexpr uint04 size() const
436 {
437 return m_size;
438 }
439
445 static NDEVR_BASE_API StringViewBuffer Convert(const StringBuffer& strings);
447 static void Convert(StringBuffer&& strings) = delete;
453 static NDEVR_BASE_API StringBuffer Convert(const StringViewBuffer& views);
454
459 NDEVR_BASE_API String toTitleString() const;
460
465 NDEVR_BASE_API bool isNumeric() const;
471 NDEVR_BASE_API bool operator==(const String& value) const;
477 NDEVR_BASE_API bool operator!=(const String& value) const;
483 constexpr bool operator==(const StringView& value) const
484 {
485 if (value.size() != size())
486 return false;
487 for (uint04 i = 0; i < size(); i++)
488 {
489 if (value[i] != (*this)[i])
490 return false;
491 }
492 return true;
493 }
494
499 constexpr bool operator==(const char* const value) const
500 {
501 for (uint04 i = 0; i < size(); i++)
502 {
503 if (value[i] != (*this)[i])
504 return false;
505 }
506 return value[size()] == '\0';//check if strings are same size
507 }
508
513 template<std::size_t t_size>
514 constexpr bool operator==(const char(&string)[t_size])
515 {
516 if (t_size <= size())
517 return false;
518 for (uint04 i = 0; i < size(); i++)
519 {
520 if (string[i] != (*this)[i])
521 return false;
522 }
523 return string[size()] == '\0';
524 }
525
531 constexpr bool operator!=(const char* const value) const
532 {
533 for (uint04 i = 0; i < size(); i++)
534 {
535 if (value[i] != (*this)[i])
536 return true;
537 }
538 return value[size()] != '\0';//check if strings are same size
539 }
540
545 template<std::size_t t_size>
546 constexpr bool operator!=(const char(&string)[t_size])
547 {
548 if (t_size <= size())
549 return true;
550 if (string[size()] != '\0')
551 return true;
552 return memcmp(string, begin(), sizeof(char) * size()) != 0;
553 }
554
559 constexpr bool operator!=(const StringView& value) const
560 {
561 if (value.size() != size())
562 return true;
563 for (uint04 i = 0; i < size(); i++)
564 {
565 if (value[i] != (*this)[i])
566 return true;
567 }
568 return false;//check if strings are same size
569 }
570
575 constexpr StringView& operator=(const StringView& value)
576 {
577 m_size = value.size();
578 m_start = value.m_start;
579 return *this;
580 }
581
586 NDEVR_BASE_API StringView& operator=(const String& value);
588 StringView& operator=(String&& value) = delete;
594 template<std::size_t t_size>
595 constexpr StringView& operator=(const char(&string)[t_size])
596 {
597 m_size = str_len(string);
598 m_start = string;
599 return *this;
600 }
601
606 constexpr StringView& operator=(const char* value)
607 {
608 m_size = str_len(value);
609 m_start = value;
610 return *this;
611 }
612
617 NDEVR_BASE_API bool operator<(const StringView& value) const;
623 NDEVR_BASE_API bool operator>(const StringView& value) const;
629 NDEVR_BASE_API bool isLessNoCase(const StringView& other) const;
635 NDEVR_BASE_API bool isGreaterNoCase(const StringView& other) const;
640 [[nodiscard]] constexpr const char* begin() const
641 {
642 return m_start;
643 }
644
649 [[nodiscard]] constexpr const char* begin(uint04 idx_offset) const
650 {
651 return m_start + idx_offset;
652 }
653
657 [[nodiscard]] constexpr const char* end() const
658 {
659 return m_start + m_size;
660 }
661
666 [[nodiscard]] constexpr bool contains(char c) const
667 {
668 for (const char& iter : *this)
669 {
670 if (iter == c)
671 return true;
672 }
673 return false;
674 }
675
680 [[nodiscard]] NDEVR_BASE_API uint04 count(char c) const;
685 NDEVR_BASE_API StringView& trimWhiteSpace();
690 NDEVR_BASE_API void removeLast(uint04 count = 1);
695 NDEVR_BASE_API void removeFirst(uint04 count = 1);
700 [[nodiscard]] NDEVR_BASE_API char last() const;
705 bool isNullTerminated() const;
710 NDEVR_BASE_API void ensureNullTerminated(String& s);
711 public:
716 NDEVR_BASE_API static bool AlphaNumericCompare(const StringView& left, const StringView& right);
717
723 static constexpr uint04 str_len(const char* value)
724 {
725 const char* n_value = value;
726 for (; *n_value; ++n_value)
727 {
728 }
729 return cast<uint04>(n_value - value);
730 }
731
738 static constexpr uint04 str_len(const wchar* value)
739 {
740 uint04 count = 0;
741 const wchar* n_value = value;
742 for (; *n_value; ++n_value)
743 {
744 if (*n_value < 0x80)
745 {
746 count += 1;
747 }
748 else if (*n_value < 0x800)
749 {
750 count += 2;
751 }
752 else
753 {
754 uint04 cp = (*n_value << 16);
755 ++n_value;
756 cp += *n_value;
757 if (cp < 0x10000)
758 count += 3;
759 else
760 count += 4;
761 }
762 }
763 return count;
764 }
765
770 {
771 m_size += size;
772 }
773 protected:
774 const char* m_start = nullptr;
776 };
777 template<> inline const StringView Constant<StringView>::Invalid = StringView();
783 template<>
784 constexpr bool IsInvalid(const StringView& value)
785 {
786 return value.size() == 0;
787 }
788
793 template<>
794 constexpr bool IsValid(const StringView& value)
795 {
796 return value.size() > 0;
797 }
798
801 template<>
802 struct ObjectInfo<StringView, false, false>
803 {
804 static const uint01 Dimensions = 0;
805 static const bool Vector = false;
806 static const bool Buffer = false;
807 static const bool Primitive = true;
808 static const bool Pointer = false;
809 static const bool Unsigned = false;
810 static const bool Float = false;
811 static const bool Integer = false;
812 static const bool Number = false;
813 static const bool Enum = false;
814 static const bool String = true;
815 static const bool Color = false;
816 static const bool Boolean = false;
822 };
823
826 class NDEVR_BASE_API UTF8Iterator
827 {
828 public:
833 UTF8Iterator(const StringView& string);
844 uint04 location(const StringView& original_string) const;
845 protected:
847 };
848}
849namespace std//Define things to allow use within std libs
850{
854 template<>
855 struct equal_to<NDEVR::StringView>
856 {
857 using is_transparent = std::true_type;
858 bool operator()(const StringView& a, const String& b) const { return a == b; }
859 bool operator()(const StringView& a, const StringView& b) const { return a == b; }
860 bool operator()(const StringView& a, const char* b) const { return a == b; }
861 template<std::size_t N>
862 bool operator()(const StringView& a, const char(&b)[N]) { return a == b; }
863 template<std::size_t N>
864 bool operator()(const char(&a)[N], const StringView& b) { return a == b; }
865 };
869 template <>
870 struct hash<StringView>
871 {
872 using is_transparent = std::true_type;
873 constexpr size_t operator()(const StringView& s) const noexcept
874 {
875 return static_cast<size_t>(s.hash());
876 }
877 constexpr size_t operator()(const char* s) const noexcept
878 {
879 return static_cast<size_t>(StringView::hash(s));
880 }
881 NDEVR_BASE_API size_t operator()(const String& s) const;
882 template<size_t N>
883 constexpr size_t operator()(const char(&s)[N]) const noexcept
884 {
885 return static_cast<size_t>(StringView::hash(s));
886 }
887 };
894 NDEVR_BASE_API istream& operator>>(istream& in, String& string);
901 NDEVR_BASE_API ostream& operator<<(ostream& in, const String& string);
902};
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
This class is like a string view, but may optionally store the data internally Useful if the return t...
Definition String.h:1278
static void fromString(const StringView &string, t_type &value)
Logic for converting an object from an NDEVR API String allowing it to be used automatically with get...
The core String View class for the NDEVR API.
Definition StringView.h:58
StringView substr(uint04 start) const
Creates a substring from a given start position, to the end of the string.
bool isSameNoCase(const StringView &s) const
Checks whether two strings match in a case-insensitive way.
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.
constexpr bool operator==(const char *const value) const
Checks equality with a null-terminated C string.
Definition StringView.h:499
String predictNextStringIncrement() const
Looks in the string for key markers that might be an index, and attempts to increment the index.
char last() const
Returns the last character in the string view.
static constexpr uint04 str_len(const char *value)
constexpr method to get the length of a null-terminated string at compile time
Definition StringView.h:723
bool beginsWith(const StringView &s, bool ignore_case=false) const
Tests if this String starts with the specified prefix.
bool matchesWildcard(const StringView &pattern) const
Checks whether two strings match allowing '' to be used as a wildcard pattern.
bool operator==(const String &value) const
Checks equality with a String object.
static bool AlphaNumericCompare(const StringView &left, const StringView &right)
Compares two strings given their alpha-numeric determined value.
constexpr const char * end() const
Returns a pointer to one past the last character of the string data.
Definition StringView.h:657
constexpr uint08 hashUpper() const
Creates a simple, quick hash of the object.
Definition StringView.h:356
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 isLessNoCase(const StringView &other) const
Case-insensitive less-than comparison.
constexpr bool operator==(const char(&string)[t_size])
Checks equality with a static char array.
Definition StringView.h:514
String toTitleString() const
Formats the string to be a title, capitalizing important characters and replacing underscores with sp...
constexpr bool operator!=(const char *const value) const
Checks inequality with a null-terminated C string.
Definition StringView.h:531
bool isNullTerminated() const
Checks whether the underlying string data is null terminated.
const char * m_start
Pointer to the beginning of the string data.
Definition StringView.h:774
constexpr StringView(const char *string)
String Constructor for null terminated array of chars.
Definition StringView.h:95
constexpr StringView & operator=(const char(&string)[t_size])
Assignment operator from a static char array.
Definition StringView.h:595
constexpr uint08 hashLower() const
Creates a simple, quick hash of the object.
Definition StringView.h:372
constexpr StringView()
Constructor used to create an empty StringView.
Definition StringView.h:64
void splitString(const Buffer< char > &delimiter, StringViewBuffer &strings, bool preserve_empty=true) const
Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given...
bool operator!=(const String &value) const
Checks inequality with a String object.
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.
StringView(String &&s)=delete
Deleted move constructor from String to prevent dangling views.
void removeLast(uint04 count=1)
Removes the specified number of characters from the end of the view.
constexpr const char * begin(uint04 idx_offset) const
Returns a pointer offset from the beginning of the string data.
Definition StringView.h:649
constexpr const char * begin() const
Returns a pointer to the beginning of the string data.
Definition StringView.h:640
StringAllocatingView shortenString(uint04 size) const
Shortans the string to the max size provided.
constexpr StringView(const char(&string)[N])
String Constructor for static char arrays.
Definition StringView.h:87
constexpr bool operator!=(const char(&string)[t_size])
Checks inequality with a static char array.
Definition StringView.h:546
constexpr StringView(const StringView &other) noexcept
Copy constructor for StringView.
Definition StringView.h:78
constexpr StringView & operator=(const char *value)
Assignment operator from a null-terminated C string.
Definition StringView.h:606
static StringViewBuffer Convert(const StringBuffer &strings)
Converts a StringBuffer into a StringViewBuffer.
bool hasSubString(const StringView &sub_string, bool ignore_case=false, uint04 initial_index=0) const
Tests if this String contains the specified substring.
constexpr const char & operator[](const uint04 idx) const
Accesses the character at the given index.
Definition StringView.h:320
bool isNumeric() const
Checks to see if the string is a numeric string.
uint04 m_size
The byte length of the string view.
Definition StringView.h:775
void splitString(char delimiter, StringViewBuffer &strings, bool preserve_empty=true) const
Given multiple delimiter, breaks the string into subsections, and APPENDS each substring to the given...
StringView & operator=(const String &value)
Assignment operator from a String object.
uint04 indexOf(const char(&value)[t_size], bool ignore_case, uint04 start_index=0) const
Template overload of indexOf for static char arrays.
Definition StringView.h:173
uint04 indexOf(const StringView &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.
constexpr StringView & operator=(const StringView &value)
Copy assignment operator from another StringView.
Definition StringView.h:575
uint04 count(char c) const
Counts the number of occurrences of the given character.
constexpr uint08 hash() const
Creates a simple, quick hash of the object.
Definition StringView.h:330
static constexpr uint08 hash(const char *value)
constexpr method to hash a value.
Definition StringView.h:342
StringAllocatingView toLower() const
changes all upper case characters into lower case characters.
StringView & operator=(String &&value)=delete
Deleted move assignment from String to prevent dangling views.
StringViewBuffer split(char delimiter, bool preserve_empty=true) const
Given a delimiter, breaks the string into subsections, returning an array of each subsection.
bool operator>(const StringView &value) const
Greater-than comparison operator using lexicographic ordering.
constexpr StringView(StringView &&other) noexcept
Move constructor for StringView.
Definition StringView.h:70
constexpr bool contains(char c) const
Checks whether the string view contains the given character.
Definition StringView.h:666
StringView substr(uint04 start, uint04 end) const
Creates a substring from a given start position, to the given end position, non-inclusive of the end ...
void addToSize(uint04 size)
Increases the reported size of the string view by the given amount.
Definition StringView.h:769
constexpr StringView(const char *const string, uint04 size)
String Constructor char arrays when the size is known.
Definition StringView.h:105
StringView & trimWhiteSpace()
Trims leading and trailing whitespace from the string view.
t_type getAs() const
Converts a string into an object.
Definition StringView.h:125
constexpr bool operator==(const StringView &value) const
Checks equality with another StringView.
Definition StringView.h:483
void removeFirst(uint04 count=1)
Removes the specified number of characters from the beginning of the view.
StringView splitPart(char delimiter, uint04 index) const
Returns a single part from splitting the string by the given delimiter.
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.
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.
bool endsWith(const StringView &s, bool ignore_case=false) const
Tests if this String ends with the specified suffix.
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.
void ensureNullTerminated(String &s)
This makes the string null terminated, if needed, using the provided string as the new buffer.
constexpr bool operator!=(const StringView &value) const
Checks inequality with another StringView.
Definition StringView.h:559
static constexpr uint04 str_len(const wchar *value)
constexpr method to get the UTF8 length of a null-terminated string at compile time
Definition StringView.h:738
static void Convert(StringBuffer &&strings)=delete
Deleted overload to prevent converting from rvalue StringBuffer which would create dangling views.
StringViewBuffer split(const Buffer< char > &delimiter, bool preserve_empty=true) const
Given multiple delimiter, breaks the string view into subsections, returning an array of each subsect...
StringAllocatingView insertNewLines(uint04 max_line_size) const
Finds key areas to insert new lines such that the rows are at most, the length provided.
bool isGreaterNoCase(const StringView &other) const
Case-insensitive greater-than comparison.
static StringBuffer Convert(const StringViewBuffer &views)
Converts a StringViewBuffer into a StringBuffer by copying each view into a String.
constexpr uint04 size() const
Returns the byte size of this string view.
Definition StringView.h:435
uint04 fromHex() const
Converts a hex value into an unsigned 4 byte number.
StringAllocatingView toUpper() const
changes all lower case characters into upper case characters.
bool operator<(const StringView &value) const
Less-than comparison operator using lexicographic ordering.
uint04 indexOf(const char &sub_string) const
Given a substring specified by the input, returns the first index of that string, if it exists.
The core String class for the NDEVR API.
Definition String.h:95
UTF8Iterator(const StringView &string)
Constructs a UTF8Iterator from a StringView.
wchar nextChar()
Reads and returns the next UTF16 character, advancing the iterator.
uint04 location(const StringView &original_string) const
Returns the current byte offset within the original string.
StringView string
The remaining portion of the string being iterated.
Definition StringView.h:846
The primary namespace for the NDEVR SDK.
static constexpr bool IsValid(const Angle< t_type > &value)
Checks whether the given Angle holds a valid value.
Definition Angle.h:398
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
static constexpr bool IsInvalid(const Angle< t_type > &value)
Checks whether the given Angle holds an invalid value.
Definition Angle.h:388
AlocatingAlignedBuffer< String, sizeof(char *)==4 ? 8 :16 > StringBuffer
A Buffer of String objects using aligned allocation optimized for pointer size.
Definition StringView.h:42
wchar_t wchar
Allias for wchar_t, a value that represents a character of two bytes in size.
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.
Definition Angle.h:408
STL namespace.
istream & operator>>(istream &in, StringView &string)
Stream extraction operator for reading into an StringView.
static const bool Primitive
Whether this type is a primitive.
Definition StringView.h:807
static const bool Vector
Whether this type is a vector.
Definition StringView.h:805
static const bool Float
Whether this type is a floating-point number.
Definition StringView.h:810
static const bool Enum
Whether this type is an enum.
Definition StringView.h:813
static const bool Boolean
Whether this type is a boolean.
Definition StringView.h:816
static const bool Integer
Whether this type is an integer.
Definition StringView.h:811
static const bool Pointer
Whether this type is a pointer.
Definition StringView.h:808
static const bool String
Whether this type is a string.
Definition StringView.h:814
static const bool Buffer
Whether this type is a buffer.
Definition StringView.h:806
static const uint01 Dimensions
Number of dimensions (0 for non-vector types).
Definition StringView.h:804
static const bool Number
Whether this type is numeric.
Definition StringView.h:812
static const bool Unsigned
Whether this type is unsigned.
Definition StringView.h:809
static constexpr ObjectInfo< char, false, false > VectorSub()
Returns the ObjectInfo for the underlying vector element type.
Definition StringView.h:821
static const bool Color
Whether this type is a color.
Definition StringView.h:815
Information about the object.
Definition ObjectInfo.h:55