added: TextStream a class similar to std::ostringstream
but with a Clear() method
the dynamic allocated buffer can be easily reused
added: DbTextStream a special version of a stream
used to create a database string query
everything is escaped by default
added: DbBase a base class with some basic methods for communicating
with the database
added: DbConn a class for managing connection to the database
changed: some refactoring in Db class
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@655 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
67
db/dbitemquery.h
Executable file
67
db/dbitemquery.h
Executable file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfile_winix_db_dbitemquery
|
||||
#define headerfile_winix_db_dbitemquery
|
||||
|
||||
|
||||
#include "core/item.h"
|
||||
|
||||
|
||||
|
||||
|
||||
struct DbItemQuery
|
||||
{
|
||||
// id is selected always
|
||||
bool sel_parent_id; // parent_id
|
||||
bool sel_user_id; // user_id, modification_user_id
|
||||
bool sel_group_id; // group_id
|
||||
bool sel_guest_name; // guest_name
|
||||
bool sel_privileges; // privileges
|
||||
bool sel_date; // date_creation, date_modification
|
||||
bool sel_subject; // subject
|
||||
bool sel_content; // content, content_type, (content_id)
|
||||
bool sel_url; // url
|
||||
bool sel_type; // type (dir, file, none)
|
||||
bool sel_default_item; // default_item
|
||||
bool sel_auth; // auth, auth_path
|
||||
bool sel_html_template; // template
|
||||
|
||||
bool where_id; //
|
||||
bool where_parent_id; //
|
||||
bool where_type;
|
||||
bool where_auth;
|
||||
|
||||
long id; // if where_id is true
|
||||
long parent_id; // if where_parent_id is true
|
||||
Item::Type type;
|
||||
Item::Auth auth;
|
||||
bool auth_equal; // if true means auth should be equal
|
||||
bool sort_asc;
|
||||
|
||||
|
||||
DbItemQuery();
|
||||
|
||||
void SetAllSel(bool sel);
|
||||
void SetAllWhere(bool where_);
|
||||
void SetAll(bool sel, bool where_);
|
||||
|
||||
void WhereId(long id_);
|
||||
void WhereParentId(long parent_id_);
|
||||
void WhereType(Item::Type type_);
|
||||
void WhereAuth(Item::Auth st, bool equal = true);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user