added: issues ticket system
added functions: ticket, createticket, editticket (there is no 'rm' function working for tickets yet) changed: mount parser and mount points now we have more parameters (arguments in parameters) some refactoring in functions 'emacs' and 'mkdir' git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@554 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
79
core/mount.h
79
core/mount.h
@@ -16,6 +16,8 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
|
||||
|
||||
class Mount
|
||||
{
|
||||
public:
|
||||
@@ -24,42 +26,71 @@ public:
|
||||
enum Type
|
||||
{
|
||||
cms = 0,
|
||||
thread
|
||||
thread,
|
||||
ticket
|
||||
};
|
||||
|
||||
|
||||
enum Param
|
||||
// the first should be with 0 index
|
||||
// the last should be 'none'
|
||||
enum ParamCode
|
||||
{
|
||||
none = 0,
|
||||
asc,
|
||||
desc,
|
||||
withheader,
|
||||
withinfo,
|
||||
thread_with_header,
|
||||
thread_with_info,
|
||||
restrictcreatethread,
|
||||
only_root_can_remove,
|
||||
can_use_emacs_on,
|
||||
can_use_mkdir_on
|
||||
par_page = 0,
|
||||
par_thread,
|
||||
par_ticket,
|
||||
par_ticket_type,
|
||||
par_ticket_type_default,
|
||||
par_ticket_status,
|
||||
par_ticket_status_default,
|
||||
par_ticket_priority,
|
||||
par_ticket_priority_default,
|
||||
par_ticket_category,
|
||||
par_ticket_category_default,
|
||||
par_ticket_expected,
|
||||
par_ticket_expected_default,
|
||||
par_createthread_on,
|
||||
par_createticket_on,
|
||||
par_only_root_remove,
|
||||
par_emacs_on,
|
||||
par_mkdir_on,
|
||||
|
||||
par_none
|
||||
};
|
||||
|
||||
typedef std::vector<std::string> ParamArg;
|
||||
|
||||
long dir_id;
|
||||
|
||||
struct ParamRow
|
||||
{
|
||||
bool defined;
|
||||
ParamArg arg;
|
||||
|
||||
ParamRow() { defined = false; }
|
||||
void Clear() { defined = false; arg.clear(); }
|
||||
};
|
||||
|
||||
typedef std::vector<ParamRow> Param;
|
||||
Param param;
|
||||
|
||||
long dir_id;
|
||||
Type type;
|
||||
|
||||
|
||||
|
||||
Mount();
|
||||
const char * TypeToStr();
|
||||
bool ParseStrParam(const std::string & param, const std::vector<int> & args);
|
||||
bool IsParam(Param p);
|
||||
bool IsParam(Param p, int * first_arg);
|
||||
void ClearParams();
|
||||
|
||||
private:
|
||||
typedef std::map<Param, std::vector<int> > ParamTable;
|
||||
ParamTable param_table;
|
||||
|
||||
};
|
||||
static ParamCode ParseParam(const char * param);
|
||||
|
||||
void ClearParams();
|
||||
|
||||
|
||||
bool IsPar(Mount::ParamCode code);
|
||||
|
||||
bool IsArg(Mount::ParamCode code, const char * arg);
|
||||
bool IsArg(Mount::ParamCode code, const std::string & arg);
|
||||
bool IsArg(Mount::ParamCode code, int arg);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user