JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Static Public Member Functions | List of all members
juce::CharacterFunctions Class Reference

A collection of functions for manipulating characters and character strings. More...

#include "juce_CharacterFunctions.h"

Classes

struct  HexParser
 Parses a character string, to read a hexadecimal value. More...
 

Static Public Member Functions

static juce_wchar toUpperCase (juce_wchar character) noexcept
 Converts a character to upper-case.
 
static juce_wchar toLowerCase (juce_wchar character) noexcept
 Converts a character to lower-case.
 
static bool isUpperCase (juce_wchar character) noexcept
 Checks whether a unicode character is upper-case.
 
static bool isLowerCase (juce_wchar character) noexcept
 Checks whether a unicode character is lower-case.
 
static bool isWhitespace (char character) noexcept
 Checks whether a character is whitespace.
 
static bool isWhitespace (juce_wchar character) noexcept
 Checks whether a character is whitespace.
 
static bool isDigit (char character) noexcept
 Checks whether a character is a digit.
 
static bool isDigit (juce_wchar character) noexcept
 Checks whether a character is a digit.
 
static bool isLetter (char character) noexcept
 Checks whether a character is alphabetic.
 
static bool isLetter (juce_wchar character) noexcept
 Checks whether a character is alphabetic.
 
static bool isLetterOrDigit (char character) noexcept
 Checks whether a character is alphabetic or numeric.
 
static bool isLetterOrDigit (juce_wchar character) noexcept
 Checks whether a character is alphabetic or numeric.
 
static bool isPrintable (char character) noexcept
 Checks whether a character is a printable character, i.e.
 
static bool isPrintable (juce_wchar character) noexcept
 Checks whether a character is a printable character, i.e.
 
static int getHexDigitValue (juce_wchar digit) noexcept
 Returns 0 to 16 for '0' to 'F", or -1 for characters that aren't a legal hex digit.
 
static juce_wchar getUnicodeCharFromWindows1252Codepage (uint8 windows1252Char) noexcept
 Converts a byte of Windows 1252 codepage to unicode.
 
template<typename CharPointerType >
static double readDoubleValue (CharPointerType &text) noexcept
 Parses a character string to read a floating-point number.
 
template<typename CharPointerType >
static double getDoubleValue (CharPointerType text) noexcept
 Parses a character string, to read a floating-point value.
 
template<typename IntType , typename CharPointerType >
static IntType getIntValue (const CharPointerType text) noexcept
 Parses a character string, to read an integer value.
 
template<typename CharPointerType >
static size_t lengthUpTo (CharPointerType text, const size_t maxCharsToCount) noexcept
 Counts the number of characters in a given string, stopping if the count exceeds a specified limit.
 
template<typename CharPointerType >
static size_t lengthUpTo (CharPointerType start, const CharPointerType end) noexcept
 Counts the number of characters in a given string, stopping if the count exceeds a specified end-pointer.
 
template<typename DestCharPointerType , typename SrcCharPointerType >
static void copyAll (DestCharPointerType &dest, SrcCharPointerType src) noexcept
 Copies null-terminated characters from one string to another.
 
template<typename DestCharPointerType , typename SrcCharPointerType >
static size_t copyWithDestByteLimit (DestCharPointerType &dest, SrcCharPointerType src, size_t maxBytesToWrite) noexcept
 Copies characters from one string to another, up to a null terminator or a given byte size limit.
 
template<typename DestCharPointerType , typename SrcCharPointerType >
static void copyWithCharLimit (DestCharPointerType &dest, SrcCharPointerType src, int maxChars) noexcept
 Copies characters from one string to another, up to a null terminator or a given maximum number of characters.
 
static int compare (juce_wchar char1, juce_wchar char2) noexcept
 Compares two characters.
 
template<typename CharPointerType1 , typename CharPointerType2 >
static int compare (CharPointerType1 s1, CharPointerType2 s2) noexcept
 Compares two null-terminated character strings.
 
template<typename CharPointerType1 , typename CharPointerType2 >
static int compareUpTo (CharPointerType1 s1, CharPointerType2 s2, int maxChars) noexcept
 Compares two null-terminated character strings, up to a given number of characters.
 
static int compareIgnoreCase (juce_wchar char1, juce_wchar char2) noexcept
 Compares two characters, using a case-independant match.
 
template<typename CharPointerType1 , typename CharPointerType2 >
static int compareIgnoreCase (CharPointerType1 s1, CharPointerType2 s2) noexcept
 Compares two null-terminated character strings, using a case-independant match.
 
template<typename CharPointerType1 , typename CharPointerType2 >
static int compareIgnoreCaseUpTo (CharPointerType1 s1, CharPointerType2 s2, int maxChars) noexcept
 Compares two null-terminated character strings, using a case-independent match.
 
