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:
97
db/dbitemquery.cpp
Executable file
97
db/dbitemquery.cpp
Executable file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "dbitemquery.h"
|
||||
|
||||
|
||||
|
||||
DbItemQuery::DbItemQuery()
|
||||
{
|
||||
sort_asc = true;
|
||||
auth_equal = true;
|
||||
|
||||
SetAll(true, false);
|
||||
|
||||
id = -1;
|
||||
parent_id = -1;
|
||||
type = Item::none;
|
||||
auth = Item::auth_none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DbItemQuery::SetAllSel(bool sel)
|
||||
{
|
||||
sel_parent_id = sel;
|
||||
sel_user_id = sel;
|
||||
sel_group_id = sel;
|
||||
sel_guest_name = sel;
|
||||
sel_privileges = sel;
|
||||
sel_date = sel;
|
||||
sel_subject = sel;
|
||||
sel_content = sel;
|
||||
sel_url = sel;
|
||||
sel_type = sel;
|
||||
sel_default_item = sel;
|
||||
sel_auth = sel;
|
||||
sel_html_template = sel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DbItemQuery::SetAllWhere(bool where_)
|
||||
{
|
||||
where_id = where_;
|
||||
where_parent_id = where_;
|
||||
where_type = where_;
|
||||
where_auth = where_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DbItemQuery::SetAll(bool sel, bool where_)
|
||||
{
|
||||
SetAllSel(sel);
|
||||
SetAllWhere(where_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DbItemQuery::WhereId(long id_)
|
||||
{
|
||||
where_id = true;
|
||||
id = id_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DbItemQuery::WhereParentId(long parent_id_)
|
||||
{
|
||||
where_parent_id = true;
|
||||
parent_id = parent_id_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DbItemQuery::WhereType(Item::Type type_)
|
||||
{
|
||||
where_type = true;
|
||||
type = type_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void DbItemQuery::WhereAuth(Item::Auth st, bool equal)
|
||||
{
|
||||
where_auth = true;
|
||||
auth = st;
|
||||
auth_equal = equal;
|
||||
}
|
||||
|
Reference in New Issue
Block a user