changed: mount points

mount type and mount fs are of type 'int' now
they can be added by plugins


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@652 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-09-12 23:33:27 +00:00
parent f48f08a98b
commit 23aedd68b0
36 changed files with 979 additions and 730 deletions

View File

@@ -17,59 +17,14 @@
class Mount
{
public:
enum Type
{
cms = 0,
thread,
ticket
};
enum Fs
{
simplefs = 0,
hashfs
};
// the first should be with 0 index
// the last should be 'none'
enum ParamCode
{
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_app,
par_html_template,
par_none
};
typedef std::vector<std::string> ParamArg;
struct ParamRow
{
typedef std::vector<std::string> ParamArg;
bool defined;
ParamArg arg;
@@ -78,31 +33,36 @@ public:
};
typedef std::vector<ParamRow> Param;
long dir_id;
int type;
int fs;
Param param;
long dir_id;
Type type;
Fs fs;
Mount();
const char * TypeToStr();
const char * FsToStr();
static ParamCode ParseParam(const char * param);
void ClearParams();
bool IsPar(int code);
bool IsPar(Mount::ParamCode code);
bool IsArg(int code, const char * arg);
bool IsArg(int code, const std::string & arg);
bool IsArg(int code, int arg);
bool IsArg(Mount::ParamCode code, const char * arg);
bool IsArg(Mount::ParamCode code, const std::string & arg);
bool IsArg(Mount::ParamCode code, int arg);
// returning the arg argument if defined (or an empty string)
const std::string & Arg(int code, int arg) const;
// returning a name to html template (can be null if not defined)
const std::string * FirstHtmlTemplate() const;
// returning the first argument (arg=0) if defined (or an empty string)
const std::string & FirstArg(int code) const;
private:
// for Arg() methods when the argument is not defined
const std::string empty_str;
};