76 lines
1.2 KiB
C++
Executable File
76 lines
1.2 KiB
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2008-2011, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef headerfile_winix_functions_functionparser
|
|
#define headerfile_winix_functions_functionparser
|
|
|
|
#include <string>
|
|
#include "db/db.h"
|
|
#include "core/cur.h"
|
|
#include "core/system.h"
|
|
|
|
|
|
class Functions;
|
|
|
|
|
|
class FunctionParser
|
|
{
|
|
public:
|
|
|
|
FunctionParser();
|
|
bool Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem);
|
|
void UTF8(bool use_utf8);
|
|
|
|
private:
|
|
|
|
Db * db;
|
|
Cur * cur;
|
|
System * system;
|
|
Functions * functions;
|
|
|
|
const char * path;
|
|
std::string name_ascii, value_ascii;
|
|
std::wstring name, value;
|
|
Item * last_dir;
|
|
Param param;
|
|
bool utf8;
|
|
|
|
void SkipSlashes();
|
|
|
|
void ParseDirsItemFunction();
|
|
void ParseParams();
|
|
void ParseAnchor();
|
|
|
|
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();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|