kodi
Public Member Functions | Protected Member Functions | List of all members
CViewDatabase Class Reference
Inheritance diagram for CViewDatabase:
Inheritance graph
[legend]
Collaboration diagram for CViewDatabase:
Collaboration graph
[legend]

Public Member Functions

bool Open () override
 
bool GetViewState (const std::string &path, int windowID, CViewState &state, const std::string &skin)
 
bool SetViewState (const std::string &path, int windowID, const CViewState &state, const std::string &skin)
 
bool ClearViewStates (int windowID)
 
- Public Member Functions inherited from CDatabase
bool IsOpen ()
 
virtual void Close ()
 
bool Compress (bool bForce=true)
 
void Interrupt ()
 
bool Open (const DatabaseSettings &db)
 
void BeginTransaction ()
 
virtual bool CommitTransaction ()
 
void RollbackTransaction ()
 
void CopyDB (const std::string &latestDb)
 
void DropAnalytics ()
 
std::string PrepareSQL (std::string strStmt,...) const
 
std::string GetSingleValue (const std::string &strTable, const std::string &strColumn, const std::string &strWhereClause=std::string(), const std::string &strOrderBy=std::string()) const
 Get a single value from a table. More...
 
std::string GetSingleValue (const std::string &query) const
 
std::string GetSingleValue (const std::string &query, const std::unique_ptr< dbiplus::Dataset > &ds) const
 Get a single value from a query on a dataset. More...
 
int GetSingleValueInt (const std::string &strTable, const std::string &strColumn, const std::string &strWhereClause=std::string(), const std::string &strOrderBy=std::string()) const
 Get a single integer value from a table. More...
 
int GetSingleValueInt (const std::string &query) const
 
int GetSingleValueInt (const std::string &query, const std::unique_ptr< dbiplus::Dataset > &ds) const
 Get a single integer value from a query on a dataset. More...
 
bool DeleteValues (const std::string &strTable, const Filter &filter=Filter())
 Delete values from a table. More...
 
bool ExecuteQuery (const std::string &strQuery)
 Execute a query that does not return any result. Note that if BeginMultipleExecute() has been called, the query will be queued until CommitMultipleExecute() is called. More...
 
bool ResultQuery (const std::string &strQuery) const
 Execute a query that returns a result. More...
 
bool BeginMultipleExecute ()
 Start a multiple execution queue. Any ExecuteQuery() function following this call will be queued rather than executed until CommitMultipleExecute() is performed. NOTE: Queries that rely on any queued execute query will not function as expected during this period! More...
 
bool CommitMultipleExecute ()
 Commit the multiple execution queue to the database. Queries are performed within a transaction, and the transaction is rolled back should any one query fail. More...
 
bool QueueInsertQuery (const std::string &strQuery)
 Put an INSERT or REPLACE query in the queue. More...
 
bool CommitInsertQueries ()
 Commit all queries in the queue. More...
 
size_t GetInsertQueriesCount ()
 Get the number of INSERT queries in the queue. More...
 
bool QueueDeleteQuery (const std::string &strQuery)
 Put a DELETE query in the queue. More...
 
bool CommitDeleteQueries ()
 Commit all queued DELETE queries. More...
 
size_t GetDeleteQueriesCount ()
 Get the number of DELETE queries in the queue. More...
 
virtual bool GetFilter (CDbUrl &dbUrl, Filter &filter, SortDescription &sorting)
 
virtual bool BuildSQL (const std::string &strBaseDir, const std::string &strQuery, Filter &filter, std::string &strSQL, CDbUrl &dbUrl)
 
virtual bool BuildSQL (const std::string &strBaseDir, const std::string &strQuery, Filter &filter, std::string &strSQL, CDbUrl &dbUrl, SortDescription &sorting)
 
bool Connect (const std::string &dbName, const DatabaseSettings &db, bool create)
 

Protected Member Functions

void CreateTables () override
 
void CreateAnalytics () override
 
void UpdateTables (int version) override
 
int GetSchemaVersion () const override
 
const char * GetBaseDBName () const override
 
- Protected Member Functions inherited from CDatabase
void Split (const std::string &strFileNameAndPath, std::string &strPath, std::string &strFileName)
 
bool CreateDatabase ()
 Create database tables and analytics as needed. Calls CreateTables() and CreateAnalytics() on child classes.
 
virtual int GetMinSchemaVersion () const
 
int GetDBVersion ()
 
bool BuildSQL (const std::string &strQuery, const Filter &filter, std::string &strSQL) const
 

Additional Inherited Members

- Protected Attributes inherited from CDatabase
bool m_sqlite
 whether we use sqlite (defaults to true)
 
std::unique_ptr< dbiplus::Databasem_pDB
 
std::unique_ptr< dbiplus::Datasetm_pDS
 
std::unique_ptr< dbiplus::Datasetm_pDS2
 
const CProfileManagerm_profileManager
 

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