Files
Include/EgnCmdParser.h
T
Dario Sassi fa560b540a Include :
- modifica interfaccia di CmdParser.
2014-04-10 17:37:45 +00:00

52 lines
2.0 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.
//
//----------------------------------------------------------------------------
#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 int GetIdParam( const std::string& sParam, bool bNewAllowed = false) = 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 ;