OpenShot Audio Library | OpenShotAudio: juce_StringPairArray.h Source File

OpenShot Audio Library | OpenShotAudio 0.3.1

Loading...
Searching...
No Matches
juce_StringPairArray.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//==============================================================================
34 class JUCE_API StringPairArray
35{
36public:
37 //==============================================================================
39 StringPairArray (bool ignoreCaseWhenComparingKeys = true);
40
42 StringPairArray (const StringPairArray& other);
43
45 ~StringPairArray();
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
127 //==============================================================================
131 String getDescription() const;
132
133 //==============================================================================
140 void minimiseStorageOverheads();
141
142
143private:
144 //==============================================================================
145 StringArray keys, values;
146 bool ignoreCase;
147
148 JUCE_LEAK_DETECTOR (StringPairArray)
149};
150
151} // namespace juce
juce::StringArray
Definition: juce_StringArray.h:35
juce::StringPairArray
Definition: juce_StringPairArray.h:35
juce::StringPairArray::getAllValues
const StringArray & getAllValues() const noexcept
Definition: juce_StringPairArray.h:90
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:39