Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
Arc::XmlDatabase Class Reference

#include <XmlDatabase.h>

Collaboration diagram for Arc::XmlDatabase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XmlDatabase ()
 XmlDatabase (const std::string &db_path, const std::string &db_name)
 ~XmlDatabase ()
void put (const std::string &name, const std::string &content)
void put (const std::string &name, Arc::XMLNode &doc)
void get (const std::string &name, Arc::XMLNode &doc)
void del (const std::string &name)
Arc::XMLNodeList query (const std::string &name, const std::string &q)
void queryAll (const std::string &q, std::map< std::string, Arc::XMLNodeList > &result)
void update (const std::string &name, const std::string &query, Arc::XMLNode &new_value)
void checkpoint ()
 operator bool (void)
bool operator! (void)

Private Attributes

XmlContainercontainer_

Detailed Description

Definition at line 12 of file XmlDatabase.h.


Constructor & Destructor Documentation

Definition at line 18 of file XmlDatabase.h.

:container_(NULL) { };
Arc::XmlDatabase::XmlDatabase ( const std::string &  db_path,
const std::string &  db_name 
)

Definition at line 10 of file XmlDatabase.cpp.

{
    container_ = new Arc::XmlContainer(db_path, db_name);
}

Definition at line 16 of file XmlDatabase.cpp.

{
    delete container_;
}

Member Function Documentation

Definition at line 86 of file XmlDatabase.cpp.

Here is the call graph for this function:

void Arc::XmlDatabase::del ( const std::string &  name)

Definition at line 46 of file XmlDatabase.cpp.

{
    container_->del(name);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::XmlDatabase::get ( const std::string &  name,
Arc::XMLNode doc 
)

Definition at line 36 of file XmlDatabase.cpp.

{
    std::string content = container_->get(name);
    if (!content.empty()) {
        Arc::XMLNode nn(content);
        nn.New(doc);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Arc::XmlDatabase::operator bool ( void  ) [inline]

Definition at line 33 of file XmlDatabase.h.

{return (*container_);}
bool Arc::XmlDatabase::operator! ( void  ) [inline]

Definition at line 34 of file XmlDatabase.h.

{return !(*container_);}
void Arc::XmlDatabase::put ( const std::string &  name,
const std::string &  content 
)

Definition at line 22 of file XmlDatabase.cpp.

{
    container_->put(name, content);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::XmlDatabase::put ( const std::string &  name,
Arc::XMLNode doc 
)

Definition at line 28 of file XmlDatabase.cpp.

{
    std::string content;
    doc.GetDoc(content);
    container_->put(name, content);
}

Here is the call graph for this function:

Arc::XMLNodeList Arc::XmlDatabase::query ( const std::string &  name,
const std::string &  q 
)

Definition at line 52 of file XmlDatabase.cpp.

{
    Arc::XMLNode node;
    get(name, node);
    return node.XPathLookup(q, node.Namespaces());
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::XmlDatabase::queryAll ( const std::string &  q,
std::map< std::string, Arc::XMLNodeList > &  result 
)

Definition at line 60 of file XmlDatabase.cpp.

{
    std::vector<std::string> doc_names = container_->get_doc_names();

    for (int i = 0; i < doc_names.size(); i++) {
        Arc::XMLNodeList r = query(doc_names[i], q);
        result[doc_names[i]] = r;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Arc::XmlDatabase::update ( const std::string &  name,
const std::string &  query,
Arc::XMLNode new_value 
)

Definition at line 72 of file XmlDatabase.cpp.

{
    container_->start_update();
    // get content
    // parse content to XMLNode
    // run query
    // replace query result nodes with new_value
    // get the new document as string
    // put the content back to container
    container_->end_update();
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 15 of file XmlDatabase.h.


The documentation for this class was generated from the following files: