refactoring

git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@523 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-11-17 01:04:01 +00:00
parent 2ca44ec361
commit dc5f002de3
17 changed files with 101 additions and 370 deletions

View File

@@ -51,7 +51,8 @@ struct Request
CookieTable cookie_table;
// environment variables
// they are not null -- when the server doesn't have such a variable it will be pointing into 'char_empty' which is default '\0'
// they are not null -- when the server doesn't have such a variable
// it will be pointing into 'char_empty' which is default '\0'
const char * env_request_method;
const char * env_request_uri;
const char * env_http_cookie;
@@ -68,22 +69,7 @@ struct Request
// is set after calling session_manager.SetSession()
Session * session;
// 'done_status' is set if 'done' is different than 'nothing'
Error done_status; // !! wywalic - jest przeciez w session
// what to do
// !! wywalic?
enum Result { err_internal, err404, err_per_denied, show_dir, show_item, show_item_by_id, add_item, edit_item, del_item, del_item_confirm, confirm, redirect, logout } result; // zamienic na to_do
// !! nowe skladowe
// current directory
// !! zapewnic aby byl minimum jeden katalog (root)
// !! moze nazwac to poprostu dir?
std::vector<Item*> dir_table;
bool is_item;
@@ -102,33 +88,17 @@ struct Request
// last notify
int notify_code;
// ------------------
// !! stare skladowe
// current directory e.g. /foo/bar
//std::vector<Item> cur_dir_table;
// id of the last directory (bar) or -1
//long dir;
// ------------------
// items in the current directory
// maybe without contents?
std::vector<Item> item_table;
// directories in the current directory
//std::vector<Item> dir_table2;
// current thread (if exists)
bool is_thread;
Thread thread;
std::vector<Thread> thread_tab;
// this string is used for many purposes such as redirecting
std::string str;
// if not empty means an address for redirecting to
std::string redirect_to;
// for debugging
void PrintGetTable();
@@ -146,12 +116,8 @@ struct Request
void SetCookie(const char * name, long value);
bool IsPostVar(const char * var);
std::string & PostVar(const char * var); // with a throw !!! wywalic te wyjatki ztad, niech zwraca pusty string jak nie znajdzie nic, albo referencje na jakis statyczny pusty string
//bool PostVar(const char * var, std::string & result);
// item_table[0] -> item
// !! to tez nie bedzie potrzebne
void CopyFirstItem();
std::string * PostVar(const char * var); // it can return null when there is no such a post variable
bool PostVar(const char * var, std::string & result);
void ReadEnvVariables();
@@ -187,8 +153,6 @@ private:
// it contains '\0'
const char char_empty;
// used when returning a reference to std::string (when the string doesn't exist)
const std::string string_empty;
const char * SetEnvVar(const char * var);