OpenShot Audio Library | OpenShotAudio: juce_PropertySet.h Source File

OpenShot Audio Library | OpenShotAudio 0.3.0

Loading...
Searching...
No Matches
juce_PropertySet.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 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 (const String& keyName, const var& value);
125
133 void setValue (const String& 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
202 JUCE_LEAK_DETECTOR (PropertySet)
203};
204
205} // namespace juce
juce::CriticalSection
Definition: juce_CriticalSection.h:43
juce::PropertySet
Definition: juce_PropertySet.h:39
juce::PropertySet::getAllProperties
StringPairArray & getAllProperties() noexcept
Definition: juce_PropertySet.h:154
juce::PropertySet::getLock
const CriticalSection & getLock() const noexcept
Definition: juce_PropertySet.h:157
juce::PropertySet::getFallbackPropertySet
PropertySet * getFallbackPropertySet() const noexcept
Definition: juce_PropertySet.h:190
juce::StringPairArray
Definition: juce_StringPairArray.h:35
juce::StringRef
Definition: juce_StringRef.h:62
juce::String
Definition: juce_String.h:39
juce::XmlElement
Definition: juce_XmlElement.h:138
juce::var
Definition: juce_Variant.h:42