Loading...
Searching...
No Matches
BALL::ResourceEntry Class Reference
Molecular Modeling » File Formats » General Purpose File Formats » Support for hierarchical text data.

`#include <BALL/FORMAT/resourceFile.h>`

Inheritance diagram for BALL::ResourceEntry:

## Classes

class | IteratorTraits_

## Public Member Functions

Constructors and Destructors
| ResourceEntry ()
| ResourceEntry (const ResourceEntry &entry, bool deep=true)
| ResourceEntry (const String &key, const String &value, ResourceEntry *parent=0)
virtual | ~ResourceEntry ()
void | clear ()
void | destroy ()
Assignment
void | set (const ResourceEntry &entry, bool deep=true)
const ResourceEntry & | operator= (const ResourceEntry &entry)
void | get (ResourceEntry &entry, bool deep=true) const
Miscellaneous
bool | operator== (const ResourceEntry &entry) const
bool | operator!= (const ResourceEntry &entry) const
ResourceEntry & | getRoot ()
const ResourceEntry & | getRoot () const
ResourceEntry * | getParent ()
const ResourceEntry * | getParent () const
ResourceEntry * | getChild (Position index)
const ResourceEntry * | getChild (Position index) const
ResourceEntry * | getEntry (const String &key_path)
const ResourceEntry * | getEntry (const String &key_path) const
const String & | getKey () const
void | setValue (const String &value)
String & | getValue ()
const String & | getValue () const
String | getPath () const
Size | countChildren () const
Size | countDescendants () const
Size | getSize () const
Size | getDepth () const
ResourceEntry * | insertChild (const String &key, const String &value, bool replace_value=true)
ResourceEntry * | insertSibling (const String &key, const String &value, bool replace_value=true)
ResourceEntry * | insertChild (ResourceEntry &entry, bool replace_value=true)
ResourceEntry * | insert (const String &key_path, const String &name)
bool | mergeChildrenOf (ResourceEntry &entry, bool replace_value=true)
bool | removeChild (const String &key, ResourceEntry **removed=0)
bool | removeKey (const String &key_path)
ResourceEntry * | findChild (const String &key)
const ResourceEntry * | findChild (const String &key) const
ResourceEntry * | findDescendant (const String &key)
const ResourceEntry * | findDescendant (const String &key) const
ResourceEntry * | findEntry (const String &key)
const ResourceEntry * | findEntry (const String &key) const
Attributes
bool | hasChild (const String &key) const
bool | isEmpty () const
bool | isParentOf (const ResourceEntry &entry) const
bool | isChildOf (const ResourceEntry &entry) const
bool | isAncestorOf (const ResourceEntry &entry) const
bool | isDescendantOf (const ResourceEntry &entry) const
bool | isRelatedWith (const ResourceEntry &entry) const
bool | isRoot () const
Debugging and Diagnostics
bool | isValid () const
void | dump (std::ostream &s=std::cout, Size depth=0) const
Public Member Functions inherited from BALL::AutoDeletable
virtual | ~AutoDeletable ()
void * | operator new (size_t size)
void | operator delete (void *ptr)
void * | operator new (size_t size, void *ptr)
void | operator delete (void *ptr, void *)
bool | isAutoDeletable () const
void | setAutoDeletable (bool enable)

## Processor and Visitor related methods

typedef ResourceEntry * | IteratorPosition
typedef ForwardIterator< ResourceEntry, ResourceEntry, ResourceEntry *, IteratorTraits_ > | Iterator
typedef ConstForwardIterator< ResourceEntry, ResourceEntry, ResourceEntry *, IteratorTraits_ > | ConstIterator
class | IteratorTraits_
void | host (Visitor< ResourceEntry > &visitor)
bool | apply (UnaryProcessor< ResourceEntry > &processor)
bool | applyChildren (UnaryProcessor< ResourceEntry > &processor)
Iterator | begin ()
Iterator | end ()
ConstIterator | begin () const
ConstIterator | end () const
virtual ResourceEntry * | newEntry (const String &key, const String &value, ResourceEntry *parent=0) const
virtual ResourceEntry ** | newEntryArray (Size size) const
virtual void | deleteEntry (ResourceEntry *entry) const
virtual void | deleteEntryArray (ResourceEntry **entry_array) const
bool | applyNostart_ (UnaryProcessor< ResourceEntry > &processor)

## Additional Inherited Members

static void | clearLastPtr ()
| AutoDeletable ()
| AutoDeletable (const AutoDeletable &auto_deletable, bool deep=false)

## Detailed Description

Resource entry class

Definition at line 41 of file resourceFile.h.

## Member Typedef Documentation

## ConstIterator

typedef ConstForwardIterator<ResourceEntry, ResourceEntry, ResourceEntry*, IteratorTraits_> BALL::ResourceEntry::ConstIterator

Definition at line 542 of file resourceFile.h.

## Iterator

typedef ForwardIterator<ResourceEntry, ResourceEntry, ResourceEntry*, IteratorTraits_> BALL::ResourceEntry::Iterator

Definition at line 541 of file resourceFile.h.

