From 809fbda03c5014ba9cd361f5113d1d717cd41ea6 Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 26 Jan 2016 18:32:38 +0100 Subject: Version 0.8.0 beta --- libtemplate/parameter.h | 147 ------------------------------------------------ 1 file changed, 147 deletions(-) delete mode 100644 libtemplate/parameter.h (limited to 'libtemplate/parameter.h') diff --git a/libtemplate/parameter.h b/libtemplate/parameter.h deleted file mode 100644 index 0a4ca23..0000000 --- a/libtemplate/parameter.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef __TEMPLATEPARAMETER_H -#define __TEMPLATEPARAMETER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "globals.h" - -using namespace std; - -enum eAlign { - alLeft, - alCenter, - alRight, - alTop, - alBottom -}; - -enum eScrollMode { - smNone, - smCarriageReturn, - smForthAndBack -}; - -enum eScrollSpeed { - ssNone, - ssSlow, - ssMedium, - ssFast -}; - -enum eOrientation { - orNone, - orHorizontal, - orVertical, - orAbsolute -}; - -// --- cNumericParameter ------------------------------------------------------------- - -class cNumericParameter { -private: - cGlobals *globals; - string value; - bool isValid; - int width; - int height; - int columnWidth; - int rowHeight; - bool hor; - int defaultValue; - bool IsNumber(const string& s); - bool CheckPercentValue(int &val); - bool CheckExpression(int &val, string &parsedVal); - bool ValidNumericExpression(string &parsedValue); - int EvaluateTheExpression(char* expr); - double ParseAtom(char*& expr); - double ParseFactors(char*& expr); - double ParseSummands(char*& expr); -public: - cNumericParameter(string value); - virtual ~cNumericParameter(void); - void SetGlobals(cGlobals *globals) { this->globals = globals; }; - void SetAreaSize(int w, int h); - void SetLoopContainer(int columnWidth, int rowHeight) { this->columnWidth = columnWidth; this->rowHeight = rowHeight; }; - void SetDefault(int def) { defaultValue = def; }; - void SetHorizontal(void) { hor = true; }; - void SetVertical(void) { hor = false; }; - int Parse(string &parsedValue); - bool Valid(void) { return isValid; }; -}; - -// --- cTextToken ------------------------------------------------------------- - -enum eTextTokenType { - ttConstString, - ttToken, - ttConditionalToken, - ttPrintfToken -}; - -class cTextToken { -public: - eTextTokenType type; - string value; - vector parameters; - vector subTokens; -}; - -// --- cConditionalParameter ------------------------------------------------------------- - -enum eCondParameterType { - cpAnd, - cpOr, - cpNone -}; - -enum eCondType { - ctLower, - ctGreater, - ctEquals, - ctBool, - ctStringSet, - ctStringEmpty, - ctStringEquals, - ctStringNotEquals, - ctStringContains, - ctStringNotContains, - ctNone -}; - -struct sCondition { - string tokenName; - bool isNegated; - eCondType type; - int compareValue; - string strCompareValue; -}; - -class cConditionalParameter { -private: - cGlobals *globals; - bool isTrue; - string value; - eCondParameterType type; - vector conditions; - void TokenizeValue(string sep); - void InsertCondition(string cond); - string StripWhitespaces(string value); - int EvaluateParameter(string token, map < string, int > *intTokens, map < string, string > *stringTokens); -public: - cConditionalParameter(cGlobals *globals, string value); - virtual ~cConditionalParameter(void); - void Tokenize(void); - void Evaluate(map < string, int > *intTokens, map < string, string > *stringTokens); - bool IsTrue(void) { return isTrue; }; - void Debug(void); -}; -#endif //__TEMPLATEPARAMETER_H \ No newline at end of file -- cgit v1.2.3