2008-12-30 02:05:03 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2008-12-30 02:05:03 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2011-07-29 00:18:10 +02:00
|
|
|
* Copyright (c) 2008-2011, Tomasz Sowa
|
2008-12-30 02:05:03 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-23 15:15:30 +01:00
|
|
|
#ifndef headerfile_winix_functions_functionparser
|
|
|
|
#define headerfile_winix_functions_functionparser
|
2009-04-21 22:50:55 +02:00
|
|
|
|
2011-07-29 00:18:10 +02:00
|
|
|
#include <string>
|
2010-09-18 02:51:12 +02:00
|
|
|
#include "db/db.h"
|
2011-01-23 15:15:30 +01:00
|
|
|
#include "core/cur.h"
|
2010-08-10 18:12:50 +02:00
|
|
|
#include "core/system.h"
|
|
|
|
|
|
|
|
|
|
|
|
class Functions;
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
|
|
|
|
class FunctionParser
|
|
|
|
{
|
2011-07-29 00:18:10 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
FunctionParser();
|
|
|
|
bool Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem);
|
|
|
|
void UTF8(bool use_utf8);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
Db * db;
|
2011-01-23 15:15:30 +01:00
|
|
|
Cur * cur;
|
2010-08-10 18:12:50 +02:00
|
|
|
System * system;
|
2011-01-23 15:15:30 +01:00
|
|
|
Functions * functions;
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2011-07-29 00:18:10 +02:00
|
|
|
const char * path;
|
|
|
|
std::string name_ascii, value_ascii;
|
|
|
|
std::wstring name, value;
|
|
|
|
Item * last_dir;
|
|
|
|
Param param;
|
|
|
|
bool utf8;
|
|
|
|
|
|
|
|
void SkipSlashes();
|
|
|
|
|
|
|
|
void ParseDirsItemFunction();
|
2008-12-30 02:05:03 +01:00
|
|
|
void ParseParams();
|
2011-07-29 00:18:10 +02:00
|
|
|
void ParseAnchor();
|
2008-12-30 02:05:03 +01:00
|
|
|
|
2011-07-29 00:18:10 +02:00
|
|
|
bool IsDir();
|
|
|
|
bool CheckAddItem();
|
|
|
|
bool CheckAddFunction();
|
|
|
|
bool AddRootDir();
|
|
|
|
void AddDir();
|
|
|
|
void AddParam();
|
|
|
|
void ParseOrdinaryParams();
|
|
|
|
void ParseWinixParams();
|
|
|
|
|
|
|
|
void ToWide(const std::string & src, std::wstring & dst);
|
|
|
|
|
|
|
|
int FromHex(int c);
|
|
|
|
int GetChar();
|
|
|
|
void ReadName();
|
|
|
|
void ReadOrdinaryParName();
|
|
|
|
void ReadOrdinaryParValue();
|
|
|
|
void ReadWinixParName();
|
|
|
|
void ReadWinixParValue();
|
2008-12-30 02:05:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-07-29 00:18:10 +02:00
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
#endif
|
2011-07-29 00:18:10 +02:00
|
|
|
|