OpenShot Audio Library | OpenShotAudio 0.3.2
|
#include <juce_PropertiesFile.h>
Classes | |
struct | Options |
Public Types | |
enum | StorageFormat { storeAsBinary , storeAsCompressedBinary , storeAsXML } |
Protected Member Functions | |
void | propertyChanged () override |
Wrapper on a file that stores a list of key/value data pairs.
Useful for storing application settings, etc. See the PropertySet class for the interfaces that read and write values.
Not designed for very large amounts of data, as it keeps all the values in memory and writes them out to disk lazily when they are changed.
Because this class derives from ChangeBroadcaster, ChangeListeners can be registered with it, and these will be signalled when a value changes.
Definition at line 46 of file juce_PropertiesFile.h.
enum juce::PropertiesFile::StorageFormat |
Definition at line 52 of file juce_PropertiesFile.h.
Creates a PropertiesFile object. The file used will be chosen by calling PropertiesFile::Options::getDefaultFile() for the options provided. To set the file explicitly, use the other constructor.
Definition at line 123 of file juce_PropertiesFile.cpp.
Creates a PropertiesFile object. Unlike the other constructor, this one allows you to explicitly set the file that you want to be used, rather than using the default one.
Definition at line 116 of file juce_PropertiesFile.cpp.
|
override |
Destructor. When deleted, the file will first call saveIfNeeded() to flush any changes to disk.
Definition at line 141 of file juce_PropertiesFile.cpp.
Returns the file that's being used.
Definition at line 229 of file juce_PropertiesFile.h.
|
inlinenoexcept |
Returns true if this file was created from a valid (or non-existent) file. If the file failed to load correctly because it was corrupt or had insufficient access, this will be false.
Definition at line 190 of file juce_PropertiesFile.h.
bool juce::PropertiesFile::needsToBeSaved | ( | ) | const |
Returns true if the properties have been altered since the last time they were saved. The file is flagged as needing to be saved when you change a value, but you can explicitly set this flag with setNeedsToBeSaved().
Definition at line 157 of file juce_PropertiesFile.cpp.
|
overrideprotectedvirtual |
Reimplemented from juce::PropertySet.
Definition at line 348 of file juce_PropertiesFile.cpp.
bool juce::PropertiesFile::reload | ( | ) |
Attempts to reload the settings from the file.
Definition at line 130 of file juce_PropertiesFile.cpp.
Referenced by PropertiesFile(), and PropertiesFile().
bool juce::PropertiesFile::save | ( | ) |
This will force a write-to-disk of the current values, regardless of whether anything has changed since the last save.
Returns false if it fails to write to the file for some reason (maybe because it's read-only or the directory doesn't exist or something).
Definition at line 169 of file juce_PropertiesFile.cpp.
Referenced by saveIfNeeded().
bool juce::PropertiesFile::saveIfNeeded | ( | ) |
This will flush all the values to disk if they've changed since the last time they were saved.
Returns false if it fails to write to the file for some reason (maybe because it's read-only or the directory doesn't exist or something).
Definition at line 151 of file juce_PropertiesFile.cpp.
Referenced by propertyChanged(), and ~PropertiesFile().
Explicitly sets the flag to indicate whether the file needs saving or not.
Definition at line 163 of file juce_PropertiesFile.cpp.