LMMS
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//==============================================================================
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
121
126 static bool isValidIdentifier (const String& possibleIdentifier) noexcept;
127
128private:
130};
131
132} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
#define final
Definition DistrhoDefines.h:74
Identifier() noexcept
Definition juce_Identifier.cpp:26
bool isNull() const noexcept
Definition juce_Identifier.h:117
String::CharPointerType getCharPointer() const noexcept
Definition juce_Identifier.h:108
bool isValid() const noexcept
Definition juce_Identifier.h:114
String name
Definition juce_Identifier.h:129
const String & toString() const noexcept
Definition juce_Identifier.h:102
static Identifier null
Definition juce_Identifier.h:120
static bool isValidIdentifier(const String &possibleIdentifier) noexcept
Definition juce_Identifier.cpp:68
Definition juce_String.h:53
CharPointerType getCharPointer() const noexcept
Definition juce_String.h:1153
Definition juce_StringRef.h:62
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
#define const
Definition zconf.h:137