databases::XMLIndex Class Reference

XML index. More...

#include <xml.h>

List of all members.

Public Types

typedef std::vector< std::string > container_type
 Container type.
typedef container_type::const_iterator const_iterator
 Const iterator type.
typedef container_type::const_reverse_iterator const_reverse_iterator
 Const reverse iterator type.

Public Member Functions

 XMLIndex ()
 Constructor.
 XMLIndex (XMLIndex const &xi)
 Copy constructor.
XMLIndexoperator= (XMLIndex const &right)
 Assignment operator.
bool load (std::string const &filename)
 Loads index from an XML index file.
bool save (std::string const &filename)
 Saves index to an XML index file.
bool add (std::string const &filename)
 Adds a file to the index.
bool remove (std::string const &filename)
 Removes a file from the index.
void clear ()
 Clears the index.
bool exists (std::string const &filename) const
 Determines whether a file exists in the index.
const_iterator begin () const
 Returns a const_iterator to the first element.
const_iterator end () const
 Returns a const_iterator to the last element.
const_reverse_iterator rbegin () const
 Returns a const_reverse_iterator to the first element.
const_reverse_iterator rend () const
 Returns a const_reverse_iterator to the last element.
bool empty () const
 Returns whether the index is empty.
container_type::size_type size () const
 Returns the number of files in the index.
std::string const & error () const
 Returns a string describing the last error that occured after load()/save().


Detailed Description

This class implements an XML index file, that may be used to load/save respectively the files to import or the exported files.


Member Function Documentation

bool databases::XMLIndex::add std::string const &  filename  ) 
 

Adds a file to the index. If the given file is already in the index, then it is not added, though the function is still successful.

Parameters:
[in] filename The file to add.
Returns:
true if successful, false otherwise.

void databases::XMLIndex::clear  ) 
 

Clears the index.

return true if successful, false otherwise.

bool databases::XMLIndex::exists std::string const &  filename  )  const
 

Determines whether a file exists in the index.

Parameters:
[in] filename The file to check for.
Returns:
true if it exists, false otherwise.

bool databases::XMLIndex::load std::string const &  filename  ) 
 

Loads index from an XML index file.

Parameters:
[in] filename The name of the file to load from.
Returns:
true if successful, false otherwise. The error() function can be used to get feedback on what happened.

bool databases::XMLIndex::remove std::string const &  filename  ) 
 

Removes a file from the index.

Parameters:
[in] filename The file to remove.
Returns:
true if successful, false otherwise.

bool databases::XMLIndex::save std::string const &  filename  ) 
 

Saves index to an XML index file.

Parameters:
[in] filename The name of the file to save to.
Returns:
true if successful, false otherwise. The error() function can be used to get feedback on what happened.


The documentation for this class was generated from the following file:
Generated on Sun May 20 21:32:20 2007 for Epona API by  doxygen 1.4.6