Files
winix/plugins/ticket/ticketparser.h
Tomasz Sowa 8154c403d8 we can create links (hard links, symbolic links) now
added winix functions: ln

winix function 'default' can be used without redirecting now

added new tickets types: TypeProgress, TypeString, TypeMultistring, TypeImages, TypeFiles
now tickets are combined with files
added winix functions: showtickets

fixed mountpoints:
when the default root mount was created its parameter table was empty
and it caused accessing to a non-existing objects

fixed logger:
modifiers (log1, log2, log3) were incorrectly treated
added modifier: log4 (debug info)

now we are moving threads to a new plugin 'thread'
created directory: plugins/thread
(not finished yet)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@704 e52654a7-88a9-db11-a3e9-0013d4bc506e
2011-01-05 21:24:11 +00:00

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