32 #include <Pt/SerializationInfo.h>
196 template <
typename T>
197 bool get(T& value)
const
208 template <
typename T>
245 _si->removeMember(name);
253 _si->removeMember(name);
264 if( it == _si->
end() )
330 Entry operator[] (
const std::string& name)
const
332 return this->entry(name);
337 Entry operator[] (
const char* name)
const
339 return this->entry(name);
345 {
return _si->name(); }
361 _si = _si->sibling();
368 {
return _si != other._si; }
373 {
return _si == other._si; }
395 template <
typename T>
396 bool get(T& value)
const
453 return this->entry(name);
460 return this->entry(name);
466 {
return _si->name(); }
482 _si = _si->sibling();
489 {
return _si != other._si; }
494 {
return _si == other._si; }
515 {
return root().
begin(); }
520 {
return root().
end(); }
530 {
return root().
begin(); }
535 {
return root().
end(); }
540 {
return Entry(
this); }
544 void load( std::basic_istream<Pt::Char>& is );
548 void save( std::basic_ostream<Pt::Char>& os )
const;
554 return root().
entry(name);
561 return root().
entry(name);
568 return this->entry(name);
575 return this->entry(name);
626 root().removeEntry(name);
633 root().removeEntry(name);
638 Entry operator[] (
const std::string& name)
640 return this->entry(name);
647 return this->entry(name);
bool operator==(const Entry &other) const
Allows using the entry like an iterator.
Definition: Settings.h:372
ConstEntry entry(const char *name) const
Returns a sub entry.
Definition: Settings.h:440
const SerializationInfo * findMember(const std::string &name) const
Find a struct member.
Definition: SerializationInfo.h:504
Const forward iterator for child elements.
Definition: SerializationInfo.h:778
Entry end() const
End of sub entries.
Definition: Settings.h:273
Entry & operator++()
Allows using the entry like an iterator.
Definition: Settings.h:359
Settings Format Error.
Definition: Settings.h:42
ConstEntry & operator++()
Allows using the entry like an iterator.
Definition: Settings.h:480
ConstEntry entry(const std::string &name) const
Returns a top level entry.
Definition: Settings.h:552
ConstEntry begin() const
Begin of entries.
Definition: Settings.h:514
const char * name() const
Returns the entry name.
Definition: Settings.h:465
Iterator end()
Returns an iterator to the end of child elements.
Definition: SerializationInfo.h:822
Entry begin()
Begin of entries.
Definition: Settings.h:529
Entry makeEntry(const char *name)
Makes a top level entry.
Definition: Settings.h:610
SerializationInfo & addMember(const std::string &name)
Add a struct member.
Definition: SerializationInfo.h:449
bool operator!() const
Returns true if entry is invalid.
Definition: Settings.h:498
Modifiable settings entry.
Definition: Settings.h:177
Error during serialization of a type.
Definition: SerializationError.h:45
ConstEntry end() const
End of sub entries.
Definition: Settings.h:422
~SettingsError()
Destructor.
Definition: Settings.h:49
void removeEntry(const char *name)
Removes a sub entry.
Definition: Settings.h:250
Entry entry(const std::string &name) const
Returns a sub entry.
Definition: Settings.h:280
Entry makeEntry(const char *name)
Returns a sub entry.
Definition: Settings.h:302
Entry makeEntry(const std::string &name)
Returns a sub entry.
Definition: Settings.h:316
void set(const T &value)
Sets the value.
Definition: Settings.h:209
Entry * operator->()
Allows using the entry like an iterator.
Definition: Settings.h:354
Constant settings entry.
Definition: Settings.h:386
const ConstEntry * operator->() const
Allows using the entry like an iterator.
Definition: Settings.h:475
bool operator!=(const ConstEntry &other) const
Allows using the entry like an iterator.
Definition: Settings.h:488
const ConstEntry & operator*() const
Allows using the entry like an iterator.
Definition: Settings.h:470
ConstEntry entry(const char *name) const
Returns a top level entry.
Definition: Settings.h:559
bool operator!() const
Returns true if entry is invalid.
Definition: Settings.h:377
std::size_t line() const
Returns the line number where the error occured.
Definition: Settings.h:54
Entry addEntry(const char *name)
Adds a sub entry.
Definition: Settings.h:231
ConstEntry end() const
End of entries.
Definition: Settings.h:519
void removeEntry(const std::string &name)
Removes a top level entry.
Definition: Settings.h:631
ConstEntry root() const
Returns the root entry.
Definition: Settings.h:524
Entry & operator*()
Allows using the entry like an iterator.
Definition: Settings.h:349
Entry entry(const char *name) const
Returns a sub entry.
Definition: Settings.h:291
Entry addEntry(const std::string &name)
Adds a sub entry.
Definition: Settings.h:220
Entry addEntry(const char *name)
Adds a top level entry.
Definition: Settings.h:596
void removeEntry(const std::string &name)
Removes a sub entry.
Definition: Settings.h:242
ConstEntry begin() const
Begin of sub entries.
Definition: Settings.h:407
Entry makeEntry(const std::string &name)
Makes a top level entry.
Definition: Settings.h:617
ConstEntry entry(const std::string &name) const
Returns a sub entry.
Definition: Settings.h:429
Represents arbitrary types during serialization.
Definition: SerializationInfo.h:58
Iterator begin()
Returns an iterator to the begin of child elements.
Entry addEntry(const std::string &name)
Adds a top level entry.
Definition: Settings.h:603
Entry entry(const std::string &name)
Returns a top level entry.
Definition: Settings.h:580
bool operator!=(const Entry &other) const
Allows using the entry like an iterator.
Definition: Settings.h:367
Entry begin() const
Begin of sub entries.
Definition: Settings.h:258
bool operator==(const ConstEntry &other) const
Allows using the entry like an iterator.
Definition: Settings.h:493
Entry root()
Returns the root entry.
Definition: Settings.h:539
Forward Iterator for child elements.
Definition: SerializationInfo.h:733
Store application settings.
Definition: Settings.h:172
Entry end()
End of entries.
Definition: Settings.h:534
const char * name() const
Returns the entry name.
Definition: Settings.h:344
void removeEntry(const char *name)
Removes a top level entry.
Definition: Settings.h:624
Entry entry(const char *name)
Returns a top level entry.
Definition: Settings.h:588