JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_Identifier.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
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//==============================================================================
38class JUCE_API Identifier final
39{
40public:
42 Identifier() noexcept;
43
48 Identifier (const char* name);
49
54 Identifier (const String& name);
55
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
121
126 static bool isValidIdentifier (const String& possibleIdentifier) noexcept;
127
128private:
129 String name;
130};
131
132} // namespace juce
Wraps a pointer to a null-terminated UTF-8 character string, and provides various methods to operate ...
Represents a string identifier, designed for accessing properties by name.
bool isNull() const noexcept
Returns true if this Identifier is null.
String::CharPointerType getCharPointer() const noexcept
Returns this identifier's raw string pointer.
bool isValid() const noexcept
Returns true if this Identifier is not null.
const String & toString() const noexcept
Returns this identifier as a string.
static Identifier null
A null identifier.
A simple class for holding temporary references to a string literal or String.
The JUCE String class!
Definition juce_String.h:53
CharPointerType getCharPointer() const noexcept
Returns the character pointer currently being used to store this string.
JUCE Namespace.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88