LMMS
Loading...
Searching...
No Matches
water::Identifier Class Reference

#include <Identifier.h>

Public Member Functions

 Identifier () noexcept
 Identifier (const char *name)
 Identifier (const std::string &name)
 Identifier (const char *nameStart, const char *nameEnd)
 Identifier (const Identifier &other) noexcept
Identifieroperator= (const Identifier &other) noexcept
 ~Identifier () noexcept
bool operator== (const Identifier &other) const noexcept
bool operator!= (const Identifier &other) const noexcept
bool operator== (const char *other) const noexcept
bool operator!= (const char *other) const noexcept
bool operator< (const char *other) const noexcept
bool operator<= (const char *other) const noexcept
bool operator> (const char *other) const noexcept
bool operator>= (const char *other) const noexcept
const std::string & toString () const noexcept
 operator StringRef () const noexcept
bool isValid () const noexcept
bool isNull () const noexcept

Private Attributes

std::string name

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

Constructor & Destructor Documentation

◆ Identifier() [1/5]

water::Identifier::Identifier ( )
noexcept

Creates a null identifier.

◆ Identifier() [2/5]

water::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() [3/5]

water::Identifier::Identifier ( const std::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() [4/5]

water::Identifier::Identifier ( const char * nameStart,
const char * 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.

◆ Identifier() [5/5]

water::Identifier::Identifier ( const Identifier & other)
noexcept

Creates a copy of another identifier.

◆ ~Identifier()

water::Identifier::~Identifier ( )
noexcept

Destructor

Member Function Documentation

◆ isNull()

bool water::Identifier::isNull ( ) const
inlinenoexcept

Returns true if this Identifier is null

◆ isValid()

bool water::Identifier::isValid ( ) const
inlinenoexcept

Returns true if this Identifier is not null

◆ operator StringRef()

water::Identifier::operator StringRef ( ) const
inlinenoexcept

Returns this identifier as a StringRef.

◆ operator!=() [1/2]

bool water::Identifier::operator!= ( const char * other) const
inlinenoexcept

Compares the identifier with a string.

◆ operator!=() [2/2]

bool water::Identifier::operator!= ( const Identifier & other) const
inlinenoexcept

Compares two identifiers. This is a very fast operation.

◆ operator<()

bool water::Identifier::operator< ( const char * other) const
inlinenoexcept

Compares the identifier with a string.

◆ operator<=()

bool water::Identifier::operator<= ( const char * other) const
inlinenoexcept

Compares the identifier with a string.

◆ operator=()

Identifier & water::Identifier::operator= ( const Identifier & other)
noexcept

Creates a copy of another identifier.

◆ operator==() [1/2]

bool water::Identifier::operator== ( const char * other) const
inlinenoexcept

Compares the identifier with a string.

◆ operator==() [2/2]

bool water::Identifier::operator== ( const Identifier & other) const
inlinenoexcept

Compares two identifiers. This is a very fast operation.

◆ operator>()

bool water::Identifier::operator> ( const char * other) const
inlinenoexcept

Compares the identifier with a string.

◆ operator>=()

bool water::Identifier::operator>= ( const char * other) const
inlinenoexcept

Compares the identifier with a string.

◆ toString()

const std::string & water::Identifier::toString ( ) const
inlinenoexcept

Returns this identifier as a string.

Member Data Documentation

◆ name

std::string water::Identifier::name
private

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