openshot-audio  0.1.6
juce_NamedValueSet.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the juce_core module of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission to use, copy, modify, and/or distribute this software for any purpose with
8  or without fee is hereby granted, provided that the above copyright notice and this
9  permission notice appear in all copies.
10 
11  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
12  TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
13  NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
15  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
16  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 
18  ------------------------------------------------------------------------------
19 
20  NOTE! This permissive ISC license applies ONLY to files within the juce_core module!
21  All other JUCE modules are covered by a dual GPL/commercial license, so if you are
22  using any other modules, be sure to check that you also comply with their license.
23 
24  For more details, visit www.juce.com
25 
26  ==============================================================================
27 */
28 
29 #ifndef JUCE_NAMEDVALUESET_H_INCLUDED
30 #define JUCE_NAMEDVALUESET_H_INCLUDED
31 
32 
33 //==============================================================================
40 {
41 public:
44 
47 
49  NamedValueSet& operator= (const NamedValueSet&);
50 
51  #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
53  NamedValueSet& operator= (NamedValueSet&&) noexcept;
54  #endif
55 
58 
59  bool operator== (const NamedValueSet&) const;
60  bool operator!= (const NamedValueSet&) const;
61 
62  //==============================================================================
64  int size() const noexcept;
65 
70  const var& operator[] (const Identifier& name) const noexcept;
71 
75  var getWithDefault (const Identifier& name, const var& defaultReturnValue) const;
76 
81  bool set (const Identifier& name, const var& newValue);
82 
83  #if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
84 
88  bool set (const Identifier& name, var&& newValue);
89  #endif
90 
92  bool contains (const Identifier& name) const noexcept;
93 
98  bool remove (const Identifier& name);
99 
103  Identifier getName (int index) const noexcept;
104 
111  var* getVarPointer (const Identifier& name) const noexcept;
112 
116  const var& getValueAt (int index) const noexcept;
117 
121  var* getVarPointerAt (int index) const noexcept;
122 
124  int indexOf (const Identifier& name) const noexcept;
125 
127  void clear();
128 
129  //==============================================================================
131  void setFromXmlAttributes (const XmlElement& xml);
132 
136  void copyToXmlAttributes (XmlElement& xml) const;
137 
138 private:
139  //==============================================================================
140  struct NamedValue;
141  Array<NamedValue> values;
142 };
143 
144 
145 #endif // JUCE_NAMEDVALUESET_H_INCLUDED
Definition: juce_Variant.h:46
#define noexcept
Definition: juce_CompilerSupport.h:141
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_XmlElement.h:142
Definition: juce_NamedValueSet.h:39
Definition: juce_NamedValueSet.cpp:29
bool operator==(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:565
Definition: juce_Array.h:60
bool operator!=(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:566
Definition: juce_Identifier.h:43