openshot-audio  0.1.7
juce_StringPairArray.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_STRINGPAIRARRAY_H_INCLUDED
30 #define JUCE_STRINGPAIRARRAY_H_INCLUDED
31 
32 
33 //==============================================================================
40 {
41 public:
42  //==============================================================================
44  StringPairArray (bool ignoreCaseWhenComparingKeys = true);
45 
47  StringPairArray (const StringPairArray& other);
48 
50  ~StringPairArray();
51 
53  StringPairArray& operator= (const StringPairArray& other);
54 
55  //==============================================================================
60  bool operator== (const StringPairArray& other) const;
61 
66  bool operator!= (const StringPairArray& other) const;
67 
68  //==============================================================================
80  const String& operator[] (StringRef key) const;
81 
86  String getValue (StringRef, const String& defaultReturnValue) const;
87 
89  bool containsKey (StringRef key) const noexcept;
90 
92  const StringArray& getAllKeys() const noexcept { return keys; }
93 
95  const StringArray& getAllValues() const noexcept { return values; }
96 
98  inline int size() const noexcept { return keys.size(); };
99 
100 
101  //==============================================================================
106  void set (const String& key, const String& value);
107 
111  void addArray (const StringPairArray& other);
112 
113  //==============================================================================
115  void clear();
116 
120  void remove (StringRef key);
121 
125  void remove (int index);
126 
127  //==============================================================================
130  void setIgnoresCase (bool shouldIgnoreCase);
131 
132  //==============================================================================
136  String getDescription() const;
137 
138  //==============================================================================
145  void minimiseStorageOverheads();
146 
147 
148 private:
149  //==============================================================================
150  StringArray keys, values;
151  bool ignoreCase;
152 
154 };
155 
156 
157 #endif // JUCE_STRINGPAIRARRAY_H_INCLUDED
Definition: juce_StringPairArray.h:39
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
const StringArray & getAllKeys() const noexcept
Definition: juce_StringPairArray.h:92
const StringArray & getAllValues() const noexcept
Definition: juce_StringPairArray.h:95
int size() const noexcept
Definition: juce_StringPairArray.h:98
Definition: juce_StringArray.h:39
bool operator==(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:565
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
bool operator!=(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:566
Definition: juce_StringRef.h:65