#include <creaImageIOTimestampDatabaseHandler.h>
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 | |
CppSQLite3DB * | mDB |
The DB. | |
std::string | mFileName |
The physical location associated to the DicomDatabase (directory, db file...). |
Definition at line 13 of file creaImageIOTimestampDatabaseHandler.h.
creaImageIO::TimestampDatabaseHandler::TimestampDatabaseHandler | ( | const std::string & | filename | ) |
Ctor with database file name.
virtual creaImageIO::TimestampDatabaseHandler::~TimestampDatabaseHandler | ( | ) | [virtual] |
Dtor.
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] |
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().