40 using CharType = char;
43 : data (const_cast<CharType*> (rawPointer))
57 data =
const_cast<CharType*
> (text);
63 inline bool operator!= (
CharPointer_ASCII other)
const noexcept {
return data != other.data; }
64 inline bool operator<= (
CharPointer_ASCII other)
const noexcept {
return data <= other.data; }
65 inline bool operator< (
CharPointer_ASCII other)
const noexcept {
return data < other.data; }
66 inline bool operator>= (
CharPointer_ASCII other)
const noexcept {
return data >= other.data; }
67 inline bool operator> (
CharPointer_ASCII other)
const noexcept {
return data > other.data; }
70 inline CharType*
getAddress() const noexcept {
return data; }
73 inline operator const CharType*()
const noexcept {
return data; }
76 inline bool isEmpty() const noexcept {
return *data == 0; }
79 inline bool isNotEmpty() const noexcept {
return *data != 0; }
82 inline juce_wchar
operator*() const noexcept {
return (juce_wchar) (uint8) *data; }
100 inline juce_wchar
getAndAdvance() noexcept {
return (juce_wchar) (uint8) *data++; }
116 inline void operator-= (
const int numToSkip) noexcept
122 inline juce_wchar
operator[] (
const int characterIndex)
const noexcept
124 return (juce_wchar) (uint8) data [characterIndex];
140 inline void write (
const juce_wchar charToWrite) noexcept
142 *data++ = (char) charToWrite;
145 inline void replaceChar (
const juce_wchar newChar) noexcept
147 *data = (char) newChar;
159 return (
size_t) strlen (data);
163 size_t lengthUpTo (
const size_t maxCharsToCount)
const noexcept
194 template <
class CharPo
inter>
197 return text.length();
207 template <
typename CharPo
inter>
217 template <
typename CharPo
inter>
227 template <
typename CharPo
inter>
234 template <
typename CharPo
inter>
235 int compare (
const CharPointer other)
const noexcept
243 return strcmp (data, other.data);
247 template <
typename CharPo
inter>
248 int compareUpTo (
const CharPointer other,
const int maxChars)
const noexcept
256 return strncmp (data, other.data, (
size_t) maxChars);
260 template <
typename CharPo
inter>
268 #if JUCE_MINGW || (JUCE_WINDOWS && JUCE_CLANG) 271 return stricmp (data, other.data);
273 return strcasecmp (data, other.data);
278 template <
typename CharPo
inter>
285 template <
typename CharPo
inter>
286 int indexOf (
const CharPointer stringToFind)
const noexcept
292 int indexOf (
const juce_wchar charToFind)
const noexcept
298 if (data[i] == (
char) charToFind)
308 int indexOf (
const juce_wchar charToFind,
const bool ignoreCase)
const noexcept
338 #if JUCE_LINUX || JUCE_ANDROID || JUCE_MINGW 341 return _atoi64 (data);
343 return CharacterFunctions::getIntValue <int64, CharPointer_ASCII> (*this);
356 return ((
unsigned int) character) < (
unsigned int) 128;
362 while (--maxBytesToRead >= 0)
364 if (((
signed char) *dataToTest) <= 0)
365 return *dataToTest == 0;
int indexOf(const juce_wchar charToFind) const noexcept
static double getDoubleValue(CharPointerType text) noexcept
static juce_wchar toUpperCase(juce_wchar character) noexcept
static size_t getBytesRequiredFor(const juce_wchar) noexcept
int getIntValue32() const noexcept
static bool isValidString(const CharType *dataToTest, int maxBytesToRead)
static int indexOfCharIgnoreCase(Type text, juce_wchar charToFind) noexcept
static void copyAll(DestCharPointerType &dest, SrcCharPointerType src) noexcept
int compare(const CharPointer other) const noexcept
CharPointer_ASCII operator-(const int numToSkip) const noexcept
size_t length() const noexcept
static int compareIgnoreCase(juce_wchar char1, juce_wchar char2) noexcept
CharPointer_ASCII operator++() noexcept
bool isNotEmpty() const noexcept
bool isLetterOrDigit() const
static bool isDigit(char character) noexcept
static Type findEndOfWhitespace(Type text) noexcept
int indexOf(const CharPointer stringToFind) const noexcept
static bool isWhitespace(char character) noexcept
int indexOf(const juce_wchar charToFind, const bool ignoreCase) const noexcept
size_t lengthUpTo(const size_t maxCharsToCount) const noexcept
static int indexOfChar(Type text, const juce_wchar charToFind) noexcept
void writeNull() const noexcept
static int compareIgnoreCaseUpTo(CharPointerType1 s1, CharPointerType2 s2, int maxChars) noexcept
void writeWithCharLimit(const CharPointer src, const int maxChars) noexcept
CharPointer_ASCII findTerminatingNull() const noexcept
int compareIgnoreCaseUpTo(const CharPointer other, const int maxChars) const noexcept
static bool isUpperCase(juce_wchar character) noexcept
static size_t lengthUpTo(CharPointerType text, const size_t maxCharsToCount) noexcept
juce_wchar operator*() const noexcept
bool isEmpty() const noexcept
size_t lengthUpTo(const CharPointer_ASCII end) const noexcept
static size_t copyWithDestByteLimit(DestCharPointerType &dest, SrcCharPointerType src, size_t maxBytesToWrite) noexcept
void operator+=(const int numToSkip) noexcept
void writeAll(const CharPointer src) noexcept
int compare(const CharPointer_ASCII other) const noexcept
int compareUpTo(const CharPointer_ASCII other, const int maxChars) const noexcept
double getDoubleValue() const noexcept
juce_wchar toLowerCase() const noexcept
static size_t getBytesRequiredFor(const CharPointer text) noexcept
int compareIgnoreCase(const CharPointer other) const
CharPointer_ASCII findEndOfWhitespace() const noexcept
int compareUpTo(const CharPointer other, const int maxChars) const noexcept
static juce_wchar toLowerCase(juce_wchar character) noexcept
CharPointer_ASCII operator--() noexcept
static bool isLetter(char character) noexcept
size_t writeWithDestByteLimit(const CharPointer src, const size_t maxDestBytes) noexcept
juce_wchar getAndAdvance() noexcept
juce_wchar operator[](const int characterIndex) const noexcept
int64 getIntValue64() const noexcept
void write(const juce_wchar charToWrite) noexcept
static int indexOf(CharPointerType1 textToSearch, const CharPointerType2 substringToLookFor) noexcept
juce_wchar toUpperCase() const noexcept
bool operator==(CharPointer_ASCII other) const noexcept
CharPointer_ASCII operator+(const int numToSkip) const noexcept
static bool canRepresent(juce_wchar character) noexcept
bool isWhitespace() const
static bool isLowerCase(juce_wchar character) noexcept
static bool isLetterOrDigit(char character) noexcept
CharType * getAddress() const noexcept
static int compareUpTo(CharPointerType1 s1, CharPointerType2 s2, int maxChars) noexcept
size_t sizeInBytes() const noexcept
static void copyWithCharLimit(DestCharPointerType &dest, SrcCharPointerType src, int maxChars) noexcept
static int compare(juce_wchar char1, juce_wchar char2) noexcept