Files
Include/EGnCmdParser.h
T
DarioS ab8ec30e29 Include :
- sistemato minuscole/maiuscole.
2022-02-26 17:46:21 +01:00

58 lines
2.4 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2014
//----------------------------------------------------------------------------
// File : EGnCmdParser.h Data : 15.03.14 Versione : 1.5c
// Contenuto : Dichiarazione della interfaccia ICmdParser.
//
//
//
// Modifiche : 25.11.13 DS Creazione modulo.
// 15.03.14 DS Agg. ExecuteLine.
// 10.04.14 DS Agg. GetIdParam.
// 09.05.14 DS Agg. funz. per DirReplace.
//
//----------------------------------------------------------------------------
#pragma once
#include <string>
class ICmdExecutor ;
class ILogger ;
//----------------------- Macro per import/export -----------------------------
#undef EGN_EXPORT
#if defined( I_AM_EGN) // da definirsi solo nella DLL
#define EGN_EXPORT __declspec( dllexport)
#else
#define EGN_EXPORT __declspec( dllimport)
#endif
//----------------------------------------------------------------------------
class __declspec( novtable) ICmdParser
{
public :
virtual ~ICmdParser( void) {}
virtual bool Init( void) = 0 ;
virtual bool SetExecutor( ICmdExecutor* pCmdExec) = 0 ;
virtual bool AddExecutor( ICmdExecutor* pCmdExec) = 0 ;
virtual bool AddVariable( const std::string& sName, int nVal) = 0 ;
virtual bool SetVariable( const std::string& sName, int nVal) = 0 ;
virtual bool GetVariable( const std::string& sName, int& nVal) = 0 ;
virtual bool RemoveVariable( const std::string& sName) = 0 ;
virtual void ResetDirReplace( void) = 0 ;
virtual bool SetDirReplace( const std::string& sToken, const std::string& sReplace) = 0 ;
virtual int DirReplace( std::string& sPath) = 0 ;
virtual int DirInvReplace( std::string& sPath) = 0 ;
virtual int GetIdParam( const std::string& sParam, bool bNewAllowed = false) = 0 ;
virtual bool GetStringParam( const std::string& sParam, std::string& sString) = 0 ;
virtual bool Run( const std::string& sCmdFile, bool bIsolated = true) = 0 ;
virtual bool ExecLine( const std::string& sCmdLine, bool bIsolated = false) = 0 ;
} ;
//-----------------------------------------------------------------------------
EGN_EXPORT ICmdParser* CreateCmdParser( void) ;
//-----------------------------------------------------------------------------
const int CMD_ID_NULL = - 1 ;
const int CMD_ID_ERROR = - 99 ;