## IteratorPosition

typedef ResourceEntry* BALL::ResourceEntry::IteratorPosition

Definition at line 319 of file resourceFile.h.

## Constructor & Destructor Documentation

## ResourceEntry() [1/3]

BALL::ResourceEntry::ResourceEntry | ( |  | ) |

Default constructor

## ResourceEntry() [2/3]

BALL::ResourceEntry::ResourceEntry | ( | const ResourceEntry & | entry,
|  | bool | deep = true )

Copy constructor. Creates a new resource entry from another.

Parameters

  entry | the ResourceEntry object to be copied
  deep | create a deep (true) or shallow (false) copy

## ResourceEntry() [3/3]

BALL::ResourceEntry::ResourceEntry | ( | const String & | key,
|  | const String & | value,
|  | ResourceEntry * | parent = 0 )

Create a new resource entry. An entry with key and value is created. If parent is given, the new entries parent pointer is set to this value. Take care: the parents child array is not updated - so use this option only if you really know what you are doing. To keep this data consistent, use insertChild .

Parameters

  key | the key of the new entry
  value | the value of the new entry
  parent | the content of the new entry's parent pointer

## ~ResourceEntry()

virtual BALL::ResourceEntry::~ResourceEntry | ( |  | ) |

virtual

## Member Function Documentation

## apply()

bool BALL::ResourceEntry::apply | ( | UnaryProcessor< ResourceEntry > & | processor | ) |

## applyChildren()

bool BALL::ResourceEntry::applyChildren | ( | UnaryProcessor< ResourceEntry > & | processor | ) |

## applyNostart_()

bool BALL::ResourceEntry::applyNostart_ | ( | UnaryProcessor< ResourceEntry > & | processor | ) |

protected

## begin() [1/2]

Iterator BALL::ResourceEntry::begin | ( |  | ) |

inline

Definition at line 544 of file resourceFile.h.

## begin() [2/2]

ConstIterator BALL::ResourceEntry::begin | ( |  | ) | const

inline

Definition at line 548 of file resourceFile.h.

## clear()

void BALL::ResourceEntry::clear | ( |  | ) |

## countChildren()

Size BALL::ResourceEntry::countChildren | ( |  | ) | const

Return the number of child entries.

## countDescendants()

Size BALL::ResourceEntry::countDescendants | ( |  | ) | const

Return the number of children which are not leaves.

## deleteEntry()

virtual void BALL::ResourceEntry::deleteEntry | ( | ResourceEntry * | entry | ) | const

protected virtual

## deleteEntryArray()

virtual void BALL::ResourceEntry::deleteEntryArray | ( | ResourceEntry ** | entry_array | ) | const

protected virtual

## destroy()

void BALL::ResourceEntry::destroy | ( |  | ) |

## dump()

void BALL::ResourceEntry::dump | ( | std::ostream & | s = std::cout,
|  | Size | depth = 0 ) const

## end() [1/2]

Iterator BALL::ResourceEntry::end | ( |  | ) |

inline

Definition at line 545 of file resourceFile.h.

## end() [2/2]

ConstIterator BALL::ResourceEntry::end | ( |  | ) | const

inline

Definition at line 549 of file resourceFile.h.

## findChild() [1/2]

ResourceEntry * BALL::ResourceEntry::findChild | ( | const String & | key | ) |

## findChild() [2/2]

const ResourceEntry * BALL::ResourceEntry::findChild | ( | const String & | key | ) | const

## findDescendant() [1/2]

ResourceEntry * BALL::ResourceEntry::findDescendant | ( | const String & | key | ) |

## findDescendant() [2/2]

const ResourceEntry * BALL::ResourceEntry::findDescendant | ( | const String & | key | ) | const

## findEntry() [1/2]

ResourceEntry * BALL::ResourceEntry::findEntry | ( | const String & | key | ) |

## findEntry() [2/2]

const ResourceEntry * BALL::ResourceEntry::findEntry | ( | const String & | key | ) | const

## get()

void BALL::ResourceEntry::get | ( | ResourceEntry & | entry,
|  | bool | deep = true ) const

Assign the contents of a resource enytry to another one.

Parameters

  entry | the ResourceEntry object to be copied
  deep | create a deep (true) or shallow (false) copy

## getChild() [1/2]

ResourceEntry * BALL::ResourceEntry::getChild | ( | Position | index | ) |

Return a pointer to a child node.

Returns
  0 if the child index does not exist

## getChild() [2/2]

const ResourceEntry * BALL::ResourceEntry::getChild | ( | Position | index | ) | const

Return a const pointer to a child node.

Returns
  0 if the child index does not exist

## getDepth()

Size BALL::ResourceEntry::getDepth | ( |  | ) | const

Compute the depth of this entry within the tree.

## getEntry() [1/2]

ResourceEntry * BALL::ResourceEntry::getEntry | ( | const String & | key_path | ) |

Return a pointer to an entry. Searches for an entry via its path.

Returns
  0 if the specified path does not exist

## getEntry() [2/2]

const ResourceEntry * BALL::ResourceEntry::getEntry | ( | const String & | key_path | ) | const

