2008-12-30 02:05:03 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2014-10-04 20:04:03 +02:00
|
|
|
* and is distributed under the 2-Clause BSD licence.
|
|
|
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2021-06-16 18:07:44 +02:00
|
|
|
* Copyright (c) 2008-2021, Tomasz Sowa
|
2008-12-30 02:05:03 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2014-10-04 20:04:03 +02:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
2008-12-30 02:05:03 +01:00
|
|
|
*/
|
|
|
|
|
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>
|
2021-06-16 18:07:44 +02:00
|
|
|
|
|
|
|
#include "core/winixmodeldeprecated.h"
|
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"
|
2018-11-21 12:03:53 +01:00
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
2014-02-12 17:30:49 +01:00
|
|
|
namespace Winix
|
|
|
|
{
|
|
|
|
|
2010-08-10 18:12:50 +02:00
|
|
|
|
|
|
|
class Functions;
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
|
2021-06-16 18:07:44 +02:00
|
|
|
class FunctionParser : public WinixModelDeprecated
|
2008-12-30 02:05:03 +01:00
|
|
|
{
|
2011-07-29 00:18:10 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
FunctionParser();
|
|
|
|
bool Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem);
|
|
|
|
|
|
|
|
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
|
|
|
|
2014-10-09 22:44:56 +02:00
|
|
|
const wchar_t * path;
|
2011-07-29 00:18:10 +02:00
|
|
|
std::wstring name, value;
|
2014-10-09 22:44:56 +02:00
|
|
|
std::string name_ascii, value_ascii;
|
2011-07-29 00:18:10 +02:00
|
|
|
Item * last_dir;
|
|
|
|
Param param;
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
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
|
|
|
|
2014-02-12 17:30:49 +01:00
|
|
|
} // namespace Winix
|
|
|
|
|
2008-12-30 02:05:03 +01:00
|
|
|
#endif
|
2011-07-29 00:18:10 +02:00
|
|
|
|