Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cScriptExec Class Reference

#include <cScriptExec.h>

Inheritance diagram for GrayLib::cScriptExec:
GrayLib::cExpressionExec GrayLib::cExpressionBase

Public Member Functions

 cScriptExec (cScriptContext *pContext=nullptr)
 
virtual ~cScriptExec ()
 
virtual HRESULT ExecuteFunctionInt (const IniChar_t *&pszExp, OUT cVariant &vValRet, EXP_PARSE_MASK_t uParseFlags) override
 Execute a single function. More...
 
HRESULT ExecuteSection (const cIniSectionData *pSection, OUT ITERATE_t &iLine, OUT cVariant &vValRet)
 Execute script triggers from cScriptSection/cIniSectionData. More...
 
cScriptContextget_ContextCurrent () const
 
 UNITTEST2_PREDEF (cScriptExec)
 
- Public Member Functions inherited from GrayLib::cExpressionExec
 cExpressionExec (cExpressionContext *pContext)
 
virtual ~cExpressionExec ()
 
HRESULT ExecuteCommand (const ATOMCHAR_t *pszCommand, OUT cVariant &vValRet)
 Execute a single command line. as typed by some user. More...
 
HRESULT GetVarRef1 (const ATOMCHAR_t *&rpszExp, OUT cVariant &vValRet)
 
HRESULT DoMathOp1 (cVariant &vVal, const ATOMCHAR_t *&rpszExp)
 
virtual HRESULT GetVarRef2 (const ATOMCHAR_t *&rpszExp, OUT cVariant &vValRet, bool bInArray) override
 
cVariant GetVarComplexRef (const ATOMCHAR_t *&rpszExp)
 
cVariant GetVarComplex (const ATOMCHAR_t *pszExp)
 
bool GetComplexBool (const ATOMCHAR_t *pszExp)
 
int GetComplexInt (const ATOMCHAR_t *pszExp)
 
UINT32 GetComplexDWord (const ATOMCHAR_t *pszExp)
 
float GetComplexFloat (const ATOMCHAR_t *pszExp)
 
double GetComplexDouble (const ATOMCHAR_t *pszExp)
 
- Public Member Functions inherited from GrayLib::cExpressionBase
 IGNORE_WARN_ABSTRACT (cExpressionBase)
 
HRESULT GetArrayListRef (const ATOMCHAR_t *&rpszExp, OUT cVariant &vValRet, ITERATE_t nAppendStart=0)
 
HRESULT GetArrayRef (const ATOMCHAR_t *&rpszExp, OUT cVariant &vValRet, ITERATE_t nAppendStart=0)
 
HRESULT GetMapListRef (const ATOMCHAR_t *&rpszExp, OUT cVarMap &rMapRet)
 
HRESULT GetMapRef (const ATOMCHAR_t *&rpszExp, OUT cVarMap &rMapRet)
 
HRESULT GetMapListRef (const ATOMCHAR_t *&rpszExp, OUT cVariant &rMapRet)
 
HRESULT GetMapRef (const ATOMCHAR_t *&rpszExp, OUT cVariant &vValRet)
 
cVariant GetVarRef (const ATOMCHAR_t *&rpszExp)
 
HRESULT GetVar (const ATOMCHAR_t *pszExp, OUT cVariant &vValRet)
 
cVariant GetVar (const ATOMCHAR_t *pszExp)
 
 UNITTEST_FRIEND (cExpressionBase)
 

Protected Member Functions

StrLen_t ParseArgs_BlockReplacement (OUT IniChar_t *pszDest, StrLen_t nLenMax, const IniChar_t *pszSrc, bool bHTML=false)
 
IniChar_tParseArgs (OUT IniChar_t *pszDest, StrLen_t nLenMax, const IniChar_t *pszSrc, SCRIPTCMD_TYPE eCmd)
 
- Protected Member Functions inherited from GrayLib::cExpressionExec
HRESULT ParseArgV (const ATOMCHAR_t *&rpszExp, OUT cVariant &vArgsRet, EXP_PARSE_MASK_t uParseFlags)
 
cExpressionContextget_ContextCurrent () const
 

Static Protected Attributes

static const ATOMCHAR_t *const k_szScriptFuncs []
 command/function keywords SCRIPTCMD_QTY More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GrayLib::cExpressionExec
static HRESULT GRAYCALL DoMathOp2 (cVariant &vVal, const cVariant &vVal2, ATOMCHAR_t chOp)
 
