|
|
@@ -33,7 +33,7 @@ namespace juce |
|
|
|
|
|
|
|
@see StringArray, StringPairArray
|
|
|
|
*/
|
|
|
|
class JUCE_API String
|
|
|
|
class JUCE_API String final
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//==============================================================================
|
|
|
@@ -43,10 +43,10 @@ public: |
|
|
|
String() noexcept;
|
|
|
|
|
|
|
|
/** Creates a copy of another string. */
|
|
|
|
String (const String& other) noexcept;
|
|
|
|
String (const String&) noexcept;
|
|
|
|
|
|
|
|
/** Move constructor */
|
|
|
|
String (String&& other) noexcept;
|
|
|
|
String (String&&) noexcept;
|
|
|
|
|
|
|
|
/** Creates a string from a zero-terminated ascii text string.
|
|
|
|
|
|
|
@@ -93,37 +93,37 @@ public: |
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/** Creates a string from a UTF-8 character string */
|
|
|
|
String (const CharPointer_UTF8 text);
|
|
|
|
String (CharPointer_UTF8 text);
|
|
|
|
|
|
|
|
/** Creates a string from a UTF-8 character string */
|
|
|
|
String (const CharPointer_UTF8 text, size_t maxChars);
|
|
|
|
String (CharPointer_UTF8 text, size_t maxChars);
|
|
|
|
|
|
|
|
/** Creates a string from a UTF-8 character string */
|
|
|
|
String (const CharPointer_UTF8 start, const CharPointer_UTF8 end);
|
|
|
|
String (CharPointer_UTF8 start, CharPointer_UTF8 end);
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/** Creates a string from a UTF-16 character string */
|
|
|
|
String (const CharPointer_UTF16 text);
|
|
|
|
String (CharPointer_UTF16 text);
|
|
|
|
|
|
|
|
/** Creates a string from a UTF-16 character string */
|
|
|
|
String (const CharPointer_UTF16 text, size_t maxChars);
|
|
|
|
String (CharPointer_UTF16 text, size_t maxChars);
|
|
|
|
|
|
|
|
/** Creates a string from a UTF-16 character string */
|
|
|
|
String (const CharPointer_UTF16 start, const CharPointer_UTF16 end);
|
|
|
|
String (CharPointer_UTF16 start, CharPointer_UTF16 end);
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/** Creates a string from a UTF-32 character string */
|
|
|
|
String (const CharPointer_UTF32 text);
|
|
|
|
String (CharPointer_UTF32 text);
|
|
|
|
|
|
|
|
/** Creates a string from a UTF-32 character string */
|
|
|
|
String (const CharPointer_UTF32 text, size_t maxChars);
|
|
|
|
String (CharPointer_UTF32 text, size_t maxChars);
|
|
|
|
|
|
|
|
/** Creates a string from a UTF-32 character string */
|
|
|
|
String (const CharPointer_UTF32 start, const CharPointer_UTF32 end);
|
|
|
|
String (CharPointer_UTF32 start, CharPointer_UTF32 end);
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
/** Creates a string from an ASCII character string */
|
|
|
|
String (const CharPointer_ASCII text);
|
|
|
|
String (CharPointer_ASCII text);
|
|
|
|
|
|
|
|
/** Creates a string from a UTF-8 encoded std::string. */
|
|
|
|
String (const std::string&);
|
|
|
@@ -230,8 +230,8 @@ public: |
|
|
|
@param startOfTextToAppend the start of the string to add. This must not be a nullptr
|
|
|
|
@param endOfTextToAppend the end of the string to add. This must not be a nullptr
|
|
|
|
*/
|
|
|
|
void appendCharPointer (const CharPointerType startOfTextToAppend,
|
|
|
|
const CharPointerType endOfTextToAppend);
|
|
|
|
void appendCharPointer (CharPointerType startOfTextToAppend,
|
|
|
|
CharPointerType endOfTextToAppend);
|
|
|
|
|
|
|
|
/** Appends a string to the end of this one.
|
|
|
|
|
|
|
@@ -239,8 +239,8 @@ public: |
|
|
|
@param endOfTextToAppend the end of the string to add. This must not be a nullptr
|
|
|
|
*/
|
|
|
|
template <class CharPointer>
|
|
|
|
void appendCharPointer (const CharPointer startOfTextToAppend,
|
|
|
|
const CharPointer endOfTextToAppend)
|
|
|
|
void appendCharPointer (CharPointer startOfTextToAppend,
|
|
|
|
CharPointer endOfTextToAppend)
|
|
|
|
{
|
|
|
|
jassert (startOfTextToAppend.getAddress() != nullptr && endOfTextToAppend.getAddress() != nullptr);
|
|
|
|
|
|
|
@@ -260,7 +260,7 @@ public: |
|
|
|
}
|
|
|
|
|
|
|
|
/** Appends a string to the end of this one. */
|
|
|
|
void appendCharPointer (const CharPointerType textToAppend);
|
|
|
|
void appendCharPointer (CharPointerType textToAppend);
|
|
|
|
|
|
|
|
/** Appends a string to the end of this one.
|
|
|
|
|
|
|
@@ -268,7 +268,7 @@ public: |
|
|
|
@param maxCharsToTake the maximum number of characters to take from the string passed in
|
|
|
|
*/
|
|
|
|
template <class CharPointer>
|
|
|
|
void appendCharPointer (const CharPointer textToAppend, size_t maxCharsToTake)
|
|
|
|
void appendCharPointer (CharPointer textToAppend, size_t maxCharsToTake)
|
|
|
|
{
|
|
|
|
if (textToAppend.getAddress() != nullptr)
|
|
|
|
{
|
|
|
@@ -290,7 +290,7 @@ public: |
|
|
|
|
|
|
|
/** Appends a string to the end of this one. */
|
|
|
|
template <class CharPointer>
|
|
|
|
void appendCharPointer (const CharPointer textToAppend)
|
|
|
|
void appendCharPointer (CharPointer textToAppend)
|
|
|
|
{
|
|
|
|
appendCharPointer (textToAppend, std::numeric_limits<size_t>::max());
|
|
|
|
}
|
|
|
|