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_PropertySet.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 PropertySet
39{
40public:
41 //==============================================================================
46 PropertySet (bool ignoreCaseOfKeyNames = false);
47
49 PropertySet (const PropertySet& other);
50
52 PropertySet& operator= (const PropertySet& other);
53
55 virtual ~PropertySet();
56
57 //==============================================================================
67 String getValue (StringRef keyName, const String& defaultReturnValue = String()) const noexcept;
68
78 int getIntValue (StringRef keyName, int defaultReturnValue = 0) const noexcept;
79
89 double getDoubleValue (StringRef keyName, double defaultReturnValue = 0.0) const noexcept;
90
103 bool getBoolValue (StringRef keyName, bool defaultReturnValue = false) const noexcept;
104
116 std::unique_ptr<XmlElement> getXmlValue (StringRef keyName) const;
117
118 //==============================================================================
124 void setValue (StringRef keyName, const var& value);
125
133 void setValue (StringRef keyName, const XmlElement* xml);
134
138 void addAllPropertiesFrom (const PropertySet& source);
139
140 //==============================================================================
144 void removeValue (StringRef keyName);
145
147 bool containsKey (StringRef keyName) const noexcept;
148
150 void clear();
151
152 //==============================================================================
154 StringPairArray& getAllProperties() noexcept { return properties; }
155
157 const CriticalSection& getLock() const noexcept { return lock; }
158
159 //==============================================================================
164 std::unique_ptr<XmlElement> createXml (const String& nodeName) const;
165
170 void restoreFromXml (const XmlElement& xml);
171
172 //==============================================================================
185 void setFallbackPropertySet (PropertySet* fallbackProperties) noexcept;
186
190 PropertySet* getFallbackPropertySet() const noexcept { return fallbackProperties; }
191
192protected:
194 virtual void propertyChanged();
195
196private:
197 StringPairArray properties;
198 PropertySet* fallbackProperties;
199 CriticalSection lock;
200 bool ignoreCaseOfKeys;
201
203};
204
205} // namespace juce
A set of named property values, which can be strings, integers, floating point, etc.
StringPairArray & getAllProperties() noexcept
Returns the keys/value pair array containing all the properties.
const CriticalSection & getLock() const noexcept
Returns the lock used when reading or writing to this set.
PropertySet * getFallbackPropertySet() const noexcept
Returns the fallback property set.
A container for holding a set of strings which are keyed by another string.
A simple class for holding temporary references to a string literal or String.
The JUCE String class!
Definition juce_String.h:53
Used to build a tree of elements representing an XML document.
A variant class, that can be used to hold a range of primitive values.
#define JUCE_LEAK_DETECTOR(OwnerClass)
This macro lets you embed a leak-detecting object inside a class.
JUCE Namespace.