#ifndef SDV_STRING_H #define SDV_STRING_H #include #include #include #include #include #include "iterator.h" #include "pointer.h" namespace sdv { /** * @brief Templated string class. * @tparam TCharType The character type that the class uses. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. */ template class string_base { public: /** * @brief Value type for this string class. */ using value_type = TCharType; /** * @brief Forward iterator class used by this string class. */ using iterator = internal::index_iterator, false, false>; /** * @brief Backward iterator class used by this string class. */ using reverse_iterator = internal::index_iterator, false, true>; /** * @brief Const forward iterator class used by this string class. */ using const_iterator = internal::index_iterator, true, false>; /** * @brief Const backward iterator class used by this string class. */ using const_reverse_iterator = internal::index_iterator, true, true>; /** * @brief Reference type of the element. */ using reference = TCharType&; /** * @brief Const reference type of the element. */ using const_reference = const TCharType&; /** * @brief Set when the type is a unicode type. */ static constexpr bool is_unicode = bUnicode; /** * @brief Declaration of npos. */ static constexpr size_t npos = static_cast(-1); /** * @brief Default constructor */ string_base() noexcept; /** * @brief Destructor */ ~string_base(); /** * @brief Copy constructor of same string type. * @param[in] rss Reference to the string to copy from. */ string_base(const string_base& rss); /** * @brief Copy constructor of other string types. * @tparam TCharType2 The character type that the provided string class uses. * @tparam bUnicode2 When set, the provided string is a unicode string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to copy from. */ template explicit string_base(const string_base& rss); /** * @brief Move constructor of same string type. * @param[in] rss Reference to the string to move the data from. */ string_base(string_base&& rss) noexcept; /** * @brief Move constructor of other string types. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to move the data from. */ template string_base(string_base&& rss); /** * @brief Constructor with C++ string assignment * @tparam TCharType2 The character type that the provided string class uses. * @param[in] rss Reference to the string to copy from. */ template string_base(const std::basic_string& rss); /** * @brief Constructor with zero terminated C string assignment * @param[in] szStr Pointer to zero terminated string. */ string_base(const TCharType* szStr); /** * @brief Construct a string consisting of nCount copies of character c. * @param[in] nCount Number of characters to insert. * @param[in] c The character to insert nCount times. */ string_base(size_t nCount, TCharType c); /** * @brief Construct a string from a substring starting at nPos. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference of the string to extract the substring from. * @param[in] nPos The position to start the substring. */ template string_base(const string_base& rss, size_t nPos); /** * @brief Construct a string from a substring starting at nPos. * @param[in] rss Reference of the string to extract the substring from. * @param[in] nPos The position to start the substring. */ string_base(const std::basic_string& rss, size_t nPos); /** * @brief Construct a string from a substring starting at nPos. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference of the string to extract the substring from. * @param[in] nPos The position to start the substring. * @param[in] nCount The amount of characters of the substring to include. */ template string_base(const string_base& rss, size_t nPos, size_t nCount); /** * @brief Construct a string from a substring starting at nPos. * @param[in] rss Reference of the string to extract the substring from. * @param[in] nPos The position to start the substring. * @param[in] nCount The amount of characters of the substring to include. */ string_base(const std::basic_string& rss, size_t nPos, size_t nCount); /** * @brief Construct a string with nCount characters. * @param[in] sz C-Style string. Can contain null characters. * @param[in] nCount The amount of characters to copy. */ string_base(const TCharType* sz, size_t nCount); /** * @brief Construct a string with the content of a range defined by two iterators. * @remarks Both iterators must point to the same string. * @tparam TIterator Iterator type to use. * @param[in] itFirst The iterator pointing to the first character. * @param[in] itLast The iterator pointing to the value past the last character. */ template string_base(TIterator itFirst, TIterator itLast); /** * @brief Construct a string from an initializer list. * @param[in] ilist Initializer list. */ string_base(std::initializer_list ilist); /** * @brief Assignment operator of same string type. * @param[in] rss Reference to the string to assign from. * @return Returns a reference to this object. */ string_base& operator=(const string_base& rss); /** * @brief Assignment operator of other string types. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to assign from. * @return Returns a reference to this object. */ template string_base& operator=(const string_base& rss); /** * @brief Move operator of same string type. * @param[in] rss Reference to the string to assign from. * @return Returns a reference to this object. */ string_base& operator=(string_base&& rss) noexcept; /** * @brief Move operator of other string types. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to assign from. * @return Returns a reference to this object. */ template string_base& operator=(string_base&& rss); /** * @brief Assignment operator with C++ string assignment * @param[in] rss Reference to the string to assign from. * @return Returns a reference to this object. */ string_base& operator=(const std::basic_string& rss); /** * @brief Assignment operator with zero terminated C string assignment * @param[in] szStr Pointer to zero terminated string. * @return Returns a reference to this object. */ string_base& operator=(const TCharType* szStr); /** * @brief Assignment operator with initializer list. * @param[in] ilist Initializer list * @return Returns a reference to this object. */ string_base& operator=(std::initializer_list ilist); /** * @brief Assign a string consisting of nCount copies of character c. * @param[in] nCount Number of characters to insert. * @param[in] c The character to insert nCount times. * @return Returns a reference to this object. */ string_base& assign(size_t nCount, TCharType c); /** * @brief Assign a copy of a string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to copy from. * @return Returns a reference to this object. */ template string_base& assign(const string_base& rss); /** * @brief Assign a copy of a C++ string. * @param[in] rss Reference to the string to copy from. * @return Returns a reference to this object. */ string_base& assign(const std::basic_string& rss); /** * @brief Assign a string from a substring starting at nPos. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference of the string to extract the substring from. * @param[in] nPos The position to start the substring. * @param[in] nCount The amount of characters of the substring to include. * @return Returns a reference to this object. */ template string_base& assign(const string_base& rss, size_t nPos, size_t nCount = npos); /** * @brief Assign a string from a substring starting at nPos. * @param[in] rss Reference of the string to extract the substring from. * @param[in] nPos The position to start the substring. * @param[in] nCount The amount of characters of the substring to include. * @return Returns a reference to this object. */ string_base& assign(const std::basic_string& rss, size_t nPos, size_t nCount = npos); /** * @brief Move the string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to move the data from. * @return Returns a reference to this object. */ template string_base& assign(string_base&& rss); /** * @brief Assign a string with nCount characters. * @param[in] sz C-Style string. Can contain null characters. * @param[in] nCount The amount of characters to copy. * @return Returns a reference to this object. */ string_base& assign(const TCharType* sz, size_t nCount); /** * @brief Assign with zero terminated C string assignment * @param[in] sz Pointer to zero terminated string. * @return Returns a reference to this object. */ string_base& assign(const TCharType* sz); /** * @brief Assign a string with the content of a range defined by two iterators. * @remarks Both iterators must point to the same string. * @tparam TIterator Iterator type to use. * @param[in] itFirst The iterator pointing to the first character. * @param[in] itLast The iterator pointing to the value past the last character. * @return Returns a reference to this object. */ template string_base& assign(TIterator itFirst, TIterator itLast); /** * @brief Assign a string from an initializer list. * @param[in] ilist Initializer list. * @return Returns a reference to this object. */ string_base& assign(std::initializer_list ilist); /** * @brief Return a reference to the character at the specified position. * @param[in] nPos The specified position. * @return Reference to the character. */ reference at(size_t nPos); /** * @brief Return a reference to the character at the specified position. * @param[in] nPos The specified position. * @return Reference to the character. */ const_reference at(size_t nPos) const; /** * @brief Return a reference to the character at the specified position. * @param[in] nPos The specified position. * @return Reference to the character. */ reference operator[](size_t nPos); /** * @brief Return a reference to the character at the specified position. * @param[in] nPos The specified position. * @return Reference to the character. */ const_reference operator[](size_t nPos) const; /** * @brief Return a reference to the first character. * @return Reference to the character. */ TCharType& front(); /** * @brief Return a reference to the first character. * @return Reference to the character. */ const TCharType& front() const; /** * @brief Return a reference to the last character. * @return Reference to the character. */ TCharType& back(); /** * @brief Return a reference to the last character. * @return Reference to the character. */ const TCharType& back() const; /** * @brief Cast operator for SDV strings. * @tparam TCharType2 The character type of the string to convert to. * @tparam bUnicode2 When set, the string to convert to is a unicode string. * @tparam nFixedSize2 The fixed size of the string to convert to. * @return Returns a SDV string object containing a copy of the string. */ template operator string_base() const; /** * @brief Cast operator for C++ strings. * @return Returns a C++ string object containing a copy of the string. */ operator std::basic_string() const; /** * @brief Access to the underlying data. * @remarks The underlying data might not be zero terminated. * @return Pointer to the string. */ const TCharType* data() const noexcept; /** * @brief Access to the buffer. * @return Returns reference to the internal buffer. */ pointer& buffer() noexcept; /** * @brief Return a pointer to a zero terminate string. * @return Pointer to the string. */ const TCharType* c_str() const noexcept; /** * @brief Return an iterator to the first character of the string. * @return Iterator to the first character of te string. */ iterator begin() noexcept; /** * @brief Return an iterator to the first character of the string. * @return Iterator to the first character of te string. */ const_iterator begin() const noexcept; /** * @brief Return a const iterator to the first character of the string. * @return Const iterator to the first character of te string. */ const_iterator cbegin() const noexcept; /** * @brief Return a reverse-iterator to the last character of the string. * @return Reverse iterator to the last character of te string. */ reverse_iterator rbegin() noexcept; /** * @brief Return a reverse-iterator to the last character of the string. * @return Reverse iterator to the last character of te string. */ const_reverse_iterator rbegin() const noexcept; /** * @brief Return a const reverse iterator to the last character of the string. * @return Const reverse iterator to the last character of te string. */ const_reverse_iterator crbegin() const noexcept; /** * @brief Return an iterator beyond the last character of the string. * @return Iterator beyond the last character of te string. */ iterator end() noexcept; /** * @brief Return an iterator beyond the last character of the string. * @return Iterator beyond the last character of te string. */ const_iterator end() const noexcept; /** * @brief Return a const beyond the last character of the string. * @return Const iterator beyond the last character of te string. */ const_iterator cend() const noexcept; /** * @brief Return a reverse iterator before the first character of the string. * @return Reverse iterator before the last character of te string. */ reverse_iterator rend() noexcept; /** * @brief Return a reverse iterator before the first character of the string. * @return Reverse iterator before the last character of te string. */ const_reverse_iterator rend() const noexcept; /** * @brief Return a const reverse iterator before the first character of the string. * @return Const reverse iterator before the last character of te string. */ const_reverse_iterator crend() const noexcept; /** * @brief Is the string empty? * @return Returns 'true' when the string is empty; 'false' when not. */ bool empty() const; /** * @brief Get the size of the string. * @remarks The length and the size for the string are equal. * @return The size of the string buffer. */ size_t size() const; /** * @brief Get the length of the string. * @remarks The length and the size for the string are equal. * @return The length of the string. */ size_t length() const; /** * @brief Reserve capacity for the string buffer. Additional buffer will be filled with zeros. * @remarks Reducing the capacity will have no effect. * @param[in] nNewCap The new capacity. */ void reserve(size_t nNewCap = 0); /** * @brief Get the current string capacity. * @remarks This will be the same as the length and size of the string. * @return The capacity of the current string. */ size_t capacity() const noexcept; /** * @brief Reduce the buffer to fit the string. * @remarks This function will have no effect. */ void shrink_to_fit(); /** * @brief Clear the string. */ void clear(); /** * @brief Insert nCount copies of character c at the position nIndex. * @param[in] nIndex The index at which to insert the characters. * @param[in] nCount Number of characters to insert. * @param[in] c The character to insert nCount times. * @return Reference to this string. */ string_base& insert(size_t nIndex, size_t nCount, TCharType c); /** * @brief Inserts zero-terminated character string pointed to by sz at the position nIndex. * @param[in] nIndex The index at which to insert the characters. * @param[in] sz Zero terminated string. * @return Reference to this string. */ string_base& insert(size_t nIndex, const TCharType* sz); /** * @brief Inserts nCount characters from the string at the position nIndex. * @param[in] nIndex The index at which to insert the characters. * @param[in] sz Zero terminated string. * @param[in] nCount Number of characters to insert. * @return Reference to this string. */ string_base& insert(size_t nIndex, const TCharType* sz, size_t nCount); /** * @brief Inserts string rss at the position nIndex. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] nIndex The index at which to insert the string. * @param[in] rss Reference to the string to insert. * @return Reference to this string. */ template string_base& insert(size_t nIndex, const string_base& rss); /** * @brief Inserts a sub-string starting at index nPos and with nCount character at the position nIndex * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] nIndex The index at which to insert the string. * @param[in] rss Reference to the string to insert. * @param[in] nPos Position of the first character in ss to insert. * @param[in] nCount Number of characters to insert. * @return Reference to this string. */ template string_base& insert(size_t nIndex, const string_base& rss, size_t nPos, size_t nCount = npos); /** * @brief Inserts C++ string_base ss at the position nIndex. * @param[in] nIndex The index at which to insert the string. * @param[in] rss Reference to the string to insert. * @return Reference to this string. */ string_base& insert(size_t nIndex, const std::basic_string& rss); /** * @brief Inserts a sub-string starting at index nPos and with nCount character at the position nIndex * @param[in] nIndex The index at which to insert the string. * @param[in] rss Reference to the string to insert. * @param[in] nPos Position of the first character in ss to insert. * @param[in] nCount Number of characters to insert. * @return Reference to this string. */ string_base& insert(size_t nIndex, const std::basic_string& rss, size_t nPos, size_t nCount = npos); /** * @brief Insert a character c at the position itPos. * @param[in] itPos Iterator pointing to the position to insert the characters. * @param[in] c The character to insert. * @return The iterator pointing to the inserted character. */ iterator insert(const_iterator itPos, TCharType c); /** * @brief Insert nCount copies of character c at the position itPos. * @param[in] itPos Iterator pointing to the position to insert the characters. * @param[in] nCount Number of characters to insert. * @param[in] c The character to insert nCount times. * @return The iterator pointing to the inserted character. */ iterator insert(const_iterator itPos, size_t nCount, TCharType c); /** * @brief Insert a string with the content of a range defined by two iterators. * @remarks Both iterators must point to the same string. * @tparam TIterator Iterator type to use. * @param[in] itPos Iterator pointing to the position to insert the characters. * @param[in] itFirst The iterator pointing to the first character. * @param[in] itLast The iterator pointing to the value past the last character. * @return The iterator pointing to the inserted string. */ template iterator insert(const_iterator itPos, TIterator itFirst, TIterator itLast); /** * @brief Insert a string from an initializer list. * @param[in] itPos Iterator pointing to the position to insert the characters. * @param[in] ilist Initializer list. * @return The iterator pointing to the inserted character. */ iterator insert(const_iterator itPos, std::initializer_list ilist); /** * @brief Remove characters at the provided position. * @param[in] nIndex The index at which to erase the characters. * @param[in] nCount Number of characters to erase. * @return Returns a reference to this object. */ string_base& erase(size_t nIndex = 0, size_t nCount = npos); /** * @brief Remove a character at the provided position. * @remarks The iterator must point to this string. * @param[in] itPos Iterator pointing to the position to erase the character from. * @return Iterator to the character following the erase character or end() when no more characters are available. */ iterator erase(const_iterator itPos); /** * @brief Remove al characters starting at itFirst until but not including itLast. * @remarks Both iterators must point to this string. * @param[in] itFirst The iterator pointing to the first character. * @param[in] itLast The iterator pointing to the value past the last character. * @return Iterator to the character following the erased characters or end() when no more characters are available. */ iterator erase(const_iterator itFirst, const_iterator itLast); /** * @brief Appends the given character to the end of the string. * @param[in] c The character to append. */ void push_back(TCharType c); /** * @brief Removes the last character from the string. */ void pop_back(); /** * @brief Append nCount copies of character c at the end of the string. * @param[in] nCount Number of characters to insert. * @param[in] c The character to append nCount times. * @return Reference to this string. */ string_base& append(size_t nCount, TCharType c); /** * @brief Append string rss at the end of the string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to insert. * @return Reference to this string. */ template string_base& append(const string_base& rss); /** * @brief Append string rss at the end of the string. * @param[in] rss Reference to the string to insert. * @return Reference to this string. */ string_base& append(const std::basic_string& rss); /** * @brief Append a sub-string starting at index nPos and with nCount character at the end of the string * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to insert. * @param[in] nPos Position of the first character in ss to insert. * @param[in] nCount Number of characters to insert. * @return Reference to this string. */ template string_base& append(const string_base& rss, size_t nPos, size_t nCount = npos); /** * @brief Append a sub-string starting at index nPos and with nCount character at the end of the string * @param[in] rss Reference to the string to insert. * @param[in] nPos Position of the first character in ss to insert. * @param[in] nCount Number of characters to insert. * @return Reference to this string. */ string_base& append(const std::basic_string& rss, size_t nPos, size_t nCount = npos); /** * @brief Append nCount characters from the string at the end of the string. * @param[in] sz Zero terminated string. * @param[in] nCount Number of characters to insert. * @return Reference to this string. */ string_base& append(const TCharType* sz, size_t nCount); /** * @brief Append the provided string at the end of the string. * @param[in] sz Zero terminated string. * @return Reference to this string. */ string_base& append(const TCharType* sz); /** * @brief Append a string with the content of a range defined by two iterators. * @remarks Both iterators must point to the same string. * @tparam TIterator Iterator type to use. * @param[in] itFirst The iterator pointing to the first character. * @param[in] itLast The iterator pointing to the value past the last character. * @return Reference to this string. */ template string_base& append(TIterator itFirst, TIterator itLast); /** * @brief Append a string from an initializer list. * @param[in] ilist Initializer list. * @return Reference to this string. */ string_base& append(std::initializer_list ilist); /** * @brief Append string rss at the end of the string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to insert. * @return Reference to this string. */ template string_base& operator+=(const string_base& rss); /** * @brief Append string rss at the end of the string. * @param[in] rss Reference to the string to insert. * @return Reference to this string. */ string_base& operator+=(const std::basic_string& rss); /** * @brief Append the character c at the end of the string. * @param[in] c The character to append. * @return Reference to this string. */ string_base& operator+=(TCharType c); /** * @brief Append the provided string at the end of the string. * @param[in] sz Zero terminated string. * @return Reference to this string. */ string_base& operator+=(const TCharType* sz); /** * @brief Append a string from an initializer list. * @param[in] ilist Initializer list. * @return Reference to this string. */ string_base& operator+=(std::initializer_list ilist); /** * @brief Compare two character sequences. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to compare this string with. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ template int compare(const string_base& rss) const noexcept; /** * @brief Compare two character sequences. * @param[in] rss Reference to the string to compare this string with. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ int compare(const std::basic_string& rss) const noexcept; /** * @brief Compare two character sequences. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] nPos1 Position of the first character in the string to compare. * @param[in] nCount1 Number if characters in this string to compare. * @param[in] rss Reference to the string to compare this string with. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ template int compare(size_t nPos1, size_t nCount1, const string_base& rss) const; /** * @brief Compare two character sequences. * @param[in] nPos1 Position of the first character in the string to compare. * @param[in] nCount1 Number if characters in this string to compare. * @param[in] rss Reference to the string to compare this string with. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ int compare(size_t nPos1, size_t nCount1, const std::basic_string& rss) const; /** * @brief Compare two character sequences. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] nPos1 Position of the first character in this string to compare. * @param[in] nCount1 Number if characters in this string to compare. * @param[in] rss Reference to the string to compare this string with. * @param[in] nPos2 Position of the first character in the provided string to compare. * @param[in] nCount2 Number if characters in the provided string to compare. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ template int compare(size_t nPos1, size_t nCount1, const string_base& rss, size_t nPos2, size_t nCount2 = npos) const; /** * @brief Compare two character sequences. * @param[in] nPos1 Position of the first character in this string to compare. * @param[in] nCount1 Number if characters in this string to compare. * @param[in] rss Reference to the string to compare this string with. * @param[in] nPos2 Position of the first character in the provided string to compare. * @param[in] nCount2 Number if characters in the provided string to compare. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ int compare(size_t nPos1, size_t nCount1, const std::basic_string& rss, size_t nPos2, size_t nCount2 = npos) const; /** * @brief Compare two character sequences. * @param[in] sz Pointer to the character string to compare. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ int compare(const TCharType* sz) const; /** * @brief Compare two character sequences. * @param[in] nPos1 Position of the first character in this string to compare. * @param[in] nCount1 Number if characters in this string to compare. * @param[in] sz Pointer to the character string to compare. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ int compare(size_t nPos1, size_t nCount1, const TCharType* sz) const; /** * @brief Compare two character sequences. * @param[in] nPos1 Position of the first character in this string to compare. * @param[in] nCount1 Number if characters in this string to compare. * @param[in] sz Pointer to the character string to compare. * @param[in] nCount2 Number if characters in the provided string to compare. * @return Is negative when the string contains characters of lesser lexicographical order; returns prositive when the * string contains characters of higher lexcicographical order; otherwise returns 0. */ int compare(size_t nPos1, size_t nCount1, const TCharType* sz, size_t nCount2) const; /** * @brief Replace characters with provided string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] nPos Position to replace characters. * @param[in] nCount Amount of characters to replace. * @param[in] rss Reference to the string to use for recplacement. * @return Reference to this string. */ template string_base& replace(size_t nPos, size_t nCount, const string_base& rss); /** * @brief Replace characters with provided string. * @param[in] nPos Position to replace characters. * @param[in] nCount Amount of characters to replace. * @param[in] rss Reference to the string to use for recplacement. * @return Reference to this string. */ string_base& replace(size_t nPos, size_t nCount, const std::basic_string& rss); /** * @brief Replace characters with provided string. * @tparam nFixedSize2 The fixed size of the provided string. * @remarks itFirst and itLast must point to a position of this string. * @param[in] itFirst Iterator position of the first character to replace. * @param[in] itLast Iterator position of the character beyond the last character to replace. * @param[in] rss Reference to the string to use for recplacement. * @return Reference to this string. */ template string_base& replace(const_iterator itFirst, const_iterator itLast, const string_base& rss); /** * @brief Replace characters with provided string. * @remarks itFirst and itLast must point to a position of this string. * @param[in] itFirst Iterator position of the first character to replace. * @param[in] itLast Iterator position of the character beyond the last character to replace. * @param[in] rss Reference to the string to use for recplacement. * @return Reference to this string. */ string_base& replace(const_iterator itFirst, const_iterator itLast, const std::basic_string& rss); /** * @brief Replace characters with provided string substring. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] nPos Position to replace characters. * @param[in] nCount Amount of characters to replace. * @param[in] rss Reference to the string to use for recplacement. * @param[in] nPos2 Position of the characters within the provided string. * @param[in] nCount2 Amount of characters within the provided string. * @return Reference to this string. */ template string_base& replace( size_t nPos, size_t nCount, const string_base& rss, size_t nPos2, size_t nCount2 = npos); /** * @brief Replace characters with provided string substring. * @param[in] nPos Position to replace characters. * @param[in] nCount Amount of characters to replace. * @param[in] rss Reference to the string to use for recplacement. * @param[in] nPos2 Position of the characters within the provided string. * @param[in] nCount2 Amount of characters within the provided string. * @return Reference to this string. */ string_base& replace(size_t nPos, size_t nCount, const std::basic_string& rss, size_t nPos2, size_t nCount2 = npos); /** * @brief Replace characters with provided string substring. * @param[in] nPos Position to replace characters. * @param[in] nCount Amount of characters to replace. * @param[in] sz Pointer to the C string to use for recplacement. Can contain zeros. * @param[in] nCount2 Amount of characters within the provided string. * @return Reference to this string. */ string_base& replace(size_t nPos, size_t nCount, const TCharType* sz, size_t nCount2); /** * @brief Replace characters with provided string substring. * @remarks itFirst and itLast must point to a position of this string. * @param[in] itFirst Iterator position of the first character to replace. * @param[in] itLast Iterator position of the character beyond the last character to replace. * @param[in] sz Pointer to the C string to use for recplacement. Can contain zeros. * @param[in] nCount2 Amount of characters within the provided string. * @return Reference to this string. */ string_base& replace(const_iterator itFirst, const_iterator itLast, const TCharType* sz, size_t nCount2); /** * @brief Replace characters with provided zero terminated string. * @param[in] nPos Position to replace characters. * @param[in] nCount Amount of characters to replace. * @param[in] sz Pointer to the zero terminated string to use for recplacement. * @return Reference to this string. */ string_base& replace(size_t nPos, size_t nCount, const TCharType* sz); /** * @brief Replace characters with provided zero terminated string. * @remarks itFirst and itLast must point to a position of this string. * @param[in] itFirst Iterator position of the first character to replace. * @param[in] itLast Iterator position of the character beyond the last character to replace. * @param[in] sz Pointer to the zero terminated string to use for recplacement. * @return Reference to this string. */ string_base& replace(const_iterator itFirst, const_iterator itLast, const TCharType* sz); /** * @brief Replace characters with nCount2 characters. * @param[in] nPos Position to replace characters. * @param[in] nCount Amount of characters to replace. * @param[in] nCount2 Amount of characters to use for replacement. * @param[in] c Character to use for recplacement. * @return Reference to this string. */ string_base& replace(size_t nPos, size_t nCount, size_t nCount2, TCharType c); /** * @brief Replace characters with nCount2 characters. * @remarks itFirst and itLast must point to a position of this string. * @param[in] itFirst Iterator position of the first character to replace. * @param[in] itLast Iterator position of the character beyond the last character to replace. * @param[in] nCount2 Amount of characters to use for replacement. * @param[in] c Character to use for recplacement. * @return Reference to this string. */ string_base& replace(const_iterator itFirst, const_iterator itLast, size_t nCount2, TCharType c); /** * @brief Replace characters with a container of TCharType identified by beginning and ending iterators. * @remarks itFirst and itLast must point to a position of this string. * @tparam TIterator Type of iterator to use for iterating through the container. * @param[in] itFirst Iterator position of the first character to replace. * @param[in] itLast Iterator position of the character beyond the last character to replace. * @param[in] itFirst2 Beginning iterator of the container. * @param[in] itLast2 Ending iterator of the container * @return Reference to this string. */ template string_base& replace(const_iterator itFirst, const_iterator itLast, TIterator itFirst2, TIterator itLast2); /** * @brief Replace characters with an initializer list. * @remarks itFirst and itLast must point to a position of this string. * @param[in] itFirst Iterator position of the first character to replace. * @param[in] itLast Iterator position of the character beyond the last character to replace. * @param[in] ilist Initializer list. * @return Reference to this string. */ string_base& replace(const_iterator itFirst, const_iterator itLast, std::initializer_list ilist); /** * @brief Return a substring. * @param[in] nPos The substring start position. * @param[in] nCount The amount of characters in the substring (if more than the available, all the characters right of the * position). * @return Returns a string with the substring characters. */ string_base substr(size_t nPos = 0, size_t nCount = npos) const; /** * @brief Copy a substring into the szDestination. * @remarks Does not copy a zero terminating character. * @param[in] szDest Destination string. * @param[in] nCount Amount of characters to copy (or the maximum amount is determined by the size). * @param[in] nPos The position from where to start copying. * @return Amount of characters copied. */ size_t copy(TCharType* szDest, size_t nCount, size_t nPos = 0) const; /** * @brief Set the new size of the string. Additional characters will be filled with '\0'. * @param[in] nCount The size of the string buffer. */ void resize(size_t nCount); /** * @brief Set the new size of the string. Additional characters will be filled with c. * @param[in] nCount The size of the string buffer. * @param[in] c Character to use to fill additional buffer space with. */ void resize(size_t nCount, TCharType c); /** * @brief Exchange the content of provided string with this string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss String to swap with. */ template void swap(string_base& rss); /** * @brief Find the position of the occurrence of the character sequence in the string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ template size_t find(const string_base& rss, size_t nPos = 0) const noexcept; /** * @brief Find the position of the occurrence of the character sequence in the string. * @param[in] rss Reference to the string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find(const std::basic_string& rss, size_t nPos = 0) const noexcept; /** * @brief Find the position of the occurrence of the character sequence in the string. * @param[in] sz Pointer to the string to find. May contain zeros. * @param[in] nPos Position to start searching. * @param[in] nCount Length of the string to search for. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find(const TCharType* sz, size_t nPos, size_t nCount) const; /** * @brief Find the position of the occurrence of the character sequence in the string. * @param[in] sz Pointer to zero terminated string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find(const TCharType* sz, size_t nPos = 0) const; /** * @brief Find the position of the occurrence of the character sequence in the string. * @param[in] c Character to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the character hasn't been found. */ size_t find(TCharType c, size_t nPos = 0) const noexcept; /** * @brief Find the position of the occurrence of the character sequence in the string. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to find. * @param[in] nPos Position to start searching in reverse order (nPos - 1). * @return Position of the first occurrence or npos if the string hasn't been found. */ template size_t rfind(const string_base& rss, size_t nPos = npos) const noexcept; /** * @brief Find the position of the occurrence of the character sequence in the string. * @param[in] rss Reference to the string to find. * @param[in] nPos Position to start searching in reverse order (nPos - 1). * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t rfind(const std::basic_string& rss, size_t nPos = npos) const noexcept; /** * @brief Find the position of the occurrence of the character sequence in the string. * @param[in] sz Pointer to the string to find. May contain zeros. * @param[in] nPos Position to start searching in reverse order (nPos - 1). * @param[in] nCount Length of the string to search for. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t rfind(const TCharType* sz, size_t nPos, size_t nCount) const; /** * @brief Find the position of the occurrence of the character sequence in the string. * @param[in] sz Pointer to zero terminated string to find. * @param[in] nPos Position to start searching in reverse order (nPos - 1). * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t rfind(const TCharType* sz, size_t nPos = npos) const; /** * @brief Find the position of the occurrence of the character sequence in the string. * @param[in] c Character to find to find. * @param[in] nPos Position to start searching in reverse order (nPos - 1). * @return Position of the first occurrence or npos if the character hasn't been found. */ size_t rfind(TCharType c, size_t nPos = npos) const noexcept; /** * @brief Find the position of the occurrence of one of the characters being in the provided character sequence. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ template size_t find_first_of(const string_base& rss, size_t nPos = 0) const noexcept; /** * @brief Find the position of the occurrence of one of the characters being in the provided character sequence. * @param[in] rss Reference to the string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find_first_of(const std::basic_string& rss, size_t nPos = 0) const noexcept; /** * @brief Find the position of the occurrence of one of the characters being in the provided character sequence. * @param[in] sz Pointer to the string to find. May contain zeros. * @param[in] nPos Position to start searching. * @param[in] nCount Length of the string to search for. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find_first_of(const TCharType* sz, size_t nPos, size_t nCount) const; /** * @brief Find the position of the occurrence of one of the characters being in the provided character sequence. * @param[in] sz Pointer to zero terminated string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find_first_of(const TCharType* sz, size_t nPos = 0) const; /** * @brief Find the position of the occurrence of the provided character. * @param[in] c Character to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the character hasn't been found. */ size_t find_first_of(TCharType c, size_t nPos = 0) const noexcept; /** * @brief Find the position of the occurrence of any characters not being in the provided character. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ template size_t find_first_not_of(const string_base& rss, size_t nPos = 0) const noexcept; /** * @brief Find the position of the occurrence of any characters not being in the provided character. * @param[in] rss Reference to the string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find_first_not_of(const std::basic_string& rss, size_t nPos = 0) const noexcept; /** * @brief Find the position of the occurrence of any characters not being in the provided character. * @param[in] sz Pointer to the string to find. May contain zeros. * @param[in] nPos Position to start searching. * @param[in] nCount Length of the string to search for. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find_first_not_of(const TCharType* sz, size_t nPos, size_t nCount) const; /** * @brief Find the position of the occurrence of any characters not being in the provided character. * @param[in] sz Pointer to zero terminated string to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the string hasn't been found. */ size_t find_first_not_of(const TCharType* sz, size_t nPos = 0) const; /** * @brief Find the position of the occurrence of any characters not being the provided character. * @param[in] c Character to find. * @param[in] nPos Position to start searching. * @return Position of the first occurrence or npos if the character hasn't been found. */ size_t find_first_not_of(TCharType c, size_t nPos = 0) const noexcept; /** * @brief Find the position of the last occurrence of one of the characters being in the provided character sequence. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to find. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @return Position of the last occurrence or npos if the string hasn't been found. */ template size_t find_last_of(const string_base& rss, size_t nPos = npos) const noexcept; /** * @brief Find the position of the last occurrence of one of the characters being in the provided character sequence. * @param[in] rss Reference to the string to find. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @return Position of the last occurrence or npos if the string hasn't been found. */ size_t find_last_of(const std::basic_string& rss, size_t nPos = npos) const noexcept; /** * @brief Find the position of the last occurrence of one of the characters being in the provided character sequence. * @param[in] sz Pointer to the string to find. May contain zeros. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @param[in] nCount Length of the string to search for. * @return Position of the last occurrence or npos if the string hasn't been found. */ size_t find_last_of(const TCharType* sz, size_t nPos, size_t nCount) const; /** * @brief Find the position of the last occurrence of one of the characters being in the provided character sequence. * @param[in] sz Pointer to zero terminated string to find. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @return Position of the last occurrence or npos if the string hasn't been found. */ size_t find_last_of(const TCharType* sz, size_t nPos = npos) const; /** * @brief Find the position of the last occurrence of the provided character. * @param[in] c Character to find. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @return Position of the last occurrence or npos if the character hasn't been found. */ size_t find_last_of(TCharType c, size_t nPos = npos) const noexcept; /** * @brief Find the last position of the occurrence of any characters not being in the provided character. * @tparam nFixedSize2 The fixed size of the provided string. * @param[in] rss Reference to the string to find. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @return Position of the last occurrence or npos if the string hasn't been found. */ template size_t find_last_not_of(const string_base& rss, size_t nPos = npos) const noexcept; /** * @brief Find the last position of the occurrence of any characters not being in the provided character. * @param[in] rss Reference to the string to find. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @return Position of the last occurrence or npos if the string hasn't been found. */ size_t find_last_not_of(const std::basic_string& rss, size_t nPos = npos) const noexcept; /** * @brief Find the last position of the occurrence of any characters not being in the provided character. * @param[in] sz Pointer to the string to find. May contain zeros. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @param[in] nCount Length of the string to search for. * @return Position of the last occurrence or npos if the string hasn't been found. */ size_t find_last_not_of(const TCharType* sz, size_t nPos, size_t nCount) const; /** * @brief Find the last position of the occurrence of any characters not being in the provided character. * @param[in] sz Pointer to zero terminated string to find. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @return Position of the last occurrence or npos if the string hasn't been found. */ size_t find_last_not_of(const TCharType* sz, size_t nPos = npos) const; /** * @brief Find the last position of the occurrence of any characters not being the provided character. * @param[in] c Character to find. * @param[in] nPos Ending position to start searching (last character ist nPos - 1). * @return Position of the last occurrence or npos if the character hasn't been found. */ size_t find_last_not_of(TCharType c, size_t nPos = npos) const noexcept; private: pointer m_ptrData; ///< Smart pointer to the data. }; /** * @brief String based on 'char' data type covering ANSI and UTF-8 character set. */ using string = string_base; /** * @brief String based on 'char' data type covering ANSI and UTF-8 character set. * @tparam nFixedSize The fixed size of the string. */ template using fixed_string = string_base; /** * @brief String based on 'wchar_t' data type covering UTF-16 (on Windows) and UTF-32 (on Linux) character set. */ using wstring = string_base; /** * @brief String based on 'wchar_t' data type covering UTF-16 (on Windows) and UTF-32 (on Linux) character set. * @tparam nFixedSize The fixed size of the string. */ template using fixed_wstring = string_base; /** * @brief String based on 'char' data type covering UTF-8 character set. */ using u8string = string_base; /** * @brief String based on 'char' data type covering UTF-8 character set. * @tparam nFixedSize The fixed size of the string. */ template using fixed_u8string = string_base; /** * @brief String based on 'char16_t' data type covering UTF-16 character set. */ using u16string = string_base; /** * @brief String based on 'char16_t' data type covering UTF-16 character set. * @tparam nFixedSize The fixed size of the string. */ template using fixed_u16string = string_base; /** * @brief String based on 'char32_t' data type covering UTF-32 character set. */ using u32string = string_base; /** * @brief String based on 'char32_t' data type covering UTF-32 character set. * @tparam nFixedSize The fixed size of the string. */ template using fixed_u32string = string_base; /** * @brief Returns a string composed from left characters followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return String with left characters concatenated with right characters. */ template string_base operator+( const string_base& rssLeft, const string_base& rssRight); /** * @brief Returns a string composed from left characters followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return String with left characters concatenated with right characters. */ template string_base operator+( const string_base& rssLeft, const std::basic_string&rssRight); /** * @brief Returns a string composed from left characters followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return String with left characters concatenated with right characters. */ template string_base operator+( const std::basic_string& rssLeft, const string_base& rssRight); /** * @brief Returns a string composed from left characters followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] szRight Pointer to zero terminate right string. * @return String with left characters concatenated with right characters. */ template string_base operator+( const string_base& rssLeft, const TCharType* szRight); /** * @brief Returns a string composed from left characters followed by right character. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] cRight Right character. * @return String with left characters concatenated with right character. */ template string_base operator+( const string_base& rssLeft, TCharType cRight); /** * @brief Returns a string composed from left characters followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] szLeft Pointer to zero terminated left string. * @param[in] rssRight Reference to the right string. * @return String with left characters concatenated with right characters. */ template string_base operator+( const TCharType* szLeft, const string_base& rssRight); /** * @brief Returns a string composed from left character followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] cLeft Left character. * @param[in] rssRight Reference to the right string. * @return String with left character concatenated with right characters. */ template string_base operator+( TCharType cLeft, const string_base& rssRight); /** * @brief Returns a string by moving left characters followed by moving right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. Content will be moved to the new string. * @param[in] rssRight Reference to the right string. Content will be moved to the new string. * @return String with left characters concatenated with right characters. */ template string_base operator+( string_base&& rssLeft, string_base&& rssRight); /** * @brief Returns a string by moving left characters followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. Content will be moved to the new string. * @param[in] rssRight Reference to the right string. * @return String with left characters concatenated with right characters. */ template string_base operator+( string_base&& rssLeft, const string_base& rssRight); /** * @brief Returns a string by moving left characters followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. Content will be moved to the new string. * @param[in] rssRight Reference to the right string. * @return String with left characters concatenated with right characters. */ template string_base operator+( string_base&& rssLeft, const std::basic_string& rssRight); /** * @brief Returns a string by moving left characters followed by right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. Content will be moved to the new string. * @param[in] szRight Pointer to zero terminated right string. * @return String with left characters concatenated with right characters. */ template string_base operator+( string_base&& rssLeft, const TCharType* szRight); /** * @brief Returns a string by moving left characters followed by right character. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. Content will be moved to the new string. * @param[in] cRight Right character. * @return String with left characters concatenated with right character. */ template string_base operator+( string_base&& rssLeft, TCharType cRight); /** * @brief Returns a string filled with left characters followed by moving right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. Content will be moved to the new string. * @return String with left characters concatenated with right characters. */ template string_base operator+( const string_base& rssLeft, string_base&& rssRight); /** * @brief Returns a string filled with left characters followed by moving right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. Content will be moved to the new string. * @return String with left characters concatenated with right characters. */ template string_base operator+( const std::basic_string& rssLeft, string_base&& rssRight); /** * @brief Returns a string filled with left characters followed by moving right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] szLeft Pointer to zero terminated left string. * @param[in] rssRight Reference to the right string. Content will be moved to the new string. * @return String with left characters concatenated with right characters. */ template string_base operator+( const TCharType* szLeft, string_base&& rssRight); /** * @brief Returns a string filled with left character followed by moving right characters. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] cLeft Left character. * @param[in] rssRight Reference to the right string. Content will be moved to the new string. * @return String with left character concatenated with right characters. */ template string_base operator+( TCharType cLeft, string_base&& rssRight); /** * @brief Swap the content of the left string with the content of the right string. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. */ template void swap(string_base& rssLeft, string_base& rssRight); /** * @brief Stream the content of a string into a std::basic_ostream object. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Fixed size of the string. * @param[in] rstream Reference to the stream. * @param[in] rss Reference to the string. * @return Reference to the stream. */ template std::basic_ostream>& operator<<( std::basic_ostream>& rstream, const string_base& rss); /** * @brief Stream the content of a std::basic_istream into a string. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Fixed size of the string. * @param[in] rstream Reference to the stream. * @param[in] rss Reference to the string. * @return Reference to the stream. */ template std::basic_istream>& operator>>( std::basic_istream>& rstream, string_base& rss); /** * @brief Read a line from the stream. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Fixed size of the string. * @param[in] rstream Reference to the stream. * @param[in] rss Reference to the string. * @param[in] cDelim Delimiter to separate lines. * @return Reference to the stream. */ template std::basic_istream>& getline( std::basic_istream>& rstream, string_base& rss, TCharType cDelim); /** * @brief Read a line from the stream. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Fixed size of the string. * @param[in] rstream Reference to the stream. * @param[in] rss Reference to the string. * @param[in] cDelim Delimiter to separate lines. * @return Reference to the stream. */ template std::basic_istream>& getline( std::basic_istream>&& rstream, string_base& rss, TCharType cDelim); /** * @brief Read a line separated by 'newline' from the stream. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Fixed size of the string. * @param[in] rstream Reference to the stream. * @param[in] rss Reference to the string. * @return Reference to the stream. */ template std::basic_istream>& getline( std::basic_istream>& rstream, string_base& rss); /** * @brief Read a line separated by 'newline' from the stream. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Fixed size of the string. * @param[in] rstream Reference to the stream. * @param[in] rss Reference to the string. * @return Reference to the stream. */ template std::basic_istream>& getline( std::basic_istream>&& rstream, string_base& rss); /** * @brief Compare two character sequences for equality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when the strings are equal; 'false' otherwise. */ template bool operator==(const string_base& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare two character sequences for equality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when the strings are equal; 'false' otherwise. */ template bool operator==(const string_base& rssLeft, const std::basic_string& rssRight) noexcept; /** * @brief Compare two character sequences for equality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when the strings are equal; 'false' otherwise. */ template bool operator==(const std::basic_string& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare two character sequences for inequality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when the strings are not equal; 'false' otherwise. */ template bool operator!=(const string_base& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare two character sequences for inequality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when the strings are not equal; 'false' otherwise. */ template bool operator!=(const string_base& rssLeft, const std::basic_string& rssRight) noexcept; /** * @brief Compare two character sequences for inequality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when the strings are not equal; 'false' otherwise. */ template bool operator!=(const std::basic_string& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically smaller than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is smaller than right; 'false' otherwise. */ template bool operator<(const string_base& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically smaller than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is smaller than right; 'false' otherwise. */ template bool operator<(const string_base& rssLeft, const std::basic_string& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically smaller than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is smaller than right; 'false' otherwise. */ template bool operator<(const std::basic_string& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically smaller than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is smaller than or equal to right; 'false' otherwise. */ template bool operator<=(const string_base& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically smaller than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is smaller than or equal to right; 'false' otherwise. */ template bool operator<=(const string_base& rssLeft, const std::basic_string& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically smaller than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is smaller than or equal to right; 'false' otherwise. */ template bool operator<=(const std::basic_string& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically larger than the right character sequences. * @tparam TCharType The character type to use for the strings. * @param[in] rssLeft Reference to the left string. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is larger than right; 'false' otherwise. */ template bool operator>(const string_base& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically larger than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is larger than right; 'false' otherwise. */ template bool operator>(const string_base& rssLeft, const std::basic_string& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically larger than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is larger than right; 'false' otherwise. */ template bool operator>(const std::basic_string& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically larger than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam nFixedSizeLeft Fixed size of the left string. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is larger than or equal to right; 'false' otherwise. */ template bool operator>=(const string_base& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically larger than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is larger than or equal to right; 'false' otherwise. */ template bool operator>=(const string_base& rssLeft, const std::basic_string& rssRight) noexcept; /** * @brief Compare whether the left character sequence is lexicograpgically larger than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] rssLeft Reference to the left string. * @param[in] rssRight Reference to the right string. * @return Returns 'true' when left is larger than or equal to right; 'false' otherwise. */ template bool operator>=(const std::basic_string& rssLeft, const string_base& rssRight) noexcept; /** * @brief Compare two character sequences for equality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] szRight Pointer to the tero terminated right string. * @return Returns 'true' when the strings are equal; 'false' otherwise. */ template bool operator==(const string_base& rssLeft, const TCharType* szRight); /** * @brief Compare two character sequences for equality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] szLeft Pointer to the tero terminated left string. * @param[in] rssRight Reference to the left string. * @return Returns 'true' when the strings are equal; 'false' otherwise. */ template bool operator==(const TCharType* szLeft, const string_base& rssRight); /** * @brief Compare two character sequences for inequality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] szRight Pointer to the tero terminated right string. * @return Returns 'true' when the strings are not equal; 'false' otherwise. */ template bool operator!=(const string_base& rssLeft, const TCharType* szRight); /** * @brief Compare two character sequences for inequality. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] szLeft Pointer to the tero terminated left string. * @param[in] rssRight Reference to the left string. * @return Returns 'true' when the strings are not equal; 'false' otherwise. */ template bool operator!=(const TCharType* szLeft, const string_base& rssRight); /** * @brief Compare whether the left character sequence is lexicograpgically smaller than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] szRight Pointer to the tero terminated right string. * @return Returns 'true' when left is smaller than right; 'false' otherwise. */ template bool operator<(const string_base& rssLeft, const TCharType* szRight); /** * @brief Compare whether the left character sequence is lexicograpgically smaller than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] szLeft Pointer to the tero terminated left string. * @param[in] rssRight Reference to the left string. * @return Returns 'true' when left is smaller than right; 'false' otherwise. */ template bool operator<(const TCharType* szLeft, const string_base& rssRight); /** * @brief Compare whether the left character sequence is lexicograpgically smaller than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] szRight Pointer to the tero terminated right string. * @return Returns 'true' when left is smaller than or equal to right; 'false' otherwise. */ template bool operator<=(const string_base& rssLeft, const TCharType* szRight); /** * @brief Compare whether the left character sequence is lexicograpgically smaller than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] szLeft Pointer to the tero terminated left string. * @param[in] rssRight Reference to the left string. * @return Returns 'true' when left is smaller than or equal to right; 'false' otherwise. */ template bool operator<=(const TCharType* szLeft, const string_base& rssRight); /** * @brief Compare whether the left character sequence is lexicograpgically larger than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] szRight Pointer to the tero terminated right string. * @return Returns 'true' when left is larger than right; 'false' otherwise. */ template bool operator>(const string_base& rssLeft, const TCharType* szRight); /** * @brief Compare whether the left character sequence is lexicograpgically larger than the right character sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] szLeft Pointer to the tero terminated left string. * @param[in] rssRight Reference to the left string. * @return Returns 'true' when left is larger than right; 'false' otherwise. */ template bool operator>(const TCharType* szLeft, const string_base& rssRight); /** * @brief Compare whether the left character sequence is lexicograpgically smaller than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeLeft When set, the left string is a unicode string. * @tparam nFixedSizeLeft Fixed size of the left string. * @param[in] rssLeft Reference to the left string. * @param[in] szRight Pointer to the tero terminated right string. * @return Returns 'true' when left is larger than or equal to right; 'false' otherwise. */ template bool operator>=(const string_base& rssLeft, const TCharType* szRight); /** * @brief Compare whether the left character sequence is lexicograpgically smaller than or equal to the right character * sequences. * @tparam TCharType The character type to use for the strings. * @tparam bUnicodeRight When set, the right string is a unicode string. * @tparam nFixedSizeRight Fixed size of the right string. * @param[in] szLeft Pointer to the tero terminated left string. * @param[in] rssRight Reference to the left string. * @return Returns 'true' when left is larger than or equal to right; 'false' otherwise. */ template bool operator>=(const TCharType* szLeft, const string_base& rssRight); /** * @brief Create an ANSI (ISO/IEC 8859-1) string by providing strings of other types. * @remarks An automatic conversion from UTF-8 to ANSI is not possible (since both use the "char" data type). * @tparam TCharType The character type to use for the strings. * @param[in] sz Pointer to a string. * @param[in] nCount The amount of characters in the string or 'npos' when the string is zero terminated. * @param[in] cFill The filling character to add when a Unicode character was detected that was not fitting the ANSI character set. * @return Returns the created string. */ template string MakeAnsiString(const TCharType* sz, size_t nCount = string::npos, char cFill = '_'); /** * @brief Create Utf-8 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @param[in] sz Pointer to a string. * @param[in] nCount The amount of characters in the string or 'npos' when the string is zero terminated. * @return Returns the created string. */ template u8string MakeUtf8String(const TCharType* sz, size_t nCount = u8string::npos); /** * @brief Create Utf-16 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @param[in] sz Pointer to a string. * @param[in] nCount The amount of characters in the string or 'npos' when the string is zero terminated. * @return Returns the created string. */ template u16string MakeUtf16String(const TCharType* sz, size_t nCount = u16string::npos); /** * @brief Create Utf-32 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @param[in] sz Pointer to a string. * @param[in] nCount The amount of characters in the string or 'npos' when the string is zero terminated. * @return Returns the created string. */ template u32string MakeUtf32String(const TCharType* sz, size_t nCount = u32string::npos); /** * @brief Create wide string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @param[in] sz Pointer to a string. * @param[in] nCount The amount of characters in the string or 'npos' when the string is zero terminated. * @return Returns the created string. */ template wstring MakeWString(const TCharType* sz, size_t nCount = wstring::npos); /** * @brief Create an ANSI (ISO/IEC 8859-1) string by providing strings of other types. * @remarks An automatic conversion from UTF-8 to ANSI is not possible (since both use the "char" data type). * @tparam bUnicode When set, the string is a unicode string. * @tparam TCharType The character type to use for the strings. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @param[in] cFill The filling character to add when a Unicode character was detected that was not fitting the ANSI character set. * @return Returns the created string. */ template string MakeAnsiString(const string_base& rss, char cFill = '_'); /** * @brief Create wide string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @return Returns the created string. */ template wstring MakeWString(const string_base& rss); /** * @brief Create Utf-8 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @return Returns the created string. */ template u8string MakeUtf8String(const string_base& rss); /** * @brief Create Utf-16 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @return Returns the created string. */ template u16string MakeUtf16String(const string_base& rss); /** * @brief Create Utf-32 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @return Returns the created string. */ template u32string MakeUtf32String(const string_base& rss); /** * @brief Create an ANSI (ISO/IEC 8859-1) string by providing strings of other types. * @remarks An automatic conversion from UTF-8 to ANSI is not possible (since both use the "char" data type). * @tparam TCharType The character type to use for the strings. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @param[in] cFill The filling character to add when a Unicode character was detected that was not fitting the ANSI character set. * @return Returns the created string. */ template string MakeAnsiString(const std::basic_string& rss, char cFill = '_'); /** * @brief Create wide string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @return Returns the created string. */ template wstring MakeWString(const std::basic_string& rss); /** * @brief Create Utf-8 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @return Returns the created string. */ template u8string MakeUtf8String(const std::basic_string& rss); /** * @brief Create Utf-16 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @return Returns the created string. */ template u16string MakeUtf16String(const std::basic_string& rss); /** * @brief Create Utf-32 string by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rss Reference to the string. * @return Returns the created string. */ template u32string MakeUtf32String(const std::basic_string& rss); /** * @brief Generic string conversion. * @tparam TCharTypeSrc The character type to use for the source string. * @tparam bUnicodeSrc When set, the source string is a unicode string. * @tparam nFixedSizeSrc Size of the fixed size buffer or 0 for a dynamic sized buffer of the source string. * @tparam TCharTypeDst The character type to use for the destination string. * @tparam bUnicodeDst When set, the destination string is a unicode string. * @tparam nFixedSizeSrc Size of the fixed size buffer or 0 for a dynamic sized buffer of the destrination string. * @param[in] rss Reference to the string. * @return Returns the created string. */ template string_base MakeString(const string_base& rss); /** * @brief Generic string conversion. * @tparam TCharTypeSrc The character type to use for the source string. * @tparam TCharTypeDst The character type to use for the destination string. * @tparam bUnicodeDst When set, the destination string is a unicode string. * @tparam nFixedSizeSrc Size of the fixed size buffer or 0 for a dynamic sized buffer of the destrination string. * @param[in] rss Reference to the string. * @return Returns the created string. */ template string_base MakeString(const std::basic_string& rss); /** * @brief Create path by providing strings of other types. * @tparam TCharType The character type to use for the strings. * @tparam bUnicode When set, the string is a unicode string. * @tparam nFixedSize Size of the fixed size buffer or 0 for a dynamic sized buffer. * @param[in] rssPath Reference to the string. * @return Returns the created path. */ template std::filesystem::path MakePath(const string_base& rssPath); } // namespace sdv #include "string.inl" #endif // !defined SDV_STRING_H