winix/db/dbitemquery.h

80 lines
1.8 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010-2011, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_db_dbitemquery
#define headerfile_winix_db_dbitemquery
#include <vector>
#include "core/item.h"
struct DbItemQuery
{
// id and content_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, ref, modify_index
bool sel_url; // url
bool sel_type; // type (dir, file, none)
bool sel_link; // link_to, link_redirect
bool sel_file; // file_path, file_fs, file_type, has_thumb, hash, hash_type, file_size
bool sel_html_template; // template
bool sel_sort_index; // sort_index
bool sel_meta; // meta Space
bool where_id; //
bool where_parent_id; //
bool where_type;
bool where_file_type;
long id; // if where_id is true
long parent_id; // if where_parent_id is true
Item::Type type;
bool type_equal;
int file_type;
bool file_type_equal; // if true means file_type should be equal
bool sort_asc;
const std::vector<long> * id_tab; // != 0 if WhereIdIn was used
long limit;
long offset;
DbItemQuery();
void Clear();
void SetAllSel(bool sel);
void SetAllWhere(bool where_);
void SetAll(bool sel, bool where_);
void WhereId(long id_);
void WhereIdIn(const std::vector<long> & id_tab_list);
void WhereParentId(long parent_id_);
void WhereType(Item::Type type_, bool equal = true);
void WhereFileType(int file_t, bool equal = true);
void Limit(long l); // setting 0 turns off
void Offset(long o); // setting 0 turns off
};
#endif