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:
114
core/mounts.h
114
core/mounts.h
@@ -2,7 +2,7 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2009, Tomasz Sowa
|
||||
* Copyright (c) 2009-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -14,11 +14,13 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "mount.h"
|
||||
#include "error.h"
|
||||
#include "dirs.h"
|
||||
#include "db.h"
|
||||
#include "request.h"
|
||||
#include "mountparser.h"
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +28,60 @@ class Mounts
|
||||
{
|
||||
public:
|
||||
|
||||
/*
|
||||
mount point's types
|
||||
*/
|
||||
int AddMountType(const char * type);
|
||||
int AddMountType(const std::string & type);
|
||||
const std::string & GetMountType(int id);
|
||||
|
||||
// id of a specific mount type (the id is always valid)
|
||||
int MountTypeCms() { return mount_type_cms; }
|
||||
int MountTypeThread() { return mount_type_thread; }
|
||||
int MountTypeTicket() { return mount_type_ticket; }
|
||||
|
||||
|
||||
/*
|
||||
file systems
|
||||
*/
|
||||
int AddMountFs(const char * fs);
|
||||
int AddMountFs(const std::string & fs);
|
||||
const std::string & GetMountFs(int id);
|
||||
|
||||
// id of a specific file system (the id is always valid)
|
||||
int MountFsSimplefs() { return mount_fs_simplefs; }
|
||||
int MountFsHashfs() { return mount_fs_hashfs; }
|
||||
|
||||
|
||||
/*
|
||||
mount point's parameters
|
||||
*/
|
||||
int AddMountPar(const char * par);
|
||||
int AddMountPar(const std::string & par);
|
||||
const std::string & GetMountPar(int id);
|
||||
|
||||
int MountParPage() { return mount_par_page; }
|
||||
int MountParThread() { return mount_par_thread; }
|
||||
int MountParTicket() { return mount_par_ticket; }
|
||||
int MountParTicketType() { return mount_par_ticket_type; }
|
||||
int MountParTicketTypeDefault() { return mount_par_ticket_type_default; }
|
||||
int MountParTicketStatus() { return mount_par_ticket_status; }
|
||||
int MountParTicketStatusDefault() { return mount_par_ticket_status_default; }
|
||||
int MountParTicketPriority() { return mount_par_ticket_priority; }
|
||||
int MountParTicketPriorityDefault() { return mount_par_ticket_priority_default; }
|
||||
int MountParTicketCategory() { return mount_par_ticket_category; }
|
||||
int MountParTicketCategoryDefault() { return mount_par_ticket_category_default; }
|
||||
int MountParTicketExpected() { return mount_par_ticket_expected; }
|
||||
int MountParTicketExpectedDefault() { return mount_par_ticket_expected_default; }
|
||||
int MountParCreatethreadOn() { return mount_par_createthread_on; }
|
||||
int MountParCreateticketOn() { return mount_par_createticket_on; }
|
||||
int MountParOnlyRootRemove() { return mount_par_only_root_remove; }
|
||||
int MountParEmacsOn() { return mount_par_emacs_on; }
|
||||
int MountParMkdirOn() { return mount_par_mkdir_on; }
|
||||
int MountParApp() { return mount_par_app; }
|
||||
int MountParHtmlTemplate() { return mount_par_html_template; }
|
||||
|
||||
|
||||
void SetDirs(Dirs * pdirs);
|
||||
void SetDb(Db * pdb);
|
||||
void SetRequest(Request * prequest);
|
||||
@@ -34,6 +90,8 @@ public:
|
||||
typedef std::map<long, Mount> MountTab;
|
||||
|
||||
Mounts();
|
||||
void CreateMounts();
|
||||
|
||||
Error ReadMounts(const std::string & mounts);
|
||||
Error ReadMounts();
|
||||
|
||||
@@ -53,8 +111,62 @@ private:
|
||||
Db * db;
|
||||
Request * request;
|
||||
|
||||
const std::string empty_str;
|
||||
|
||||
MountParser mount_parser;
|
||||
|
||||
// cms
|
||||
// thread
|
||||
// ticket
|
||||
std::vector<std::string> mount_type_tab;
|
||||
|
||||
int mount_type_cms;
|
||||
int mount_type_thread;
|
||||
int mount_type_ticket;
|
||||
|
||||
// simplefs
|
||||
// hashfs
|
||||
std::vector<std::string> mount_fs_tab;
|
||||
|
||||
int mount_fs_simplefs;
|
||||
int mount_fs_hashfs;
|
||||
|
||||
// page
|
||||
// thread
|
||||
// ticket
|
||||
// ticket_type
|
||||
// ticket_type_default
|
||||
// ...
|
||||
std::vector<std::string> mount_par_tab;
|
||||
|
||||
int mount_par_page;
|
||||
int mount_par_thread;
|
||||
int mount_par_ticket;
|
||||
int mount_par_ticket_type;
|
||||
int mount_par_ticket_type_default;
|
||||
int mount_par_ticket_status;
|
||||
int mount_par_ticket_status_default;
|
||||
int mount_par_ticket_priority;
|
||||
int mount_par_ticket_priority_default;
|
||||
int mount_par_ticket_category;
|
||||
int mount_par_ticket_category_default;
|
||||
int mount_par_ticket_expected;
|
||||
int mount_par_ticket_expected_default;
|
||||
int mount_par_createthread_on;
|
||||
int mount_par_createticket_on;
|
||||
int mount_par_only_root_remove;
|
||||
int mount_par_emacs_on;
|
||||
int mount_par_mkdir_on;
|
||||
int mount_par_app;
|
||||
int mount_par_html_template;
|
||||
|
||||
|
||||
MountTab mount_tab;
|
||||
|
||||
void CreateMountType();
|
||||
void CreateMountFs();
|
||||
void CreateMountPar();
|
||||
|
||||
void MountCmsForRoot();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user