sql_storage.cc File Reference

#include <limits.h>
#include "sql_storage.h"
#include "tools.h"
#include "update_manager.h"
#include "string_converter.h"
#include "config_manager.h"
#include "filesystem.h"

Go to the source code of this file.

Defines

#define MAX_REMOVE_SIZE   10000
#define MAX_REMOVE_RECURSION   500
#define SQL_NULL   "NULL"
#define RESOURCE_SEP   '|'
#define TQ(data)   QTB << data << QTE
#define TQD(data1, data2)   TQ(data1) << '.' << TQ(data2)
#define SEL_F_QUOTED   << TQ('f') <<
#define SEL_RF_QUOTED   << TQ("rf") <<
#define SEL_EQ_SP_FQ_DT_BQ   << QTE << ',' << TQ('f') << '.' << QTB <<
#define SEL_EQ_SP_RFQ_DT_BQ   << QTE << ',' << TQ("rf") << '.' << QTB <<
#define SELECT_DATA_FOR_STRINGBUFFER
#define SQL_QUERY_FOR_STRINGBUFFER
#define SQL_QUERY   sql_query
#define FLD(field)   << TQD('a',field) <<
#define FLD(field)   << TQD('a',field) <<

Enumerations

enum  {
  _id = 0, _ref_id, _parent_id, _object_type,
  _upnp_class, _dc_title, _location, _location_hash,
  _metadata, _auxdata, _resources, _update_id,
  _mime_type, _flags, _track_number, _service_id,
  _ref_upnp_class, _ref_location, _ref_metadata, _ref_auxdata,
  _ref_resources, _ref_mime_type, _ref_service_id, _as_persistent
}

Detailed Description

Definition in file sql_storage.cc.


Define Documentation

#define FLD ( field   )     << TQD('a',field) <<
#define FLD ( field   )     << TQD('a',field) <<
#define MAX_REMOVE_RECURSION   500
#define MAX_REMOVE_SIZE   10000

Definition at line 46 of file sql_storage.cc.

Referenced by SQLStorage::_recursiveRemove().

#define RESOURCE_SEP   '|'

Definition at line 51 of file sql_storage.cc.

Referenced by SQLStorage::_addUpdateObject(), and SQLStorage::createObjectFromRow().

#define SEL_EQ_SP_FQ_DT_BQ   << QTE << ',' << TQ('f') << '.' << QTB <<

Definition at line 90 of file sql_storage.cc.

#define SEL_EQ_SP_RFQ_DT_BQ   << QTE << ',' << TQ("rf") << '.' << QTB <<

Definition at line 91 of file sql_storage.cc.

#define SEL_F_QUOTED   << TQ('f') <<

Definition at line 86 of file sql_storage.cc.

#define SEL_RF_QUOTED   << TQ("rf") <<

Definition at line 87 of file sql_storage.cc.

#define SELECT_DATA_FOR_STRINGBUFFER
Value:
TQ('f') << '.' << QTB << "id" \
    SEL_EQ_SP_FQ_DT_BQ "ref_id" \
    SEL_EQ_SP_FQ_DT_BQ "parent_id" \
    SEL_EQ_SP_FQ_DT_BQ "object_type" \
    SEL_EQ_SP_FQ_DT_BQ "upnp_class" \
    SEL_EQ_SP_FQ_DT_BQ "dc_title" \
    SEL_EQ_SP_FQ_DT_BQ "location" \
    SEL_EQ_SP_FQ_DT_BQ "location_hash" \
    SEL_EQ_SP_FQ_DT_BQ "metadata" \
    SEL_EQ_SP_FQ_DT_BQ "auxdata" \
    SEL_EQ_SP_FQ_DT_BQ "resources" \
    SEL_EQ_SP_FQ_DT_BQ "update_id" \
    SEL_EQ_SP_FQ_DT_BQ "mime_type" \
    SEL_EQ_SP_FQ_DT_BQ "flags" \
    SEL_EQ_SP_FQ_DT_BQ "track_number" \
    SEL_EQ_SP_FQ_DT_BQ "service_id" \
    SEL_EQ_SP_RFQ_DT_BQ "upnp_class" \
    SEL_EQ_SP_RFQ_DT_BQ "location" \
    SEL_EQ_SP_RFQ_DT_BQ "metadata" \
    SEL_EQ_SP_RFQ_DT_BQ "auxdata" \
    SEL_EQ_SP_RFQ_DT_BQ "resources" \
    SEL_EQ_SP_RFQ_DT_BQ "mime_type" \
    SEL_EQ_SP_RFQ_DT_BQ "service_id" << QTE \
    << ',' << TQD("as","persistent")

Definition at line 93 of file sql_storage.cc.

#define SQL_NULL   "NULL"
#define SQL_QUERY   sql_query
#define SQL_QUERY_FOR_STRINGBUFFER
Value:
"SELECT " << SELECT_DATA_FOR_STRINGBUFFER << \
    " FROM " << TQ(CDS_OBJECT_TABLE) << ' ' << TQ('f') << " LEFT JOIN " \
    << TQ(CDS_OBJECT_TABLE) << ' ' << TQ("rf") << " ON " << TQD('f',"ref_id") \
    << '=' << TQD("rf","id") << " LEFT JOIN " << TQ(AUTOSCAN_TABLE) << ' ' \
    << TQ("as") << " ON " << TQD("as","obj_id") << '=' << TQD('f',"id") << ' '

Definition at line 119 of file sql_storage.cc.

Referenced by SQLStorage::init().

#define TQ ( data   )     QTB << data << QTE
#define TQD ( data1,
data2   )     TQ(data1) << '.' << TQ(data2)

Enumeration Type Documentation

anonymous enum
Enumerator:
_id 
_ref_id 
_parent_id 
_object_type 
_upnp_class 
_dc_title 
_location 
_location_hash 
_metadata 
_auxdata 
_resources 
_update_id 
_mime_type 
_flags 
_track_number 
_service_id 
_ref_upnp_class 
_ref_location 
_ref_metadata 
_ref_auxdata 
_ref_resources 
_ref_mime_type 
_ref_service_id 
_as_persistent 

Definition at line 53 of file sql_storage.cc.


Generated on Fri Mar 26 20:16:55 2010 for MediaTomb by  doxygen 1.6.1