openshot-audio  0.1.7
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) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_PROPERTIESFILE_H_INCLUDED
26 #define JUCE_PROPERTIESFILE_H_INCLUDED
27 
28 
29 //==============================================================================
44  public ChangeBroadcaster,
45  private Timer
46 {
47 public:
48  //==============================================================================
50  {
53  storeAsXML
54  };
55 
56  //==============================================================================
58  {
62  Options();
63 
67 
73 
78 
98 
103 
109 
111  bool doNotSave;
112 
122 
128 
137 
155  File getDefaultFile() const;
156  };
157 
158  //==============================================================================
163  explicit PropertiesFile (const Options& options);
164 
169  PropertiesFile (const File& file,
170  const Options& options);
171 
175  ~PropertiesFile();
176 
177  //==============================================================================
182  bool isValidFile() const noexcept { return loadedOk; }
183 
184  //==============================================================================
193  bool saveIfNeeded();
194 
203  bool save();
204 
209  bool needsToBeSaved() const;
210 
214  void setNeedsToBeSaved (bool needsToBeSaved);
215 
217  bool reload();
218 
219  //==============================================================================
221  const File& getFile() const noexcept { return file; }
222 
223 
224 protected:
226  void propertyChanged() override;
227 
228 private:
229  //==============================================================================
230  File file;
231  Options options;
232  bool loadedOk, needsWriting;
233 
234  typedef const ScopedPointer<InterProcessLock::ScopedLockType> ProcessScopedLock;
235  InterProcessLock::ScopedLockType* createProcessLock() const;
236 
237  void timerCallback() override;
238  bool saveAsXml();
239  bool saveAsBinary();
240  bool loadAsXml();
241  bool loadAsBinary();
242  bool loadAsBinary (InputStream&);
243 
245 };
246 
247 #endif // JUCE_PROPERTIESFILE_H_INCLUDED
StorageFormat
Definition: juce_PropertiesFile.h:49
String folderName
Definition: juce_PropertiesFile.h:77
Definition: juce_PropertiesFile.h:43
String filenameSuffix
Definition: juce_PropertiesFile.h:72
Definition: juce_PropertySet.h:43
bool commonToAllUsers
Definition: juce_PropertiesFile.h:102
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_PropertiesFile.h:51
int millisecondsBeforeSaving
Definition: juce_PropertiesFile.h:121
Definition: juce_InterProcessLock.h:39
InterProcessLock * processLock
Definition: juce_PropertiesFile.h:136
bool ignoreCaseOfKeyNames
Definition: juce_PropertiesFile.h:108
Definition: juce_InputStream.h:41
Definition: juce_String.h:43
Definition: juce_ChangeBroadcaster.h:35
#define JUCE_API
Definition: juce_StandardHeader.h:139
#define const
String applicationName
Definition: juce_PropertiesFile.h:66
StorageFormat storageFormat
Definition: juce_PropertiesFile.h:127
Definition: juce_PropertiesFile.h:52
Definition: juce_ScopedPointer.h:70
bool doNotSave
Definition: juce_PropertiesFile.h:111
Definition: juce_PropertiesFile.h:57
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Definition: juce_PlatformDefs.h:198
Definition: juce_data_structures.cpp:30
const File & getFile() const noexcept
Definition: juce_PropertiesFile.h:221
String osxLibrarySubFolder
Definition: juce_PropertiesFile.h:97
Definition: juce_Timer.h:52
Definition: juce_File.h:45
Definition: juce_InterProcessLock.h:76
bool isValidFile() const noexcept
Definition: juce_PropertiesFile.h:182