Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

DbXML Class Reference

#include <DbXML.hpp>

Inheritance diagram for DbXML::

DB List of all members.

Public Methods

 DbXML ()
 DbXML (string &database, string &user_name, string &password)
 ~DbXML ()
void connect (const string &database, const string &user_name, const string &password)
virtual void disconnect ()
Folder * getRoot ()
vector< Node *> & getChildren (Folder &parent)
Node * getNode (const string &path)
Folder * getFolder (const string &path)
Bookmark * getBookmark (const string &path)
void remove (Node *node, bool recurse=false)
void save (Node *node)

Detailed Description

Represents a database connection to an XBel file.


Constructor & Destructor Documentation

DbXML::DbXML (    ) 
 

Default constructor. Initialize the SAX XML parser.

DbXML::DbXML (  string &    database,
string &    user_name,
string &    password
) 
 

Constructor. Connect to the given database.

DbXML::~DbXML (    ) 
 

Destructor. Write all data back to the XBel file.


Member Function Documentation

void DbXML::connect (  const string &    database,
const string &    user_name,
const string &    password
)  [virtual]
 

Open the XBel file and load all items into memory for fast access.

Parameters:
database  Filename of the XBel file to load.
user_name  Ignored.
password  Ignored.

Reimplemented from DB.

void DbXML::disconnect (    )  [virtual]
 

Write all data back to the XBel file.

Reimplemented from DB.

Bookmark * DbXML::getBookmark (  const string &    path )  [virtual]
 

Todo:
This implementation is very unsafe

Reimplemented from DB.

vector< Node *> & DbXML::getChildren (  Folder &    parent )  [virtual]
 

Return all direct children of a specified node.

Todo:
Use iterators

This is not really a good approach because a Folder should be expected to have the children stored internally.

Reimplemented from DB.

Folder * DbXML::getFolder (  const string &    path )  [virtual]
 

Reimplemented from DB.

Node * DbXML::getNode (  const string &    path )  [virtual]
 

Return a node by path. The path must start with a slash.

Returns:
returns null if no node with that path is found

Reimplemented from DB.

Folder * DbXML::getRoot (    )  [virtual]
 

Return the root folder.

Note:
This method may disappear in the future because this approach requires that the whole tree gets extracted from the database and that a tree is constructed in memory.

Reimplemented from DB.

void DbXML::remove (  Node *    node,
bool    recurse = false
)  [virtual]
 

Todo:
Implement deleting from XBel database.

Reimplemented from DB.

void DbXML::save (  Node *    node )  [virtual]
 

Todo:
Implement saving changes back to the database.

Reimplemented from DB.


The documentation for this class was generated from the following files:
Generated on Sun Jan 20 20:59:59 2002 for bkmd by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001