CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
catalog::SqlCatalog Class Reference

#include <catalog_sql.h>

Inheritance diagram for catalog::SqlCatalog:
Collaboration diagram for catalog::SqlCatalog:

Public Member Functions

 SqlCatalog (const CatalogDatabase &database, const std::string &statement)
 
shash::Md5 RetrieveMd5 (const int idx_high, const int idx_low) const
 
shash::Any RetrieveHashBlob (const int idx_column, const shash::Algorithms hash_algo, const char hash_suffix=shash::kSuffixNone) const
 
shash::Any RetrieveHashHex (const int idx_column, const char hash_suffix=shash::kSuffixNone) const
 
bool BindMd5 (const int idx_high, const int idx_low, const shash::Md5 &hash)
 
bool BindHashBlob (const int idx_column, const shash::Any &hash)
 
- Public Member Functions inherited from sqlite::Sql
 Sql (sqlite3 *sqlite_db, const std::string &statement)
 
virtual ~Sql ()
 
bool Execute ()
 
bool FetchRow ()
 
std::string DebugResultTable ()
 
bool Reset ()
 
int GetLastError () const
 
std::string GetLastErrorMsg () const
 
bool BindBlob (const int index, const void *value, const unsigned size)
 
bool BindBlobTransient (const int index, const void *value, const unsigned size)
 
bool BindDouble (const int index, const double value)
 
bool BindInt (const int index, const int value)
 
bool BindInt64 (const int index, const sqlite3_int64 value)
 
bool BindNull (const int index)
 
bool BindTextTransient (const int index, const std::string &value)
 
bool BindTextTransient (const int index, const char *value, const int size)
 
bool BindText (const int index, const std::string &value)
 
bool BindText (const int index, const char *value, const int size, void(*dtor)(void *)=SQLITE_STATIC)
 
template<typename T >
bool Bind (const int index, const T &value)
 
int RetrieveType (const int idx_column) const
 
int RetrieveBytes (const int idx_column) const
 
const void * RetrieveBlob (const int idx_column) const
 
double RetrieveDouble (const int idx_column) const
 
int RetrieveInt (const int idx_column) const
 
sqlite3_int64 RetrieveInt64 (const int idx_column) const
 
const unsigned char * RetrieveText (const int idx_column) const
 
std::string RetrieveString (const int idx_column) const
 
template<typename T >
Retrieve (const int index)
 
template<>
bool Bind (const int index, const int &value)
 
template<>
bool Bind (const int index, const unsigned int &value)
 
template<>
bool Bind (const int index, const uint64_t &value)
 
template<>
bool Bind (const int index, const sqlite3_int64 &value)
 
template<>
bool Bind (const int index, const std::string &value)
 
template<>
bool Bind (const int index, const float &value)
 
template<>
bool Bind (const int index, const double &value)
 
template<>
int Retrieve (const int index)
 
template<>
bool Retrieve (const int index)
 
template<>
sqlite3_int64 Retrieve (const int index)
 
template<>
uint64_t Retrieve (const int index)
 
template<>
std::string Retrieve (const int index)
 
template<>
float Retrieve (const int index)
 
template<>
double Retrieve (const int index)
 

Protected Member Functions

 SqlCatalog ()
 
- Protected Member Functions inherited from sqlite::Sql
 Sql ()
 
bool IsInitialized () const
 
bool Init (const sqlite3 *database, const std::string &statement)
 
void DeferredInit (const sqlite3 *database, const char *statement)
 
bool Successful () const
 

Detailed Description

Base class for all SQL statement classes. It wraps a single SQL statement and all necessary calls of the sqlite3 API to deal with this statement.

Definition at line 78 of file catalog_sql.h.

Constructor & Destructor Documentation

catalog::SqlCatalog::SqlCatalog ( const CatalogDatabase database,
const std::string &  statement 
)
inline

Basic constructor to use this class for a specific statement.

Parameters
databasethe database to use the query on
statementthe statement to prepare

Definition at line 85 of file catalog_sql.h.

Here is the call graph for this function:

catalog::SqlCatalog::SqlCatalog ( )
inlineprotected

Definition at line 164 of file catalog_sql.h.

Member Function Documentation

bool catalog::SqlCatalog::BindHashBlob ( const int  idx_column,
const shash::Any hash 
)
inline

Wrapper for binding a cryptographic hash. Algorithm of hash has to be elsewhere (in flags).

Parameters
idx_columnoffset of the blob field in database query
hashthe hash to bind in the query
Returns
true on success, false otherwise

Definition at line 155 of file catalog_sql.h.

Here is the call graph for this function:

bool catalog::SqlCatalog::BindMd5 ( const int  idx_high,
const int  idx_low,
const shash::Md5 hash 
)
inline

Wrapper for binding a MD5-ified path name.

Parameters
idx_highoffset of most significant bits in database query
idx_lowoffset of least significant bits in database query
hashthe hash to bind in the query
Returns
true on success, false otherwise

Definition at line 138 of file catalog_sql.h.

Referenced by swissknife::CommandMigrate::MigrationWorker_20x::MigrateNestedCatalogMountPoints().

Here is the call graph for this function:

Here is the caller graph for this function:

shash::Any catalog::SqlCatalog::RetrieveHashBlob ( const int  idx_column,
const shash::Algorithms  hash_algo,
const char  hash_suffix = shash::kSuffixNone 
) const
inline

Wrapper for retrieving a cryptographic hash from a blob field.

Definition at line 102 of file catalog_sql.h.

Here is the call graph for this function:

shash::Any catalog::SqlCatalog::RetrieveHashHex ( const int  idx_column,
const char  hash_suffix = shash::kSuffixNone 
) const
inline

Wrapper for retrieving a cryptographic hash from a text field.

Definition at line 122 of file catalog_sql.h.

Here is the call graph for this function:

shash::Md5 catalog::SqlCatalog::RetrieveMd5 ( const int  idx_high,
const int  idx_low 
) const
inline

Wrapper for retrieving MD5-ified path names.

Parameters
idx_highoffset of most significant bits in database query
idx_lowoffset of least significant bits in database query
Returns
the retrieved MD5 hash

Definition at line 95 of file catalog_sql.h.

Here is the call graph for this function:


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