static int GetXInt (const ATOMCHAR_t *pszExp)
 
static UINT32 GetXDWord (const ATOMCHAR_t *pszExp)
 
static float GetXFloat (const ATOMCHAR_t *pszExp)
 
- Static Public Member Functions inherited from GrayLib::cExpressionBase
static bool GRAYCALL IsParenNeeded (const ATOMCHAR_t *pszExp)
 
static HRESULT GRAYCALL GetStringRefQ (const ATOMCHAR_t *&rpszExp, OUT cStringA &rsRet)
 
static HRESULT GRAYCALL GetStringRefV (const ATOMCHAR_t *&rpszExp, OUT cVariant &rvValRet)
 
static HRESULT GRAYCALL GetMapElementName (const ATOMCHAR_t *&rpszExp, OUT cStringA &rsName)
 
static HRESULT GRAYCALL GetSimpleVarRef (const ATOMCHAR_t *&rpszExp, OUT cVariant &vValRet)
 
- Static Public Attributes inherited from GrayLib::cExpressionExec
static cExpressionExecsm_pExpExecBest
 allow cScriptExec (or other engine) to be used as default. More...
 
- Static Public Attributes inherited from GrayLib::cExpressionBase
static const ATOMCHAR_t k_ArrayOpen = '['
 
static const ATOMCHAR_t k_ArrayClose = ']'
 
static const ATOMCHAR_t k_MapOpen = '{'
 
static const ATOMCHAR_t k_MapClose = '}'
 
- Protected Attributes inherited from GrayLib::cExpressionExec
EXP_PARSE_MASK_t m_wParseFlags
 EXP_PARSE_IGNORE_EXTRA. More...
 

Detailed Description

GrayScript execution engine. Parse a string that may have methods,props or <?HTML embedded stuff?> Stack based instantiation used to set the current cScriptContext for this thread.

Constructor & Destructor Documentation

◆ cScriptExec()

GrayLib::cScriptExec::cScriptExec ( cScriptContext pContext = nullptr)

pContext = nullptr = use the current or root context.

◆ ~cScriptExec()

GrayLib::cScriptExec::~cScriptExec ( )
virtual

Member Function Documentation

◆ ExecuteFunctionInt()

HRESULT GrayLib::cScriptExec::ExecuteFunctionInt ( const IniChar_t *&  pszExp,
OUT cVariant vValRet,
EXP_PARSE_MASK_t  uParseFlags 
)
overridevirtual

Execute a single function.

Execute a single function/expression line. called via ExecuteCommand() Execute a script statement such as: name=value method(value) globalfunction(value) process . ref postfix.

  • rpszExp = the expression to be activated.

Reimplemented from GrayLib::cExpressionExec.

◆ ExecuteSection()

HRESULT GrayLib::cScriptExec::ExecuteSection ( const cIniSectionData pSection,
OUT ITERATE_t iLine,
OUT cVariant vValRet 
)

Execute script triggers from cScriptSection/cIniSectionData.

Exec the whole block of a script.

◆ get_ContextCurrent()

cScriptContext* GrayLib::cScriptExec::get_ContextCurrent ( ) const
inline

◆ ParseArgs()

IniChar_t * GrayLib::cScriptExec::ParseArgs ( OUT IniChar_t pszDest,
StrLen_t  nLenMax,
const IniChar_t pszSrc,
SCRIPTCMD_TYPE  eCmd 
)
protected

Parse/eval out any <?variables/methods?> in the argument skip = sign.

Returns
pointer to the args.

◆ ParseArgs_BlockReplacement()

StrLen_t GrayLib::cScriptExec::ParseArgs_BlockReplacement ( OUT IniChar_t pszDest,
StrLen_t  nLenMax,
const IniChar_t pszSrc,
bool  bHTML = false 
)
protected

Replace any "<?blocks?>" in text.

  • bHTML = use XML entity "&nbsp;" if empty block
    Returns
    length of result string.

◆ UNITTEST2_PREDEF()

GrayLib::cScriptExec::UNITTEST2_PREDEF ( cScriptExec  )

Member Data Documentation

◆ k_szScriptFuncs

const ATOMCHAR_t *const GrayLib::cScriptExec::k_szScriptFuncs
staticprotected
Initial value:
=
{
#define cScriptExecFunc(a,b)
nullptr,
}

command/function keywords SCRIPTCMD_QTY


The documentation for this class was generated from the following files: