Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CDatabaseQueryRule Class Referenceabstract

#include <DatabaseQuery.h>

Inheritance diagram for CDatabaseQueryRule:
CTextureRule KODI::PLAYLIST::CSmartPlaylistRule

Public Types

enum  SEARCH_OPERATOR {
  OPERATOR_START = 0 , OPERATOR_CONTAINS , OPERATOR_DOES_NOT_CONTAIN , OPERATOR_EQUALS ,
  OPERATOR_DOES_NOT_EQUAL , OPERATOR_STARTS_WITH , OPERATOR_ENDS_WITH , OPERATOR_GREATER_THAN ,
  OPERATOR_LESS_THAN , OPERATOR_AFTER , OPERATOR_BEFORE , OPERATOR_IN_THE_LAST ,
  OPERATOR_NOT_IN_THE_LAST , OPERATOR_TRUE , OPERATOR_FALSE , OPERATOR_BETWEEN ,
  OPERATOR_END
}
 
enum  FIELD_TYPE {
  TEXT_FIELD = 0 , REAL_FIELD , NUMERIC_FIELD , DATE_FIELD ,
  PLAYLIST_FIELD , SECONDS_FIELD , BOOLEAN_FIELD , TEXTIN_FIELD
}
 

Public Member Functions

 CDatabaseQueryRule ()
 
virtual ~CDatabaseQueryRule ()=default
 
virtual bool Load (const TiXmlNode *node, const std::string &encoding="UTF-8")
 
virtual bool Load (const CVariant &obj)
 
virtual bool Save (TiXmlNode *parent) const
 
virtual bool Save (CVariant &obj) const
 
std::string GetParameter () const
 
void SetParameter (const std::string &value)
 
void SetParameter (const std::vector< std::string > &values)
 
virtual std::string GetWhereClause (const CDatabase &db, const std::string &strType) const
 

Static Public Member Functions

static std::string GetLocalizedOperator (SEARCH_OPERATOR oper)
 
static void GetAvailableOperators (std::vector< std::string > &operatorList)
 

Public Attributes

int m_field
 
SEARCH_OPERATOR m_operator
 
std::vector< std::string > m_parameter
 

Protected Member Functions

virtual std::string GetField (int field, const std::string &type) const =0
 
virtual FIELD_TYPE GetFieldType (int field) const =0
 
virtual int TranslateField (const char *field) const =0
 
virtual std::string TranslateField (int field) const =0
 
std::string ValidateParameter (const std::string &parameter) const
 
virtual std::string FormatParameter (const std::string &negate, const std::string &oper, const CDatabase &db, const std::string &type) const
 
virtual std::string FormatWhereClause (const std::string &negate, const std::string &oper, const std::string &param, const CDatabase &db, const std::string &type) const
 
virtual SEARCH_OPERATOR GetOperator (const std::string &type) const
 
virtual std::string GetOperatorString (SEARCH_OPERATOR op) const
 
virtual std::string GetBooleanQuery (const std::string &negate, const std::string &strType) const
 

Static Protected Member Functions

static SEARCH_OPERATOR TranslateOperator (const char *oper)
 
static std::string TranslateOperator (SEARCH_OPERATOR oper)
 

Member Enumeration Documentation

◆ FIELD_TYPE

Enumerator
TEXT_FIELD 
REAL_FIELD 
NUMERIC_FIELD 
DATE_FIELD 
PLAYLIST_FIELD 
SECONDS_FIELD 
BOOLEAN_FIELD 
TEXTIN_FIELD 

◆ SEARCH_OPERATOR

Enumerator
OPERATOR_START 
OPERATOR_CONTAINS 
OPERATOR_DOES_NOT_CONTAIN 
OPERATOR_EQUALS 
OPERATOR_DOES_NOT_EQUAL 
OPERATOR_STARTS_WITH 
OPERATOR_ENDS_WITH 
OPERATOR_GREATER_THAN 
OPERATOR_LESS_THAN 
OPERATOR_AFTER 
OPERATOR_BEFORE 
OPERATOR_IN_THE_LAST 
OPERATOR_NOT_IN_THE_LAST 
OPERATOR_TRUE 
OPERATOR_FALSE 
OPERATOR_BETWEEN 
OPERATOR_END 

Constructor & Destructor Documentation

◆ CDatabaseQueryRule()

CDatabaseQueryRule::CDatabaseQueryRule ( )

◆ ~CDatabaseQueryRule()

virtual CDatabaseQueryRule::~CDatabaseQueryRule ( )
virtualdefault

Member Function Documentation

◆ FormatParameter()

std::string CDatabaseQueryRule::FormatParameter ( const std::string & negate,
const std::string & oper,
const CDatabase & db,
const std::string & type ) const
protectedvirtual

◆ FormatWhereClause()

std::string CDatabaseQueryRule::FormatWhereClause ( const std::string & negate,
const std::string & oper,
const std::string & param,
const CDatabase & db,
const std::string & type ) const
protectedvirtual

◆ GetAvailableOperators()

void CDatabaseQueryRule::GetAvailableOperators ( std::vector< std::string > & operatorList)
static

◆ GetBooleanQuery()

virtual std::string CDatabaseQueryRule::GetBooleanQuery ( const std::string & negate,
const std::string & strType ) const
inlineprotectedvirtual

◆ GetField()

virtual std::string CDatabaseQueryRule::GetField ( int field,
const std::string & type ) const
protectedpure virtual

◆ GetFieldType()

virtual FIELD_TYPE CDatabaseQueryRule::GetFieldType ( int field) const
protectedpure virtual

◆ GetLocalizedOperator()

std::string CDatabaseQueryRule::GetLocalizedOperator ( SEARCH_OPERATOR oper)
static

◆ GetOperator()

virtual SEARCH_OPERATOR CDatabaseQueryRule::GetOperator ( const std::string & type) const
inlineprotectedvirtual

◆ GetOperatorString()

std::string CDatabaseQueryRule::GetOperatorString ( SEARCH_OPERATOR op) const
protectedvirtual

◆ GetParameter()

std::string CDatabaseQueryRule::GetParameter ( ) const

◆ GetWhereClause()

std::string CDatabaseQueryRule::GetWhereClause ( const CDatabase & db,
const std::string & strType ) const
virtual

◆ Load() [1/2]

bool CDatabaseQueryRule::Load ( const CVariant & obj)
virtual

◆ Load() [2/2]

bool CDatabaseQueryRule::Load ( const TiXmlNode * node,
const std::string & encoding = "UTF-8" )
virtual

◆ Save() [1/2]

bool CDatabaseQueryRule::Save ( CVariant & obj) const
virtual

◆ Save() [2/2]

bool CDatabaseQueryRule::Save ( TiXmlNode * parent) const
virtual

◆ SetParameter() [1/2]

void CDatabaseQueryRule::SetParameter ( const std::string & value)

◆ SetParameter() [2/2]

void CDatabaseQueryRule::SetParameter ( const std::vector< std::string > & values)

◆ TranslateField() [1/2]

virtual int CDatabaseQueryRule::TranslateField ( const char * field) const
protectedpure virtual

◆ TranslateField() [2/2]

virtual std::string CDatabaseQueryRule::TranslateField ( int field) const
protectedpure virtual

◆ TranslateOperator() [1/2]

CDatabaseQueryRule::SEARCH_OPERATOR CDatabaseQueryRule::TranslateOperator ( const char * oper)
staticprotected

◆ TranslateOperator() [2/2]

std::string CDatabaseQueryRule::TranslateOperator ( SEARCH_OPERATOR oper)
staticprotected

◆ ValidateParameter()

std::string CDatabaseQueryRule::ValidateParameter ( const std::string & parameter) const
protected

Member Data Documentation

◆ m_field

int CDatabaseQueryRule::m_field

◆ m_operator

SEARCH_OPERATOR CDatabaseQueryRule::m_operator

◆ m_parameter

std::vector<std::string> CDatabaseQueryRule::m_parameter

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