creaImageIO::TimestampDatabaseHandler Class Reference

Concrete TreeHandler which manages a Tree stored in a sqlite database. More...

#include <creaImageIOTimestampDatabaseHandler.h>

Collaboration diagram for creaImageIO::TimestampDatabaseHandler:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TimestampDatabaseHandler (const std::string &filename)
 Ctor with database file name.
virtual ~TimestampDatabaseHandler ()
 Dtor.
const std::string & GetFileName () const
 Returns the sqlite db file name.
bool Open ()
 Opens an existing 'source'.
bool Close ()
 Closes the 'source'.
bool Create ()
 Creates a new 'source'.
bool Destroy ()
 Destroys the 'source'.
std::string IsIndexed (const std::string &path, const std::string &refdb)
 Returns the id of the path if it's indexed, blank otherwise.
bool AddDirectory (const std::string &parent, const std::string &path, const time_t lastModif, const time_t lastRead, const std::string &refdb)
 Sets the current path's parent.
void AddFile (const std::string &path, const time_t lastModif, const time_t lastRead, const std::string &refdb)
 Adds a new file to the database without a parent.
void AddFile (const std::string &parentId, const std::string &path, const time_t lastModif, const time_t lastRead, const std::string &refdb)
 Adds a new file to the database with a parent.
void SetAttribute (const std::string &attName, const std::string &attValue, const std::string &searchParam, const std::string &searchValue)
 Sets the attribute to the value passed as parameter where the searchParameter is searchValue.
void RemoveNode (const std::string &searchAtt, const tree::Node *node, const std::string &refdb)
 Removes the given node.
void RemoveFile (const std::string &searchAtt, const std::string &searchVal, const std::string &refdb)
 Removes the filename with the given pathname.
void CleanPath (std::string &str) const
 Cleans the path name.
bool CheckTimestamp (const std::string pathId, const time_t lastModif, const std::string &refdb)
 Checks the timestamp in the database and compares it with the given one.
void RemoveEntries (const std::string i_table, const std::string i_attribute, const std::string i_operand, const std::string i_val)
 Removes the entries that match the given parameters.

Protected Member Functions

bool DBOpen ()
 Open the database.
bool DBCreate ()
 Creates a new database on disk and the tables.
void DBRemove (const std::string &searchAtt, const std::string &searchVal, const std::string &refdb)

Private Attributes

CppSQLite3DBmDB
 The DB.
std::string mFileName
 The physical location associated to the DicomDatabase (directory, db file...).


Detailed Description

Concrete TreeHandler which manages a Tree stored in a sqlite database.

Definition at line 13 of file creaImageIOTimestampDatabaseHandler.h.


Constructor & Destructor Documentation

creaImageIO::TimestampDatabaseHandler::TimestampDatabaseHandler ( const std::string &  filename  ) 

Ctor with database file name.

virtual creaImageIO::TimestampDatabaseHandler::~TimestampDatabaseHandler (  )  [virtual]

Dtor.


Member Function Documentation

const std::string& creaImageIO::TimestampDatabaseHandler::GetFileName (  )  const [inline]

Returns the sqlite db file name.

Definition at line 25 of file creaImageIOTimestampDatabaseHandler.h.

References mFileName.

00025 { return mFileName; }

bool creaImageIO::TimestampDatabaseHandler::Open (  ) 

Opens an existing 'source'.

bool creaImageIO::TimestampDatabaseHandler::Close (  ) 

Closes the 'source'.

bool creaImageIO::TimestampDatabaseHandler::Create (  ) 

Creates a new 'source'.

bool creaImageIO::TimestampDatabaseHandler::Destroy (  ) 

Destroys the 'source'.

std::string creaImageIO::TimestampDatabaseHandler::IsIndexed ( const std::string &  path,
const std::string &  refdb 
)

Returns the id of the path if it's indexed, blank otherwise.

bool creaImageIO::TimestampDatabaseHandler::AddDirectory ( const std::string &  parent,
const std::string &  path,
const time_t  lastModif,
const time_t  lastRead,
const std::string &  refdb 
)

Sets the current path's parent.

void creaImageIO::TimestampDatabaseHandler::AddFile ( const std::string &  path,
const time_t  lastModif,
const time_t  lastRead,
const std::string &  refdb 
)

Adds a new file to the database without a parent.

void creaImageIO::TimestampDatabaseHandler::AddFile ( const std::string &  parentId,
const std::string &  path,
const time_t  lastModif,
const time_t  lastRead,
const std::string &  refdb 
)

Adds a new file to the database with a parent.

void creaImageIO::TimestampDatabaseHandler::SetAttribute ( const std::string &  attName,
const std::string &  attValue,
const std::string &  searchParam,
const std::string &  searchValue 
)

Sets the attribute to the value passed as parameter where the searchParameter is searchValue.

void creaImageIO::TimestampDatabaseHandler::RemoveNode ( const std::string &  searchAtt,
const tree::Node node,
const std::string &  refdb 
)

Removes the given node.

void creaImageIO::TimestampDatabaseHandler::RemoveFile ( const std::string &  searchAtt,
const std::string &  searchVal,
const std::string &  refdb 
)

Removes the filename with the given pathname.

void creaImageIO::TimestampDatabaseHandler::CleanPath ( std::string &  str  )  const

Cleans the path name.

bool creaImageIO::TimestampDatabaseHandler::CheckTimestamp ( const std::string  pathId,
const time_t  lastModif,
const std::string &  refdb 
)

Checks the timestamp in the database and compares it with the given one.

void creaImageIO::TimestampDatabaseHandler::RemoveEntries ( const std::string  i_table,
const std::string  i_attribute,
const std::string  i_operand,
const std::string  i_val 
)

Removes the entries that match the given parameters.

bool creaImageIO::TimestampDatabaseHandler::DBOpen (  )  [protected]

Open the database.

bool creaImageIO::TimestampDatabaseHandler::DBCreate (  )  [protected]

Creates a new database on disk and the tables.

void creaImageIO::TimestampDatabaseHandler::DBRemove ( const std::string &  searchAtt,
const std::string &  searchVal,
const std::string &  refdb 
) [protected]


Member Data Documentation

CppSQLite3DB* creaImageIO::TimestampDatabaseHandler::mDB [private]

The DB.

Definition at line 98 of file creaImageIOTimestampDatabaseHandler.h.

std::string creaImageIO::TimestampDatabaseHandler::mFileName [private]

The physical location associated to the DicomDatabase (directory, db file...).

Definition at line 100 of file creaImageIOTimestampDatabaseHandler.h.

Referenced by GetFileName().


The documentation for this class was generated from the following file:
Generated on Mon Jun 22 10:50:00 2009 for CreaImageIO by  doxygen 1.5.3