65 lines
1.6 KiB
C++
Executable File
65 lines
1.6 KiB
C++
Executable File
#ifndef headerfile_winix_plugins_ticket_ticketparser
|
|
#define headerfile_winix_plugins_ticket_ticketparser
|
|
|
|
|
|
#include "ticketconf.h"
|
|
|
|
#define WINIX_TICKET_ERR_OK 0
|
|
#define WINIX_TICKET_ERR_UKNOWN_TYPE 1
|
|
#define WINIX_TICKET_ERR_NO_ITEM_NAME 2
|
|
#define WINIX_TICKET_ERR_SYNTAX_ERROR 3
|
|
#define WINIX_TICKET_ERR_NO_UPLOAD_DIR 4
|
|
|
|
|
|
|
|
class TicketParser
|
|
{
|
|
public:
|
|
|
|
int Parse(const wchar_t * str, TicketConf & conf);
|
|
int Parse(const std::wstring & str, TicketConf & conf);
|
|
|
|
private:
|
|
|
|
TicketConf * pconf;
|
|
const wchar_t * pchar;
|
|
int error; // last error code
|
|
TicketConf::TicketItem item;
|
|
std::wstring type;
|
|
std::wstring id_str;
|
|
std::wstring int_min, int_max;
|
|
TicketConf::TicketItem::Select select;
|
|
|
|
bool IsWhite(int c);
|
|
void SkipWhite();
|
|
void SkipWhiteLines();
|
|
void SkipLine();
|
|
void ReadTextQuoted(std::wstring & text);
|
|
void ReadTextSimple(std::wstring & text, bool comma_separator);
|
|
void ReadText(std::wstring & text, bool comma_separator = false);
|
|
|
|
void CheckId(int & id, bool & def);
|
|
void SetItemId();
|
|
bool CheckEndLine();
|
|
|
|
bool ReadItemType();
|
|
bool ReadItemName();
|
|
void ReadItemInteger();
|
|
void ReadItemSelect();
|
|
void ReadItemString();
|
|
bool ReadItemFiles();
|
|
bool ReadItem();
|
|
|
|
void LogItemInteger(TicketConf::TicketItem & item);
|
|
void LogItemProgress(TicketConf::TicketItem & item);
|
|
void LogItemSelect(TicketConf::TicketItem & item);
|
|
void LogItemString(TicketConf::TicketItem & item);
|
|
void LogItemMultistring(TicketConf::TicketItem & item);
|
|
void LogItemImages(TicketConf::TicketItem & item);
|
|
void LogItemFiles(TicketConf::TicketItem & item);
|
|
void LogItem(TicketConf::TicketItem & item);
|
|
};
|
|
|
|
|
|
#endif
|