|
| ~JPrefsFile () override |
|
void | GetData (const JPrefID &id, std::string *data) const |
|
void | SetData (const JPrefID &id, std::ostringstream &data) |
|
void | SetData (const JPrefID &id, const std::string &data) |
|
void | SetData (const JPrefID &id, const JString &data) |
|
void | RemoveData (const JPrefID &id) |
|
| ~JFileArray () override |
|
const JString & | GetFileName () const |
|
JFileVersion | GetVersion () const |
|
void | SetVersion (const JFileVersion newVersion) |
|
void | GetItem (const JFAIndex &index, std::string *data) const |
|
void | GetItem (const JFAID &id, std::string *data) const |
|
void | SetItem (const JFAIndex &index, const JString &data) |
|
void | SetItem (const JFAID &id, const JString &data) |
|
void | InsertItemAtIndex (const JFAIndex &index, const JString &data) |
|
void | PrependItem (const JString &data) |
|
void | AppendItem (const JString &data) |
|
void | SetItem (const JFAIndex &index, std::ostringstream &dataStream) |
|
void | SetItem (const JFAID &id, std::ostringstream &dataStream) |
|
void | InsertItemAtIndex (const JFAIndex &index, std::ostringstream &dataStream) |
|
void | PrependItem (std::ostringstream &dataStream) |
|
void | AppendItem (std::ostringstream &dataStream) |
|
void | RemoveItem (const JFAIndex &index) |
|
void | RemoveItem (const JFAID &id) |
|
void | MoveItemToIndex (const JFAIndex ¤tIndex, const JFAIndex &newIndex) |
|
void | SwapItems (const JFAIndex &index1, const JFAIndex &index2) |
|
bool | IndexToID (const JFAIndex &index, JFAID *id) const |
|
bool | IDToIndex (const JFAID &id, JFAIndex *index) const |
|
bool | IndexValid (const JFAIndex &index) const |
|
bool | IDValid (const JFAID &id) const |
|
bool | WillFlushChanges () const |
|
void | ShouldFlushChanges (const bool write) |
|
void | FlushChanges () |
|
| JCollection () |
|
| JCollection (const JCollection &source) |
|
| ~JCollection () override |
|
JCollection & | operator= (const JCollection &source) |
|
JSize | GetItemCount () const |
|
bool | IsEmpty () const |
|
bool | IndexValid (const JIndex index) const |
|
JIndex | GetIndexFromEnd (const JIndex index) const |
|
JString | ToString () const override |
|
| JBroadcaster () |
|
virtual | ~JBroadcaster () |
|
JBroadcaster & | operator= (const JBroadcaster &source) |
|
bool | HasSenders () const |
|
JSize | GetSenderCount () const |
|
bool | HasRecipients () const |
|
JSize | GetRecipientCount () const |
|
template<class T > |
void | ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f) |
|
|
| JPrefsFile (const JString &fileName, const CreateAction action) |
|
| JFileArray (const JString &fileName, const JUtf8Byte *fileSignature, const CreateAction action) |
|
| JFileArray (JFileArray *theEnclosingFile, const JFAID &enclosureItemID) |
|
JFileArrayIndex * | GetFileArrayIndex () |
|
void | ItemAdded () |
|
void | ItemRemoved () |
|
void | SetItemCount (const JSize newItemCount) |
|
| JBroadcaster (const JBroadcaster &source) |
|
void | ListenTo (const JBroadcaster *sender) |
|
void | StopListening (const JBroadcaster *sender) |
|
void | ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember) |
|
void | StopListening (const JBroadcaster *sender, const std::type_info &messageType) |
|
template<class T > |
void | Send (JBroadcaster *recipient, const T &message) |
|
template<class T > |
void | Broadcast (const T &message) |
|
virtual void | Receive (JBroadcaster *sender, const Message &message) |
|
void | SendWithFeedback (JBroadcaster *recipient, Message *message) |
|
void | BroadcastWithFeedback (Message *message) |
|
virtual void | ReceiveWithFeedback (JBroadcaster *sender, Message *message) |
|
virtual void | ReceiveGoingAway (JBroadcaster *sender) |
|
Class to manage a preferences file. The location of the file is system
dependent. Thus, creating a JPrefsFile object only requires specifying
a stem for the file name.
OS Location
-- --------
UNIX ~/.*.pref
Each item in the JPrefsFile has an id. This id is specified when the
item is created, and -must- be unique. The id is the only guaranteed way
to get at the data after it is created.
For convenience, SetData() automatically creates a new item if the
given id doesn't already exist.
We ignore the issue of the file signature because preferences files
are usually hidden from the user and should therefore be named to avoid
conflicts between programs. The names serve as a sufficient signature.
There is still the problem of more than one program trying to open
the same file, however. Derived classes are therefore still required
to write constructor functions.