creaImageIO::Synchronizer Class Reference

Synchronizes a given database with disk. More...

#include <creaImageIOSynchron.h>

Collaboration diagram for creaImageIO::Synchronizer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Synchronizer (const std::string &path)
virtual ~Synchronizer ()
void Initialize ()
void InsertAddOp (const std::string &path, const std::string &recursive, const std::string &nChildren, const std::string &refdb)
void InsertIgnoreFile (const std::string &addKey, const std::string &path, const std::string &remove, const std::string &time, const std::string &refdb)
void RemoveEntry (const std::string i_table, const std::string i_key)
void RemoveEntries (const std::string i_table, const std::string i_attribute, const std::string i_operand, const std::string i_key)
void GetFileList (std::vector< AddList > &files, const std::string &refdb)
void GetIgnoredFiles (const std::string &key, std::vector< std::string > &ignoreList)
std::string GetAttribute (const std::string &attribute, const std::string &table, const std::string &searchParam, const std::string &searchValue, const std::string &refdb)
void SetAttribute (const std::string &attribute, const std::string &table, const std::string &value, const std::string &searchParam, const std::string &searchValue, const std::string &refdb)
 Synchronizer (TreeHandler *th)
 Ctor.
 ~Synchronizer ()
 Dtor.
void SetTreeHandler (TreeHandler *handler)
 Sets the tree handler to use in order to synchronize with a given database.
std::string Synchronize (bool update)
bool FileExists (std::string file)
 Checks if the file given as a parameter exists in the drive.
void AttributesMatch (bool update, std::string file, std::stringstream &mess)

Public Attributes

std::vector< AddListmAddList
std::vector< RemoveListmIgnoreList

Private Member Functions

void CreateDB ()
void UpdateAddList (const std::string &refdb)
void CleanList (const std::string &refdb)
void CleanName (std::string &str) const
std::vector
< std::string > 
GetIgnoreList (const std::string &i_key)
void SynchronizeFile (bool update, std::string file, std::stringstream &message)
 Synchronizes the given file, doing the action required and returning the result on the string supplied.

Private Attributes

CppSQLite3DBmDB
 The DB.
std::string pathDB
TreeHandlermHandler
 The tree handler.
ImageReader mReader
 The image reader.


Detailed Description

Synchronizes a given database with disk.

Definition at line 49 of file creaImageIOSynchron.h.


Constructor & Destructor Documentation

creaImageIO::Synchronizer::Synchronizer ( const std::string &  path  ) 

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

creaImageIO::Synchronizer::Synchronizer ( TreeHandler th  ) 

Ctor.

creaImageIO::Synchronizer::~Synchronizer (  ) 

Dtor.


Member Function Documentation

void creaImageIO::Synchronizer::Initialize (  ) 

void creaImageIO::Synchronizer::InsertAddOp ( const std::string &  path,
const std::string &  recursive,
const std::string &  nChildren,
const std::string &  refdb 
)

void creaImageIO::Synchronizer::InsertIgnoreFile ( const std::string &  addKey,
const std::string &  path,
const std::string &  remove,
const std::string &  time,
const std::string &  refdb 
)

void creaImageIO::Synchronizer::RemoveEntry ( const std::string  i_table,
const std::string  i_key 
)

void creaImageIO::Synchronizer::RemoveEntries ( const std::string  i_table,
const std::string  i_attribute,
const std::string  i_operand,
const std::string  i_key 
)

void creaImageIO::Synchronizer::GetFileList ( std::vector< AddList > &  files,
const std::string &  refdb 
)

void creaImageIO::Synchronizer::GetIgnoredFiles ( const std::string &  key,
std::vector< std::string > &  ignoreList 
)

std::string creaImageIO::Synchronizer::GetAttribute ( const std::string &  attribute,
const std::string &  table,
const std::string &  searchParam,
const std::string &  searchValue,
const std::string &  refdb 
)

void creaImageIO::Synchronizer::SetAttribute ( const std::string &  attribute,
const std::string &  table,
const std::string &  value,
const std::string &  searchParam,
const std::string &  searchValue,
const std::string &  refdb 
)

void creaImageIO::Synchronizer::CreateDB (  )  [private]

void creaImageIO::Synchronizer::UpdateAddList ( const std::string &  refdb  )  [private]

void creaImageIO::Synchronizer::CleanList ( const std::string &  refdb  )  [private]

void creaImageIO::Synchronizer::CleanName ( std::string &  str  )  const [private]

std::vector<std::string> creaImageIO::Synchronizer::GetIgnoreList ( const std::string &  i_key  )  [private]

void creaImageIO::Synchronizer::SetTreeHandler ( TreeHandler handler  )  [inline]

Sets the tree handler to use in order to synchronize with a given database.

Definition at line 20 of file creaImageIOSynchronizer.h.

References mHandler.

00020 {mHandler=handler;}

std::string creaImageIO::Synchronizer::Synchronize ( bool  update  ) 

Synchronizes the database in the current tree handler with disk by doing the passed action. If it is true, the database will be updated, otherwise a warning message will be returned.

bool creaImageIO::Synchronizer::FileExists ( std::string  file  ) 

Checks if the file given as a parameter exists in the drive.

void creaImageIO::Synchronizer::AttributesMatch ( bool  update,
std::string  file,
std::stringstream &  mess 
)

Checks if the attributes of the node given as a parameter matchwith it correspondent file in disk NB: This method doesn't check the existence of the file, so FileExists should be called before.

void creaImageIO::Synchronizer::SynchronizeFile ( bool  update,
std::string  file,
std::stringstream &  message 
) [private]

Synchronizes the given file, doing the action required and returning the result on the string supplied.


Member Data Documentation

std::vector<AddList> creaImageIO::Synchronizer::mAddList

Definition at line 82 of file creaImageIOSynchron.h.

std::vector<RemoveList> creaImageIO::Synchronizer::mIgnoreList

Definition at line 83 of file creaImageIOSynchron.h.

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

The DB.

Definition at line 87 of file creaImageIOSynchron.h.

std::string creaImageIO::Synchronizer::pathDB [private]

Definition at line 88 of file creaImageIOSynchron.h.

TreeHandler* creaImageIO::Synchronizer::mHandler [private]

The tree handler.

Definition at line 33 of file creaImageIOSynchronizer.h.

Referenced by SetTreeHandler().

ImageReader creaImageIO::Synchronizer::mReader [private]

The image reader.

Definition at line 35 of file creaImageIOSynchronizer.h.


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