template<typename CharPointerType1 , typename CharPointerType2 >
static int indexOf (CharPointerType1 textToSearch, const CharPointerType2 substringToLookFor) noexcept
 Finds the character index of a given substring in another string.
 
template<typename CharPointerType1 , typename CharPointerType2 >
static CharPointerType1 find (CharPointerType1 textToSearch, const CharPointerType2 substringToLookFor) noexcept
 Returns a pointer to the first occurrence of a substring in a string.
 
template<typename CharPointerType >
static CharPointerType find (CharPointerType textToSearch, const juce_wchar charToLookFor) noexcept
 Returns a pointer to the first occurrence of a substring in a string.
 
template<typename CharPointerType1 , typename CharPointerType2 >
static int indexOfIgnoreCase (CharPointerType1 haystack, const CharPointerType2 needle) noexcept
 Finds the character index of a given substring in another string, using a case-independent match.
 
template<typename Type >
static int indexOfChar (Type text, const juce_wchar charToFind) noexcept
 Finds the character index of a given character in another string.
 
template<typename Type >
static int indexOfCharIgnoreCase (Type text, juce_wchar charToFind) noexcept
 Finds the character index of a given character in another string, using a case-independent match.
 
template<typename Type >
static void incrementToEndOfWhitespace (Type &text) noexcept
 Increments a pointer until it points to the first non-whitespace character in a string.
 
template<typename Type >
static Type findEndOfWhitespace (Type text) noexcept
 Returns a pointer to the first non-whitespace character in a string.
 
template<typename Type , typename BreakType >
static Type findEndOfToken (Type text, BreakType breakCharacters, Type quoteCharacters)
 Returns a pointer to the first character in the string which is found in the breakCharacters string.
 

Detailed Description

A collection of functions for manipulating characters and character strings.

Most of these methods are designed for internal use by the String and CharPointer classes, but some of them may be useful to call directly.

See also
String, CharPointer_UTF8, CharPointer_UTF16, CharPointer_UTF32

@tags{Core}

Definition at line 91 of file juce_CharacterFunctions.h.

Member Function Documentation

◆ compare() [1/2]

static int juce::CharacterFunctions::compare ( CharPointerType1  s1,
CharPointerType2  s2 
)
staticnoexcept

Compares two null-terminated character strings.

Definition at line 606 of file juce_CharacterFunctions.h.

◆ compare() [2/2]

static int juce::CharacterFunctions::compare ( juce_wchar  char1,
juce_wchar  char2 
)
staticnoexcept

Compares two characters.

Definition at line 596 of file juce_CharacterFunctions.h.

◆ compareIgnoreCase() [1/2]

static int juce::CharacterFunctions::compareIgnoreCase ( CharPointerType1  s1,
CharPointerType2  s2 
)
staticnoexcept

Compares two null-terminated character strings, using a case-independant match.

Definition at line 648 of file juce_CharacterFunctions.h.

◆ compareIgnoreCase() [2/2]

static int juce::CharacterFunctions::compareIgnoreCase ( juce_wchar  char1,
juce_wchar  char2 
)
staticnoexcept

Compares two characters, using a case-independant match.

Definition at line 641 of file juce_CharacterFunctions.h.

◆ compareIgnoreCaseUpTo()

static int juce::CharacterFunctions::compareIgnoreCaseUpTo ( CharPointerType1  s1,
CharPointerType2  s2,
int  maxChars 
)
staticnoexcept

Compares two null-terminated character strings, using a case-independent match.

Definition at line 666 of file juce_CharacterFunctions.h.

◆ compareUpTo()

static int juce::CharacterFunctions::compareUpTo ( CharPointerType1  s1,
CharPointerType2  s2,
int  maxChars 
)
staticnoexcept

Compares two null-terminated character strings, up to a given number of characters.

Definition at line 624 of file juce_CharacterFunctions.h.

◆ copyAll()

static void juce::CharacterFunctions::copyAll ( DestCharPointerType dest,
SrcCharPointerType  src 
)
staticnoexcept

Copies null-terminated characters from one string to another.

Definition at line 542 of file juce_CharacterFunctions.h.

◆ copyWithCharLimit()

static void juce::CharacterFunctions::copyWithCharLimit ( DestCharPointerType dest,
SrcCharPointerType  src,
int  maxChars 
)
staticnoexcept

Copies characters from one string to another, up to a null terminator or a given maximum number of characters.

Definition at line 580 of file juce_CharacterFunctions.h.

◆ copyWithDestByteLimit()

