JUCE
|
Represents a string identifier, designed for accessing properties by name. More...
Public Member Functions | |
Identifier () noexcept | |
Creates a null identifier. More... | |
Identifier (const char *name) | |
Creates an identifier with a specified name. More... | |
Identifier (const String &name) | |
Creates an identifier with a specified name. More... | |
Identifier (String::CharPointerType nameStart, String::CharPointerType nameEnd) | |
Creates an identifier with a specified name. More... | |
Identifier (const Identifier &other) noexcept | |
Creates a copy of another identifier. More... | |
Identifier & | operator= (const Identifier &other) noexcept |
Creates a copy of another identifier. More... | |
Identifier (Identifier &&other) noexcept | |
Creates a copy of another identifier. More... | |
Identifier & | operator= (Identifier &&other) noexcept |
Creates a copy of another identifier. More... | |
~Identifier () noexcept | |
Destructor. More... | |
bool | operator== (const Identifier &other) const noexcept |
Compares two identifiers. More... | |
bool | operator!= (const Identifier &other) const noexcept |
Compares two identifiers. More... | |
bool | operator== (StringRef other) const noexcept |
Compares the identifier with a string. More... | |
bool | operator!= (StringRef other) const noexcept |
Compares the identifier with a string. More... | |
bool | operator< (StringRef other) const noexcept |
Compares the identifier with a string. More... | |
bool | operator<= (StringRef other) const noexcept |
Compares the identifier with a string. More... | |
bool | operator> (StringRef other) const noexcept |
Compares the identifier with a string. More... | |
bool | operator>= (StringRef other) const noexcept |
Compares the identifier with a string. More... | |
const String & | toString () const noexcept |
Returns this identifier as a string. More... | |
operator String::CharPointerType () const noexcept | |
Returns this identifier's raw string pointer. More... | |
String::CharPointerType | getCharPointer () const noexcept |
Returns this identifier's raw string pointer. More... | |
operator StringRef () const noexcept | |
Returns this identifier as a StringRef. More... | |
bool | isValid () const noexcept |
Returns true if this Identifier is not null. More... | |
bool | isNull () const noexcept |
Returns true if this Identifier is null. More... | |
Static Public Member Functions | |
static bool | isValidIdentifier (const String &possibleIdentifier) noexcept |
Checks a given string for characters that might not be valid in an Identifier. More... | |
Static Public Attributes | |
static Identifier | null |
A null identifier. More... | |
Represents a string identifier, designed for accessing properties by name.
Comparing two Identifier objects is very fast (an O(1) operation), but creating them can be slower than just using a String directly, so the optimal way to use them is to keep some static Identifier objects for the things you use often.
|
noexcept |
Creates a null identifier.
Identifier::Identifier | ( | const char * | name | ) |
Creates an identifier with a specified name.
Because this name may need to be used in contexts such as script variables or XML tags, it must only contain ascii letters and digits, or the underscore character.
Identifier::Identifier | ( | const String & | name | ) |
Creates an identifier with a specified name.
Because this name may need to be used in contexts such as script variables or XML tags, it must only contain ascii letters and digits, or the underscore character.
Identifier::Identifier | ( | String::CharPointerType | nameStart, |
String::CharPointerType | nameEnd | ||
) |
Creates an identifier with a specified name.
Because this name may need to be used in contexts such as script variables or XML tags, it must only contain ascii letters and digits, or the underscore character.
|
noexcept |
Creates a copy of another identifier.
|
noexcept |
Creates a copy of another identifier.
|
noexcept |
Destructor.
|
noexcept |
Creates a copy of another identifier.
|
noexcept |
Creates a copy of another identifier.
|
noexcept |
|
noexcept |
|
noexcept |
Compares the identifier with a string.
|
noexcept |
Compares the identifier with a string.
|
noexcept |
Compares the identifier with a string.
|
noexcept |
Compares the identifier with a string.
|
noexcept |
Compares the identifier with a string.
|
noexcept |
Compares the identifier with a string.
|
noexcept |
Returns this identifier as a string.
|
noexcept |
Returns this identifier's raw string pointer.
References String::getCharPointer().
|
noexcept |
Returns this identifier's raw string pointer.
References String::getCharPointer().
|
noexcept |
Returns true if this Identifier is not null.
References String::isNotEmpty().
|
noexcept |
Returns true if this Identifier is null.
References String::isEmpty().
|
staticnoexcept |
Checks a given string for characters that might not be valid in an Identifier.
Since Identifiers are used as a script variables and XML attributes, they should only contain alphanumeric characters, underscores, or the '-' and ':' characters.
|
static |
A null identifier.