LMMS
Loading...
Searching...
No Matches
juce_PropertiesFile.h
Go to the documentation of this file.
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 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
46 public ChangeBroadcaster,
47 private Timer
48{
49public:
50 //==============================================================================
57
58 //==============================================================================
164
165 //==============================================================================
170 explicit PropertiesFile (const Options& options);
171
176 PropertiesFile (const File& file,
177 const Options& options);
178
182 ~PropertiesFile() override;
183
184 //==============================================================================
190
191 //==============================================================================
200 bool saveIfNeeded();
201
210 bool save();
211
216 bool needsToBeSaved() const;
217
221 void setNeedsToBeSaved (bool needsToBeSaved);
222
224 bool reload();
225
226 //==============================================================================
228 const File& getFile() const noexcept { return file; }
229
230
231protected:
233 void propertyChanged() override;
234
235private:
236 //==============================================================================
239 bool loadedOk = false, needsWriting = false;
240
241 using ProcessScopedLock = const std::unique_ptr<InterProcessLock::ScopedLockType>;
243
244 void timerCallback() override;
245 bool saveAsXml();
246 bool saveAsBinary();
247 bool loadAsXml();
248 bool loadAsBinary();
251
253};
254
255} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
ChangeBroadcaster() noexcept
Definition juce_ChangeBroadcaster.cpp:26
Definition juce_File.h:45
Definition juce_InputStream.h:37
Definition juce_InterProcessLock.h:72
Definition juce_InterProcessLock.h:35
Definition juce_OutputStream.h:38
void timerCallback() override
Definition juce_PropertiesFile.cpp:342
bool loadAsBinary()
Definition juce_PropertiesFile.cpp:238
PropertiesFile(const Options &options)
Definition juce_PropertiesFile.cpp:122
File file
Definition juce_PropertiesFile.h:237
const std::unique_ptr< InterProcessLock::ScopedLockType > ProcessScopedLock
Definition juce_PropertiesFile.h:241
bool loadedOk
Definition juce_PropertiesFile.h:239
Options options
Definition juce_PropertiesFile.h:238
bool needsWriting
Definition juce_PropertiesFile.h:239
bool writeToStream(OutputStream &)
Definition juce_PropertiesFile.cpp:323
bool saveAsBinary()
Definition juce_PropertiesFile.cpp:279
const File & getFile() const noexcept
Definition juce_PropertiesFile.h:228
InterProcessLock::ScopedLockType * createProcessLock() const
Definition juce_PropertiesFile.cpp:145
bool isValidFile() const noexcept
Definition juce_PropertiesFile.h:189
bool loadAsXml()
Definition juce_PropertiesFile.cpp:186
StorageFormat
Definition juce_PropertiesFile.h:52
@ storeAsBinary
Definition juce_PropertiesFile.h:53
@ storeAsCompressedBinary
Definition juce_PropertiesFile.h:54
@ storeAsXML
Definition juce_PropertiesFile.h:55
bool saveAsXml()
Definition juce_PropertiesFile.cpp:207
PropertySet(bool ignoreCaseOfKeyNames=false)
Definition juce_PropertySet.cpp:26
Definition juce_String.h:53
Timer() noexcept
Definition juce_Timer.cpp:316
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
Definition juce_PropertiesFile.h:61
Options()
Definition juce_PropertiesFile.cpp:41
StorageFormat storageFormat
Definition juce_PropertiesFile.h:134
File getDefaultFile() const
Definition juce_PropertiesFile.cpp:51
InterProcessLock * processLock
Definition juce_PropertiesFile.h:143
String osxLibrarySubFolder
Definition juce_PropertiesFile.h:104
String filenameSuffix
Definition juce_PropertiesFile.h:79
String folderName
Definition juce_PropertiesFile.h:84
String applicationName
Definition juce_PropertiesFile.h:69
bool commonToAllUsers
Definition juce_PropertiesFile.h:109
bool doNotSave
Definition juce_PropertiesFile.h:118
bool ignoreCaseOfKeyNames
Definition juce_PropertiesFile.h:115
int millisecondsBeforeSaving
Definition juce_PropertiesFile.h:128
static LV2_State_Status save(LV2_Handle instance, LV2_State_Store_Function store, void *callback_data, uint32_t flags, const LV2_Feature *const *features)
Definition test.c:161
#define const
Definition zconf.h:137