2009-04-20 00:13:21 +02:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2009-04-20 00:13:21 +02:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009, Tomasz Sowa
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#ifndef headerfilecmslucoremount
|
|
|
|
#define headerfilecmslucoremount
|
2009-04-20 00:13:21 +02:00
|
|
|
|
2009-06-05 22:29:06 +02:00
|
|
|
#include <map>
|
2009-04-21 01:49:28 +02:00
|
|
|
#include <string>
|
2009-06-05 22:29:06 +02:00
|
|
|
#include <vector>
|
2009-04-20 00:13:21 +02:00
|
|
|
|
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
|
|
|
|
|
2009-04-20 00:13:21 +02:00
|
|
|
class Mount
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
enum Type
|
|
|
|
{
|
|
|
|
cms = 0,
|
2010-01-25 05:52:17 +01:00
|
|
|
thread,
|
|
|
|
ticket
|
|
|
|
};
|
|
|
|
|
2010-02-19 00:30:22 +01:00
|
|
|
enum Fs
|
|
|
|
{
|
|
|
|
simplefs = 0,
|
|
|
|
hashfs
|
|
|
|
};
|
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
|
|
|
|
// 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,
|
2010-02-19 00:30:22 +01:00
|
|
|
par_app,
|
2010-06-22 01:53:19 +02:00
|
|
|
par_html_template,
|
2010-01-25 05:52:17 +01:00
|
|
|
|
|
|
|
par_none
|
2009-04-20 00:13:21 +02:00
|
|
|
};
|
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
typedef std::vector<std::string> ParamArg;
|
2009-04-20 00:13:21 +02:00
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
|
|
|
|
struct ParamRow
|
2009-04-21 01:49:28 +02:00
|
|
|
{
|
2010-01-25 05:52:17 +01:00
|
|
|
bool defined;
|
|
|
|
ParamArg arg;
|
|
|
|
|
|
|
|
ParamRow() { defined = false; }
|
|
|
|
void Clear() { defined = false; arg.clear(); }
|
2009-04-21 01:49:28 +02:00
|
|
|
};
|
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
typedef std::vector<ParamRow> Param;
|
|
|
|
Param param;
|
2009-04-21 01:49:28 +02:00
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
long dir_id;
|
2009-04-20 00:13:21 +02:00
|
|
|
Type type;
|
2010-02-19 00:30:22 +01:00
|
|
|
Fs fs;
|
2010-01-25 05:52:17 +01:00
|
|
|
|
|
|
|
|
2009-04-21 01:49:28 +02:00
|
|
|
Mount();
|
|
|
|
const char * TypeToStr();
|
2010-02-19 00:30:22 +01:00
|
|
|
const char * FsToStr();
|
2010-01-25 05:52:17 +01:00
|
|
|
static ParamCode ParseParam(const char * param);
|
|
|
|
|
2010-02-19 00:30:22 +01:00
|
|
|
|
2009-06-05 22:29:06 +02:00
|
|
|
void ClearParams();
|
2009-04-20 00:13:21 +02:00
|
|
|
|
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
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);
|
|
|
|
|
2010-06-22 01:53:19 +02:00
|
|
|
// returning a name to html template (can be null if not defined)
|
|
|
|
const std::string * HtmlTemplate() const;
|
|
|
|
|
2010-01-25 05:52:17 +01:00
|
|
|
};
|
|
|
|
|
2009-04-20 00:13:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|