31 #ifndef TBX_RESEDITOR_H_
32 #define TBX_RESEDITOR_H_
34 #include "resobject.h"
48 std::vector<ResObject> _objects;
66 typedef std::vector<ResObject>::iterator
iterator;
99 unsigned int count()
const {
return _objects.size();}
100 bool contains(std::string name)
const;
106 void erase(std::string name);
112 bool load(std::string file_name);
113 bool save(std::string file_name);
const_iterator begin() const
Get constant iterator to first object.
Definition: reseditor.h:73
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
iterator insert(iterator before, ResObject obj)
Insert object before given object.
Definition: reseditor.cc:239
bool load(std::string file_name)
Load resources from a file.
Definition: reseditor.cc:71
Base class for a resource object that can be edited.
Definition: resobject.h:53
std::vector< ResObject >::iterator iterator
Iterator to iterate through the objects being edited.
Definition: reseditor.h:66
void clear()
Remove all objects from the editor.
Definition: reseditor.cc:60
const_iterator find(std::string name) const
Find object with given name.
Definition: reseditor.cc:207
void erase(std::string name)
Erase object with given name.
Definition: reseditor.cc:194
unsigned int count() const
Return number of objects.
Definition: reseditor.h:99
iterator begin()
Get iterator to first object.
Definition: reseditor.h:87
const ResObject & object(std::string name) const
Get object.
Definition: reseditor.cc:157
const ResFileHeader * header() const
Return header details of the file.
Definition: reseditor.h:57
void add(ResObject obj)
Add a new object.
Definition: reseditor.cc:170
const_iterator end() const
Get constant iterator to the end of the objects.
Definition: reseditor.h:79
iterator end()
Get iterator to the end of the objects.
Definition: reseditor.h:93
Class to allow creation, loading, editing and saving of a toolbox resource file.
Definition: reseditor.h:46
bool save(std::string file_name)
Save resources to the name file.
Definition: reseditor.cc:113
ResEditor()
Construct an empty resource file.
Definition: reseditor.cc:44
std::vector< ResObject >::const_iterator const_iterator
Constant iterator to iterate through the objects being edited.
Definition: reseditor.h:62
void replace(ResObject obj)
Replace object with same name as object given.
Definition: reseditor.cc:182
bool contains(std::string name) const
Check if editor contains the named object.
Definition: reseditor.cc:146