Loading...
Searching...
No Matches
juce::Identifier Class Referencefinal

## Detailed Description

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.

See also
  NamedValueSet, ValueTree

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

- juce_core/text/juce_Identifier.h

## Public Member Functions

| Identifier () noexcept
| Creates a null identifier.
| Identifier (const char *name)
| Creates an identifier with a specified name.
| Identifier (const String &name)
| Creates an identifier with a specified name.
| Identifier (String::CharPointerType nameStart, String::CharPointerType nameEnd)
| Creates an identifier with a specified name.
| Identifier (const Identifier &other) noexcept
| Creates a copy of another identifier.
Identifier & | operator= (const Identifier &other) noexcept
| Creates a copy of another identifier.
| Identifier (Identifier &&other) noexcept
| Creates a copy of another identifier.
Identifier & | operator= (Identifier &&other) noexcept
| Creates a copy of another identifier.
| ~Identifier () noexcept
| Destructor.
bool | operator== (const Identifier &other) const noexcept
| Compares two identifiers.
bool | operator!= (const Identifier &other) const noexcept
| Compares two identifiers.
bool | operator== (StringRef other) const noexcept
| Compares the identifier with a string.
bool | operator!= (StringRef other) const noexcept
| Compares the identifier with a string.
bool | operator< (StringRef other) const noexcept
| Compares the identifier with a string.
bool | operator<= (StringRef other) const noexcept
| Compares the identifier with a string.
bool | operator> (StringRef other) const noexcept
| Compares the identifier with a string.
bool | operator>= (StringRef other) const noexcept
| Compares the identifier with a string.
const String & | toString () const noexcept
| Returns this identifier as a string.
| operator String::CharPointerType () const noexcept
| Returns this identifier's raw string pointer.
String::CharPointerType | getCharPointer () const noexcept
| Returns this identifier's raw string pointer.
| operator StringRef () const noexcept
| Returns this identifier as a StringRef.
bool | isValid () const noexcept
| Returns true if this Identifier is not null.
bool | isNull () const noexcept
| Returns true if this Identifier is null.

## 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.

## Static Public Attributes

static Identifier | null
| A null identifier.

## Constructors and Destructors

## Identifier() [1/6]

juce::Identifier::Identifier | ( |  | ) |

noexcept

Creates a null identifier.

Referenced by Identifier(), Identifier(), Identifier(), Identifier(), Identifier(), operator!=(), operator=(), operator=(), operator==(), and ~Identifier().

## Identifier() [2/6]

juce::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.

References Identifier().

## Identifier() [3/6]

juce::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.

References Identifier().

## Identifier() [4/6]

juce::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.

References Identifier(), and operator String::CharPointerType().

## Identifier() [5/6]

juce::Identifier::Identifier | ( | const Identifier & | other | ) |

noexcept

Creates a copy of another identifier.

References Identifier().

## Identifier() [6/6]

juce::Identifier::Identifier | ( | Identifier && | other | ) |

noexcept

Creates a copy of another identifier.

References Identifier().

## ~Identifier()

juce::Identifier::~Identifier | ( |  | ) |

noexcept

Destructor.

References Identifier().

## Member Functions

## operator=() [1/2]

Identifier & juce::Identifier::operator= | ( | const Identifier & | other | ) |

noexcept

Creates a copy of another identifier.

References Identifier().

## operator=() [2/2]

Identifier & juce::Identifier::operator= | ( | Identifier && | other | ) |

noexcept

Creates a copy of another identifier.

References Identifier().

## operator==() [1/2]

bool juce::Identifier::operator== | ( | const Identifier & | other | ) | const

inline noexcept

Compares two identifiers.

This is a very fast operation.

References Identifier().

## operator!=() [1/2]

bool juce::Identifier::operator!= | ( | const Identifier & | other | ) | const

inline noexcept

Compares two identifiers.

This is a very fast operation.

References Identifier().

## operator==() [2/2]

bool juce::Identifier::operator== | ( | StringRef | other | ) | const

inline noexcept

Compares the identifier with a string.

## operator!=() [2/2]

bool juce::Identifier::operator!= | ( | StringRef | other | ) | const

inline noexcept

Compares the identifier with a string.

## operator<()

bool juce::Identifier::operator< | ( | StringRef | other | ) | const

inline noexcept

Compares the identifier with a string.

## operator<=()

bool juce::Identifier::operator<= | ( | StringRef | other | ) | const

inline noexcept

Compares the identifier with a string.

## operator>()

bool juce::Identifier::operator> | ( | StringRef | other | ) | const

inline noexcept

Compares the identifier with a string.

## operator>=()

bool juce::Identifier::operator>= | ( | StringRef | other | ) | const

inline noexcept

Compares the identifier with a string.

## toString()

const String & juce::Identifier::toString | ( |  | ) | const

inline noexcept

Returns this identifier as a string.

## operator String::CharPointerType()

juce::Identifier::operator String::CharPointerType | ( |  | ) | const

inline noexcept

Returns this identifier's raw string pointer.

Referenced by Identifier().

## getCharPointer()

String::CharPointerType juce::Identifier::getCharPointer | ( |  | ) | const

inline noexcept

Returns this identifier's raw string pointer.

## operator StringRef()

juce::Identifier::operator StringRef | ( |  | ) | const

inline noexcept

Returns this identifier as a StringRef.

## isValid()

bool juce::Identifier::isValid | ( |  | ) | const

inline noexcept

Returns true if this Identifier is not null.

## isNull()

bool juce::Identifier::isNull | ( |  | ) | const

inline noexcept

Returns true if this Identifier is null.

## isValidIdentifier()

bool juce::Identifier::isValidIdentifier | ( | const String & | possibleIdentifier | ) |

static noexcept

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.

## Member Data Documentation

## null

Identifier juce::Identifier::null

static

A null identifier.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited