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_BSD || JUCE_ANDROID || JUCE_MINGW
341 return _atoi64 (data);
343 return CharacterFunctions::getIntValue <int64, CharPointer_ASCII> (*
this);
359 return ((
unsigned int) character) < (
unsigned int) 128;
365 while (--maxBytesToRead >= 0)
367 if (((
signed char) *dataToTest) <= 0)
368 return *dataToTest == 0;
int getIntValue32() const noexcept
double getDoubleValue() const noexcept
size_t length() const noexcept
static bool isValidString(const CharType *dataToTest, int maxBytesToRead)
size_t sizeInBytes() const noexcept
CharPointer_ASCII operator+(const int numToSkip) const noexcept
size_t lengthUpTo(const CharPointer_ASCII end) const noexcept
bool isNotEmpty() const noexcept
void writeAll(const CharPointer src) noexcept
static size_t getBytesRequiredFor(const juce_wchar) noexcept
int compareIgnoreCaseUpTo(const CharPointer other, const int maxChars) const noexcept
CharPointer_ASCII operator++() noexcept
bool isWhitespace() const
void incrementToEndOfWhitespace() noexcept
int compareIgnoreCase(const CharPointer other) const
CharPointer_ASCII operator--() noexcept
bool isLetterOrDigit() const
static size_t getBytesRequiredFor(const CharPointer text) noexcept
CharType * getAddress() const noexcept
juce_wchar toUpperCase() const noexcept
int compareUpTo(const CharPointer_ASCII other, const int maxChars) const noexcept
int compare(const CharPointer_ASCII other) const noexcept
juce_wchar toLowerCase() const noexcept
int indexOf(const juce_wchar charToFind, const bool ignoreCase) const noexcept
void writeNull() const noexcept
void write(const juce_wchar charToWrite) noexcept
static bool canRepresent(juce_wchar character) noexcept
juce_wchar operator[](const int characterIndex) const noexcept
CharPointer_ASCII operator-(const int numToSkip) const noexcept
int indexOf(const CharPointer stringToFind) const noexcept
CharPointer_ASCII findEndOfWhitespace() const noexcept
juce_wchar operator*() const noexcept
void operator+=(const int numToSkip) noexcept
int compare(const CharPointer other) const noexcept
int indexOf(const juce_wchar charToFind) const noexcept
bool isEmpty() const noexcept
juce_wchar getAndAdvance() noexcept
void writeWithCharLimit(const CharPointer src, const int maxChars) noexcept
size_t writeWithDestByteLimit(const CharPointer src, const size_t maxDestBytes) noexcept
bool operator==(CharPointer_ASCII other) const noexcept
int compareUpTo(const CharPointer other, const int maxChars) const noexcept
int64 getIntValue64() const noexcept
CharPointer_ASCII findTerminatingNull() const noexcept
size_t lengthUpTo(const size_t maxCharsToCount) const 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 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