Return a const pointer to an entry Searches for an entry via its path.

Returns
  0 if the specified path does not exist

## getKey()

const String & BALL::ResourceEntry::getKey | ( |  | ) | const

Return the key of this ResourceEntry.

## getParent() [1/2]

ResourceEntry * BALL::ResourceEntry::getParent | ( |  | ) |

## getParent() [2/2]

const ResourceEntry * BALL::ResourceEntry::getParent | ( |  | ) | const

## getPath()

String BALL::ResourceEntry::getPath | ( |  | ) | const

Return the path of an entry.

## getRoot() [1/2]

ResourceEntry & BALL::ResourceEntry::getRoot | ( |  | ) |

## getRoot() [2/2]

const ResourceEntry & BALL::ResourceEntry::getRoot | ( |  | ) | const

## getSize()

Size BALL::ResourceEntry::getSize | ( |  | ) | const

????? What is the size of an entry? Why not use size()?

## getValue() [1/2]

String & BALL::ResourceEntry::getValue | ( |  | ) |

Get a mutable reference to the value of this ResourceEntry.

## getValue() [2/2]

const String & BALL::ResourceEntry::getValue | ( |  | ) | const

Get a constant reference to the value of this ResourceEntry.

## hasChild()

bool BALL::ResourceEntry::hasChild | ( | const String & | key | ) | const

## host()

void BALL::ResourceEntry::host | ( | Visitor< ResourceEntry > & | visitor | ) |

## insert()

ResourceEntry * BALL::ResourceEntry::insert | ( | const String & | key_path,
|  | const String & | name )

Insert a resource entry at the appropriate place in the tree.

## insertChild() [1/2]

ResourceEntry * BALL::ResourceEntry::insertChild | ( | const String & | key,
|  | const String & | value,
|  | bool | replace_value = true )

Insert a child into the tree below this entry, if the key has not been used yet.

## insertChild() [2/2]

ResourceEntry * BALL::ResourceEntry::insertChild | ( | ResourceEntry & | entry,
|  | bool | replace_value = true )

Insert a child into the tree below this entry, if the key has not been used yet.

## insertSibling()

ResourceEntry * BALL::ResourceEntry::insertSibling | ( | const String & | key,
|  | const String & | value,
|  | bool | replace_value = true )

Insert a child into the tree below the parent entry.

## isAncestorOf()

bool BALL::ResourceEntry::isAncestorOf | ( | const ResourceEntry & | entry | ) | const

## isChildOf()

bool BALL::ResourceEntry::isChildOf | ( | const ResourceEntry & | entry | ) | const

## isDescendantOf()

bool BALL::ResourceEntry::isDescendantOf | ( | const ResourceEntry & | entry | ) | const

## isEmpty()

bool BALL::ResourceEntry::isEmpty | ( |  | ) | const

## isParentOf()

bool BALL::ResourceEntry::isParentOf | ( | const ResourceEntry & | entry | ) | const

## isRelatedWith()

bool BALL::ResourceEntry::isRelatedWith | ( | const ResourceEntry & | entry | ) | const

## isRoot()

bool BALL::ResourceEntry::isRoot | ( |  | ) | const

## isValid()

bool BALL::ResourceEntry::isValid | ( |  | ) | const

## mergeChildrenOf()

bool BALL::ResourceEntry::mergeChildrenOf | ( | ResourceEntry & | entry,
|  | bool | replace_value = true )

Merge the children of a resource entry.

## newEntry()

virtual ResourceEntry * BALL::ResourceEntry::newEntry | ( | const String & | key,
|  | const String & | value,
|  | ResourceEntry * | parent = 0 ) const

protected virtual

## newEntryArray()

virtual ResourceEntry ** BALL::ResourceEntry::newEntryArray | ( | Size | size | ) | const

protected virtual

## operator!=()

bool BALL::ResourceEntry::operator!= | ( | const ResourceEntry & | entry | ) | const

Inequality operator

## operator=()

const ResourceEntry & BALL::ResourceEntry::operator= | ( | const ResourceEntry & | entry | ) |

Assignment operator.

Parameters

  entry | the ResourceEntry object to be copied

## operator==()

bool BALL::ResourceEntry::operator== | ( | const ResourceEntry & | entry | ) | const

Equality operator

## removeChild()

bool BALL::ResourceEntry::removeChild | ( | const String & | key,
|  | ResourceEntry ** | removed = 0 )

Remove a child of a resource entry.

## removeKey()

bool BALL::ResourceEntry::removeKey | ( | const String & | key_path | ) |

## set()

void BALL::ResourceEntry::set | ( | const ResourceEntry & | entry,
|  | bool | deep = true )

Assign a resource entry from another.

Parameters

  entry | the ResourceEntry object to be copied
  deep | create a deep (true) or shallow (false) copy

## setValue()

void BALL::ResourceEntry::setValue | ( | const String & | value | ) |

Set the value of this ResourceEntry.

## Friends And Related Symbol Documentation

## IteratorTraits_

friend class IteratorTraits_

friend

Definition at line 539 of file resourceFile.h.