OpenShot Audio Library | OpenShotAudio: juce_Identifier.h Source File

OpenShot Audio Library | OpenShotAudio 0.3.0

Loading...
Searching...
No Matches
juce_Identifier.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2017 - ROLI Ltd.
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
38 class JUCE_API Identifier final
39{
40public:
42 Identifier() noexcept;
43
48 Identifier (const char* name);
49
54 Identifier (const String& name);
55
60 Identifier (String::CharPointerType nameStart, String::CharPointerType nameEnd);
61
63 Identifier (const Identifier& other) noexcept;
64
66 Identifier& operator= (const Identifier& other) noexcept;
67
69 Identifier (Identifier&& other) noexcept;
70
72 Identifier& operator= (Identifier&& other) noexcept;
73
75 ~Identifier() noexcept;
76
78 inline bool operator== (const Identifier& other) const noexcept { return name.getCharPointer() == other.name.getCharPointer(); }
79
81 inline bool operator!= (const Identifier& other) const noexcept { return name.getCharPointer() != other.name.getCharPointer(); }
82
84 inline bool operator== (StringRef other) const noexcept { return name == other; }
85
87 inline bool operator!= (StringRef other) const noexcept { return name != other; }
88
90 inline bool operator< (StringRef other) const noexcept { return name < other; }
91
93 inline bool operator<= (StringRef other) const noexcept { return name <= other; }
94
96 inline bool operator> (StringRef other) const noexcept { return name > other; }
97
99 inline bool operator>= (StringRef other) const noexcept { return name >= other; }
100
102 const String& toString() const noexcept { return name; }
103
105 operator String::CharPointerType() const noexcept { return name.getCharPointer(); }
106
108 String::CharPointerType getCharPointer() const noexcept { return name.getCharPointer(); }
109
111 operator StringRef() const noexcept { return name; }
112
114 bool isValid() const noexcept { return name.isNotEmpty(); }
115
117 bool isNull() const noexcept { return name.isEmpty(); }
118
120 static Identifier null;
121
126 static bool isValidIdentifier (const String& possibleIdentifier) noexcept;
127
128private:
129 String name;
130};
131
132} // namespace juce
juce::Identifier
Definition: juce_Identifier.h:39
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::StringRef
Definition: juce_StringRef.h:62
juce::String
Definition: juce_String.h:39
juce::String::getCharPointer
CharPointerType getCharPointer() const noexcept
Definition: juce_String.h:1198