34class CharPointer_UTF32 final
37 using CharType = juce_wchar;
39 inline explicit CharPointer_UTF32 (
const CharType* rawPointer) noexcept
40 : data (
const_cast<CharType*
> (rawPointer))
44 inline CharPointer_UTF32 (
const CharPointer_UTF32& other) =
default;
46 inline CharPointer_UTF32 operator= (CharPointer_UTF32 other)
noexcept
52 inline CharPointer_UTF32 operator= (
const CharType* text)
noexcept
54 data =
const_cast<CharType*
> (text);
59 inline bool operator== (CharPointer_UTF32 other)
const noexcept {
return data == other.data; }
60 inline bool operator!= (
CharPointer_UTF32 other)
const noexcept {
return data != other.data; }
61 inline bool operator<= (CharPointer_UTF32 other)
const noexcept {
return data <= other.data; }
62 inline bool operator< (CharPointer_UTF32 other)
const noexcept {
return data < other.data; }
63 inline bool operator>= (CharPointer_UTF32 other)
const noexcept {
return data >= other.data; }
64 inline bool operator> (CharPointer_UTF32 other)
const noexcept {
return data > other.data; }
67 inline CharType*
getAddress() const noexcept {
return data; }
70 inline operator const CharType*()
const noexcept {
return data; }
73 inline bool isEmpty() const noexcept {
return *data == 0; }
76 inline bool isNotEmpty() const noexcept {
return *data != 0; }
79 inline juce_wchar
operator*() const noexcept {
return *data; }
113 inline void operator-= (
int numToSkip)
noexcept
119 inline juce_wchar&
operator[] (
int characterIndex)
const noexcept
121 return data [characterIndex];
125 CharPointer_UTF32
operator+ (
int numToSkip)
const noexcept
127 return CharPointer_UTF32 (data + numToSkip);
131 CharPointer_UTF32
operator- (
int numToSkip)
const noexcept
133 return CharPointer_UTF32 (data - numToSkip);
137 inline void write (juce_wchar charToWrite)
noexcept
139 *data++ = charToWrite;
142 inline void replaceChar (juce_wchar newChar)
noexcept
156 #if JUCE_NATIVE_WCHAR_IS_UTF32 && ! JUCE_ANDROID
157 return wcslen (data);
183 return sizeof (CharType) * (
length() + 1);
191 return sizeof (CharType);
198 template <
class CharPo
inter>
201 return sizeof (CharType) * text.length();
207 return CharPointer_UTF32 (data +
length());
211 template <
typename CharPo
inter>
222 while ((*data = *s) != 0)
233 template <
typename CharPo
inter>
243 template <
typename CharPo
inter>
250 template <
typename CharPo
inter>
251 int compare (CharPointer other)
const noexcept
256 #if JUCE_NATIVE_WCHAR_IS_UTF32 && ! JUCE_ANDROID
260 return wcscmp (data, other.data);
265 template <
typename CharPo
inter>
272 template <
typename CharPo
inter>
279 template <
typename CharPo
inter>
286 template <
typename CharPo
inter>
287 int indexOf (CharPointer stringToFind)
const noexcept
293 int indexOf (juce_wchar charToFind)
const noexcept
299 if (data[i] == charToFind)
309 int indexOf (juce_wchar charToFind,
bool ignoreCase)
const noexcept
350 return ((uint32) character) < (uint32) 0x10ffff;
356 maxBytesToRead /= (int)
sizeof (CharType);
358 while (--maxBytesToRead >= 0 && *dataToTest != 0)
368 return CharPointer_UTF32 (
reinterpret_cast<Atomic<CharType*>&
> (data).exchange (newValue.data));
void writeNull() const noexcept
static bool isValidString(const CharType *dataToTest, int maxBytesToRead)
void write(juce_wchar charToWrite) noexcept
CharPointer_UTF32 operator++() noexcept
CharPointer_UTF32 atomicSwap(CharPointer_UTF32 newValue)
bool operator==(CharPointer_UTF32 other) const noexcept
static size_t getBytesRequiredFor(CharPointer text) noexcept
int compareIgnoreCase(CharPointer other) const
void operator+=(int numToSkip) noexcept
CharPointer_UTF32 operator--() noexcept
CharPointer_UTF32 findTerminatingNull() const noexcept
int64 getIntValue64() const noexcept
size_t writeWithDestByteLimit(CharPointer src, size_t maxDestBytes) noexcept
juce_wchar & operator[](int characterIndex) const noexcept
int indexOf(CharPointer stringToFind) const noexcept
juce_wchar toLowerCase() const noexcept
void writeAll(CharPointer_UTF32 src) noexcept
CharType * getAddress() const noexcept
void writeWithCharLimit(CharPointer src, int maxChars) noexcept
bool isEmpty() const noexcept
bool isNotEmpty() const noexcept
size_t sizeInBytes() const noexcept
CharPointer_UTF32 findEndOfWhitespace() const noexcept
void incrementToEndOfWhitespace() noexcept
size_t lengthUpTo(CharPointer_UTF32 end) const noexcept
size_t length() const noexcept
CharPointer_UTF32 operator+(int numToSkip) const noexcept
bool isLetterOrDigit() const
juce_wchar toUpperCase() const noexcept
int getIntValue32() const noexcept
static bool canRepresent(juce_wchar character) noexcept
int indexOf(juce_wchar charToFind) const noexcept
static size_t getBytesRequiredFor(juce_wchar) noexcept
size_t lengthUpTo(size_t maxCharsToCount) const noexcept
int compare(CharPointer other) const noexcept
int compareIgnoreCaseUpTo(CharPointer other, int maxChars) const noexcept
juce_wchar getAndAdvance() noexcept
bool isWhitespace() const
juce_wchar operator*() const noexcept
int indexOf(juce_wchar charToFind, bool ignoreCase) const noexcept
CharPointer_UTF32 operator-(int numToSkip) const noexcept
int compareUpTo(CharPointer other, int maxChars) const noexcept
double getDoubleValue() const noexcept
void writeAll(CharPointer src) noexcept
static void incrementToEndOfWhitespace(Type &text) noexcept
static int compare(juce_wchar char1, juce_wchar char2) noexcept
static juce_wchar toLowerCase(juce_wchar character) noexcept
static size_t copyWithDestByteLimit(DestCharPointerType &dest, SrcCharPointerType src, size_t maxBytesToWrite) noexcept
static int indexOfCharIgnoreCase(Type text, juce_wchar charToFind) noexcept
static bool isDigit(char character) noexcept
static IntType getIntValue(const CharPointerType text) noexcept
static int compareIgnoreCaseUpTo(CharPointerType1 s1, CharPointerType2 s2, int maxChars) noexcept
static int indexOfChar(Type text, const juce_wchar charToFind) noexcept
static int compareIgnoreCase(juce_wchar char1, juce_wchar char2) noexcept
static bool isLowerCase(juce_wchar character) noexcept
static bool isLetter(char character) noexcept
static int indexOf(CharPointerType1 textToSearch, const CharPointerType2 substringToLookFor) noexcept
static bool isWhitespace(char character) noexcept
static size_t lengthUpTo(CharPointerType text, const size_t maxCharsToCount) noexcept
static Type findEndOfWhitespace(Type text) noexcept
static void copyWithCharLimit(DestCharPointerType &dest, SrcCharPointerType src, int maxChars) noexcept
static bool isLetterOrDigit(char character) noexcept
static juce_wchar toUpperCase(juce_wchar character) noexcept
static bool isUpperCase(juce_wchar character) noexcept
static double getDoubleValue(CharPointerType text) noexcept
static void copyAll(DestCharPointerType &dest, SrcCharPointerType src) noexcept
static int compareUpTo(CharPointerType1 s1, CharPointerType2 s2, int maxChars) noexcept