Loading...
Searching...
No Matches
juce_Identifier.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API Identifier final
{
public:
Identifier() noexcept;
Identifier (const char* name);
Identifier (const String& name);
Identifier (String::CharPointerType nameStart, String::CharPointerType nameEnd);
Identifier (const Identifier& other) noexcept;
Identifier& operator= (const Identifier& other) noexcept;
Identifier (Identifier&& other) noexcept;
Identifier& operator= (Identifier&& other) noexcept;
~Identifier() noexcept;
inline bool operator== (const Identifier& other) const noexcept { return name.getCharPointer() == other.name.getCharPointer(); }
inline bool operator!= (const Identifier& other) const noexcept { return name.getCharPointer() != other.name.getCharPointer(); }
inline bool operator== (StringRef other) const noexcept { return name == other; }
inline bool operator!= (StringRef other) const noexcept { return name != other; }
inline bool operator< (StringRef other) const noexcept { return name < other; }
inline bool operator<= (StringRef other) const noexcept { return name <= other; }
inline bool operator> (StringRef other) const noexcept { return name > other; }
inline bool operator>= (StringRef other) const noexcept { return name >= other; }
const String& toString() const noexcept { return name; }
operator String::CharPointerType() const noexcept { return name.getCharPointer(); }
String::CharPointerType getCharPointer() const noexcept { return name.getCharPointer(); }
operator StringRef() const noexcept { return name; }
bool isValid() const noexcept { return name.isNotEmpty(); }
bool isNull() const noexcept { return name.isEmpty(); }
static Identifier null;
static bool isValidIdentifier (const String& possibleIdentifier) noexcept;
private:
String name;
};
} // namespace juce
juce::Identifier::Identifier
Identifier() noexcept
Definition juce_Identifier.cpp:26
juce::Identifier::isNull
bool isNull() const noexcept
Definition juce_Identifier.h:117
juce::Identifier::getCharPointer
String::CharPointerType getCharPointer() const noexcept
Definition juce_Identifier.h:108
juce::Identifier::isValid
bool isValid() const noexcept
Definition juce_Identifier.h:114
juce::Identifier::toString
const String & toString() const noexcept
Definition juce_Identifier.h:102
juce::Identifier::null
static Identifier null
Definition juce_Identifier.h:120
juce::Identifier::isValidIdentifier
static bool isValidIdentifier(const String &possibleIdentifier) noexcept
Definition juce_Identifier.cpp:68
juce::StringRef
Definition juce_StringRef.h:62
juce::String
Definition juce_String.h:53
juce::String::getCharPointer
CharPointerType getCharPointer() const noexcept
Definition juce_String.h:1153