static size_t juce::CharacterFunctions::copyWithDestByteLimit ( DestCharPointerType dest,
SrcCharPointerType  src,
size_t  maxBytesToWrite 
)
staticnoexcept

Copies characters from one string to another, up to a null terminator or a given byte size limit.

Definition at line 553 of file juce_CharacterFunctions.h.

◆ find() [1/2]

template<typename CharPointerType >
static CharPointerType juce::CharacterFunctions::find ( CharPointerType  textToSearch,
const juce_wchar  charToLookFor 
)
staticnoexcept

Returns a pointer to the first occurrence of a substring in a string.

If the substring is not found, this will return a pointer to the string's null terminator.

Definition at line 724 of file juce_CharacterFunctions.h.

◆ find() [2/2]

static CharPointerType1 juce::CharacterFunctions::find ( CharPointerType1  textToSearch,
const CharPointerType2  substringToLookFor 
)
staticnoexcept

Returns a pointer to the first occurrence of a substring in a string.

If the substring is not found, this will return a pointer to the string's null terminator.

Definition at line 708 of file juce_CharacterFunctions.h.

◆ findEndOfToken()

template<typename Type , typename BreakType >
static Type juce::CharacterFunctions::findEndOfToken ( Type  text,
BreakType  breakCharacters,
Type  quoteCharacters 
)
static

Returns a pointer to the first character in the string which is found in the breakCharacters string.

Definition at line 828 of file juce_CharacterFunctions.h.

◆ findEndOfWhitespace()

template<typename Type >
static Type juce::CharacterFunctions::findEndOfWhitespace ( Type  text)
staticnoexcept

Returns a pointer to the first non-whitespace character in a string.

If the string contains only whitespace, this will return a pointer to its null terminator.

Definition at line 818 of file juce_CharacterFunctions.h.

◆ getDoubleValue()

template<typename CharPointerType >
static double juce::CharacterFunctions::getDoubleValue ( CharPointerType  text)
staticnoexcept

Parses a character string, to read a floating-point value.

Definition at line 457 of file juce_CharacterFunctions.h.

◆ getHexDigitValue()

int juce::CharacterFunctions::getHexDigitValue ( juce_wchar  digit)
staticnoexcept

Returns 0 to 16 for '0' to 'F", or -1 for characters that aren't a legal hex digit.

Definition at line 112 of file juce_CharacterFunctions.cpp.

◆ getIntValue()

template<typename IntType , typename CharPointerType >
static IntType juce::CharacterFunctions::getIntValue ( const CharPointerType  text)
staticnoexcept

Parses a character string, to read an integer value.

Definition at line 465 of file juce_CharacterFunctions.h.

◆ getUnicodeCharFromWindows1252Codepage()

juce_wchar juce::CharacterFunctions::getUnicodeCharFromWindows1252Codepage ( uint8  windows1252Char)
staticnoexcept

Converts a byte of Windows 1252 codepage to unicode.

Definition at line 164 of file juce_CharacterFunctions.cpp.

◆ incrementToEndOfWhitespace()

template<typename Type >
static void juce::CharacterFunctions::incrementToEndOfWhitespace ( Type &  text)
staticnoexcept

Increments a pointer until it points to the first non-whitespace character in a string.

If the string contains only whitespace, the pointer will point to the string's null terminator.

Definition at line 807 of file juce_CharacterFunctions.h.

◆ indexOf()

static int juce::CharacterFunctions::indexOf ( CharPointerType1  textToSearch,
const CharPointerType2  substringToLookFor 
)
staticnoexcept

Finds the character index of a given substring in another string.

Returns -1 if the substring is not found.

Definition at line 686 of file juce_CharacterFunctions.h.

◆ indexOfChar()

template<typename Type >
static int juce::CharacterFunctions::indexOfChar ( Type  text,
const juce_wchar  charToFind 
)
staticnoexcept

Finds the character index of a given character in another string.

Returns -1 if the character is not found.

Definition at line 763 of file juce_CharacterFunctions.h.

◆ indexOfCharIgnoreCase()

template<typename Type >
static int juce::CharacterFunctions::indexOfCharIgnoreCase ( Type  text,
juce_wchar  charToFind 
)
staticnoexcept

Finds the character index of a given character in another string, using a case-independent match.

Returns -1 if the character is not found.

Definition at line 783 of file juce_CharacterFunctions.h.

◆ indexOfIgnoreCase()

static int juce::CharacterFunctions::indexOfIgnoreCase ( CharPointerType1  haystack,
const CharPointerType2  needle 
)
staticnoexcept

Finds the character index of a given substring in another string, using a case-independent match.

Returns -1 if the substring is not found.

