added ticket parser: plugins/ticket/ticketparser.h plugins/ticket/ticketparser.cpp
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@663 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include "ticket.h"
|
||||
#include "ticketparser.h"
|
||||
#include "core/item.h"
|
||||
#include "core/system.h"
|
||||
#include "db/db.h"
|
||||
@@ -24,6 +25,19 @@ namespace Ticket
|
||||
{
|
||||
|
||||
|
||||
struct TicketConfWrap
|
||||
{
|
||||
bool to_delete;
|
||||
std::string file_name;
|
||||
TicketConf conf;
|
||||
|
||||
TicketConfWrap()
|
||||
{
|
||||
to_delete = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class TicketInfo
|
||||
{
|
||||
public:
|
||||
@@ -42,10 +56,18 @@ public:
|
||||
bool is_ticket;
|
||||
Ticket ticket;
|
||||
std::vector<Ticket> ticket_tab;
|
||||
|
||||
// <dir_id, TicketConfWrap>
|
||||
typedef std::map<long, TicketConfWrap> ConfTab;
|
||||
ConfTab conf_tab;
|
||||
|
||||
|
||||
|
||||
int mount_type_ticket;
|
||||
|
||||
int mount_par_ticket;
|
||||
int mount_par_ticket_conf;
|
||||
|
||||
int mount_par_ticket_type;
|
||||
int mount_par_ticket_type_default;
|
||||
int mount_par_ticket_status;
|
||||
@@ -59,15 +81,25 @@ public:
|
||||
|
||||
int mount_par_createticket_on;
|
||||
|
||||
|
||||
void ReadTicketConf(bool skip_existing_configs = false);
|
||||
|
||||
|
||||
private:
|
||||
TDb * tdb;
|
||||
Db * db;
|
||||
System * system;
|
||||
TicketParser ticket_parser;
|
||||
Item item_conf;
|
||||
std::string path_dir;
|
||||
std::string path_file;
|
||||
|
||||
static bool SortTicketsFun(const Ticket & t1, const Ticket & t2);
|
||||
bool GetConfContent(const std::string & path);
|
||||
bool ParseTicketConf(long mount_dir_id, const std::string & path);
|
||||
void ReadTicketConf(Mounts & mounts, bool skip_existing_configs);
|
||||
void MarkAllConfToDelete();
|
||||
void DeleteAllMarkedConf();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user