OpenShot Audio Library | OpenShotAudio: juce_StringPairArray.h Source File

OpenShot Audio Library | OpenShotAudio 1.0.0

Loading...
Searching...
No Matches
juce_StringPairArray.h
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//==============================================================================
34 class JUCE_API StringPairArray
35{
36public:
37 //==============================================================================
39 StringPairArray (bool ignoreCaseWhenComparingKeys = true);
40
42 StringPairArray (const StringPairArray& other);
43
45 ~StringPairArray() = default;
46
48 StringPairArray& operator= (const StringPairArray& other);
49
50 //==============================================================================
55 bool operator== (const StringPairArray& other) const;
56
61 bool operator!= (const StringPairArray& other) const;
62
63 //==============================================================================
75 const String& operator[] (StringRef key) const;
76
81 String getValue (StringRef, const String& defaultReturnValue) const;
82
84 bool containsKey (StringRef key) const noexcept;
85
87 const StringArray& getAllKeys() const noexcept { return keys; }
88
90 const StringArray& getAllValues() const noexcept { return values; }
91
93 inline int size() const noexcept { return keys.size(); }
94
95
96 //==============================================================================
101 void set (const String& key, const String& value);
102
106 void addArray (const StringPairArray& other);
107
108 //==============================================================================
110 void clear();
111
115 void remove (StringRef key);
116
120 void remove (int index);
121
122 //==============================================================================
125 void setIgnoresCase (bool shouldIgnoreCase);
126
129 bool getIgnoresCase() const noexcept;
130
131 //==============================================================================
135 String getDescription() const;
136
137 //==============================================================================
144 void minimiseStorageOverheads();
145
146 //==============================================================================
148 void addMap (const std::map<String, String>& mapToAdd);
149
151 void addUnorderedMap (const std::unordered_map<String, String>& mapToAdd);
152
153private:
154 //==============================================================================
155 template <typename Map>
156 void addMapImpl (const Map& mapToAdd);
157
158 StringArray keys, values;
159 bool ignoreCase;
160
161 JUCE_LEAK_DETECTOR (StringPairArray)
162};
163
164} // namespace juce
juce::StringArray
Definition juce_StringArray.h:35
juce::StringPairArray
Definition juce_StringPairArray.h:35
juce::StringPairArray::getValue
String getValue(StringRef, const String &defaultReturnValue) const
Definition juce_StringPairArray.cpp:86
juce::StringPairArray::containsKey
bool containsKey(StringRef key) const noexcept
Definition juce_StringPairArray.cpp:96
juce::StringPairArray::StringPairArray
StringPairArray(bool ignoreCaseWhenComparingKeys=true)
Definition juce_StringPairArray.cpp:26
juce::StringPairArray::getAllValues
const StringArray & getAllValues() const noexcept
Definition juce_StringPairArray.h:90
juce::StringPairArray::~StringPairArray
~StringPairArray()=default
juce::StringPairArray::size
int size() const noexcept
Definition juce_StringPairArray.h:93
juce::StringPairArray::getAllKeys
const StringArray & getAllKeys() const noexcept
Definition juce_StringPairArray.h:87
juce::StringRef
Definition juce_StringRef.h:62
juce::String
Definition juce_String.h:53