Definition at line 742 of file juce_CharacterFunctions.h.

◆ isDigit() [1/2]

bool juce::CharacterFunctions::isDigit ( char  character)
staticnoexcept

Checks whether a character is a digit.

Definition at line 69 of file juce_CharacterFunctions.cpp.

◆ isDigit() [2/2]

bool juce::CharacterFunctions::isDigit ( juce_wchar  character)
staticnoexcept

Checks whether a character is a digit.

Definition at line 74 of file juce_CharacterFunctions.cpp.

◆ isLetter() [1/2]

bool juce::CharacterFunctions::isLetter ( char  character)
staticnoexcept

Checks whether a character is alphabetic.

Definition at line 79 of file juce_CharacterFunctions.cpp.

◆ isLetter() [2/2]

bool juce::CharacterFunctions::isLetter ( juce_wchar  character)
staticnoexcept

Checks whether a character is alphabetic.

Definition at line 85 of file juce_CharacterFunctions.cpp.

◆ isLetterOrDigit() [1/2]

bool juce::CharacterFunctions::isLetterOrDigit ( char  character)
staticnoexcept

Checks whether a character is alphabetic or numeric.

Definition at line 90 of file juce_CharacterFunctions.cpp.

◆ isLetterOrDigit() [2/2]

bool juce::CharacterFunctions::isLetterOrDigit ( juce_wchar  character)
staticnoexcept

Checks whether a character is alphabetic or numeric.

Definition at line 97 of file juce_CharacterFunctions.cpp.

◆ isLowerCase()

bool juce::CharacterFunctions::isLowerCase ( juce_wchar  character)
staticnoexcept

Checks whether a unicode character is lower-case.

Definition at line 47 of file juce_CharacterFunctions.cpp.

◆ isPrintable() [1/2]

bool juce::CharacterFunctions::isPrintable ( char  character)
staticnoexcept

Checks whether a character is a printable character, i.e.

alphabetic, numeric, a punctuation character or a space.

Definition at line 102 of file juce_CharacterFunctions.cpp.

◆ isPrintable() [2/2]

bool juce::CharacterFunctions::isPrintable ( juce_wchar  character)
staticnoexcept

Checks whether a character is a printable character, i.e.

alphabetic, numeric, a punctuation character or a space.

Definition at line 107 of file juce_CharacterFunctions.cpp.

◆ isUpperCase()

bool juce::CharacterFunctions::isUpperCase ( juce_wchar  character)
staticnoexcept

Checks whether a unicode character is upper-case.

Definition at line 38 of file juce_CharacterFunctions.cpp.

◆ isWhitespace() [1/2]

JUCE_END_IGNORE_WARNINGS_MSVC bool juce::CharacterFunctions::isWhitespace ( char  character)
staticnoexcept

Checks whether a character is whitespace.

Definition at line 59 of file juce_CharacterFunctions.cpp.

◆ isWhitespace() [2/2]

bool juce::CharacterFunctions::isWhitespace ( juce_wchar  character)
staticnoexcept

Checks whether a character is whitespace.

Definition at line 64 of file juce_CharacterFunctions.cpp.

◆ lengthUpTo() [1/2]

template<typename CharPointerType >
static size_t juce::CharacterFunctions::lengthUpTo ( CharPointerType  start,
const CharPointerType  end 
)
staticnoexcept

Counts the number of characters in a given string, stopping if the count exceeds a specified end-pointer.

Definition at line 530 of file juce_CharacterFunctions.h.

◆ lengthUpTo() [2/2]

template<typename CharPointerType >
static size_t juce::CharacterFunctions::lengthUpTo ( CharPointerType  text,
const size_t  maxCharsToCount 
)
staticnoexcept

Counts the number of characters in a given string, stopping if the count exceeds a specified limit.

Definition at line 517 of file juce_CharacterFunctions.h.

◆ readDoubleValue()

template<typename CharPointerType >
static double juce::CharacterFunctions::readDoubleValue ( CharPointerType &  text)
staticnoexcept

Parses a character string to read a floating-point number.

Note that this will advance the pointer that is passed in, leaving it at the end of the number.

Definition at line 147 of file juce_CharacterFunctions.h.

◆ toLowerCase()

juce_wchar juce::CharacterFunctions::toLowerCase ( juce_wchar  character)
staticnoexcept

Converts a character to lower-case.

Definition at line 33 of file juce_CharacterFunctions.cpp.

◆ toUpperCase()

juce_wchar juce::CharacterFunctions::toUpperCase ( juce_wchar  character)
staticnoexcept

Converts a character to upper-case.

Definition at line 28 of file juce_CharacterFunctions.cpp.


The documentation for this class was generated from the following files: