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;
73 const_iterator
begin()
const {
return _objects.begin();}
79 const_iterator
end()
const {
return _objects.end();}
80 const_iterator
find(std::string name)
const;
87 iterator
begin() {
return _objects.begin();}
93 iterator
end() {
return _objects.end();}
94 iterator
find(std::string name);
99 unsigned int count()
const {
return _objects.size();}
100 bool contains(std::string name)
const;
106 void erase(std::string name);
109 iterator
erase(iterator where);
112 bool load(std::string file_name);
113 bool save(std::string file_name);
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
std::vector< ResObject >::const_iterator const_iterator
Constant iterator to iterate through the objects being edited.
Definition: reseditor.h:62
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
Classes to use/edit toolbox resources in memory.
std::vector< ResObject >::iterator iterator
Iterator to iterate through the objects being edited.
Definition: reseditor.h:66
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
const_iterator end() const
Get constant iterator to the end of the objects.
Definition: reseditor.h:79
const ResFileHeader * header() const
Return header details of the file.
Definition: reseditor.h:57
iterator begin()
Get iterator to first object.
Definition: reseditor.h:87
void add(ResObject obj)
Add a new object.
Definition: reseditor.cc:170
const ResObject & object(std::string name) const
Get object.
Definition: reseditor.cc:157
Base class for a resource object that can be edited.
Definition: resobject.h:52
bool contains(std::string name) const
Check if editor contains the named object.
Definition: reseditor.cc:146
void replace(ResObject obj)
Replace object with same name as object given.
Definition: reseditor.cc:182
iterator end()
Get iterator to the end of the objects.
Definition: reseditor.h:93
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
const_iterator begin() const
Get constant iterator to first object.
Definition: reseditor.h:73
Class to allow creation, loading, editing and saving of a toolbox resource file.
Definition: reseditor.h:45
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