LMMS
Loading...
Searching...
No Matches
juce_NamedValueSet.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//==============================================================================
35{
36public:
37 //==============================================================================
40 {
41 NamedValue() noexcept;
42 ~NamedValue() noexcept;
43
44 NamedValue (const Identifier& name, const var& value);
45 NamedValue (const Identifier& name, var&& value) noexcept;
46 NamedValue (Identifier&& name, var&& value) noexcept;
47
48 NamedValue (const NamedValue&);
49 NamedValue (NamedValue&&) noexcept;
50 NamedValue& operator= (NamedValue&&) noexcept;
51
52 bool operator== (const NamedValue&) const noexcept;
53 bool operator!= (const NamedValue&) const noexcept;
54
57 };
58
59 //==============================================================================
62
65 NamedValueSet& operator= (const NamedValueSet&);
67
69 NamedValueSet (std::initializer_list<NamedValue>);
70
73
77 bool operator== (const NamedValueSet&) const noexcept;
78 bool operator!= (const NamedValueSet&) const noexcept;
79
82
83 //==============================================================================
85 int size() const noexcept;
86
88 bool isEmpty() const noexcept;
89
94
98 var getWithDefault (const Identifier& name, const var& defaultReturnValue) const;
99
104 bool set (const Identifier& name, const var& newValue);
105
110 bool set (const Identifier& name, var&& newValue);
111
113 bool contains (const Identifier& name) const noexcept;
114
119 bool remove (const Identifier& name);
120
124 Identifier getName (int index) const noexcept;
125
134 var* getVarPointer (const Identifier& name) noexcept;
135
144 const var* getVarPointer (const Identifier& name) const noexcept;
145
149 const var& getValueAt (int index) const noexcept;
150
156 var* getVarPointerAt (int index) noexcept;
157
163 const var* getVarPointerAt (int index) const noexcept;
164
166 int indexOf (const Identifier& name) const noexcept;
167
169 void clear();
170
171 //==============================================================================
173 void setFromXmlAttributes (const XmlElement& xml);
174
178 void copyToXmlAttributes (XmlElement& xml) const;
179
180private:
181 //==============================================================================
183};
184
185} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_Array.h:56
Definition juce_Identifier.h:39
const NamedValueSet::NamedValue * begin() const noexcept
Definition juce_NamedValueSet.h:80
const NamedValueSet::NamedValue * end() const noexcept
Definition juce_NamedValueSet.h:81
NamedValueSet() noexcept
Definition juce_NamedValueSet.cpp:58
Array< NamedValue > values
Definition juce_NamedValueSet.h:182
Definition juce_XmlElement.h:83
Definition juce_Variant.h:42
static const char * name
Definition pugl.h:1582
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
Definition juce_Uuid.h:141
Definition juce_NamedValueSet.h:40
var value
Definition juce_NamedValueSet.h:56
Identifier name
Definition juce_NamedValueSet.h:55
NamedValue() noexcept
Definition juce_NamedValueSet.cpp:26
ulg size
Definition extract.c:2350
#define const
Definition zconf.h:137