Files
Include/EGnScan.h
T
Dario Sassi 3865a6f53d Include :
- aggiornamento interfacce
- aggiunta interfaccia per import DXF.
2014-04-21 21:59:15 +00:00

55 lines
1.9 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2014
//----------------------------------------------------------------------------
// File : EgnScan.h Data : 06.03.14 Versione : 1.5c1
// Contenuto : Dichiarazione della classe CScan.
//
//
//
// Modifiche : 20.11.13 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include <string>
#include <fstream>
//----------------------- 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 Scanner
{
public :
EGN_EXPORT Scanner( void)
: m_bSkipEmptyLine( true), m_nLineNbr( 0), m_bUnget( false), m_nDeltaLineUnget(0) {}
EGN_EXPORT ~Scanner( void)
{ Terminate() ; }
EGN_EXPORT bool Init( const std::string& sCmdFile,
const char* szRemInit = nullptr, bool bSkipEmptyLine = true) ;
EGN_EXPORT bool Terminate( void) ;
EGN_EXPORT bool GetLine( std::string& sLine) ;
EGN_EXPORT bool UngetLine( std::string& sLine) ;
EGN_EXPORT int GetCurrLineNbr( void)
{ return m_nLineNbr ; }
EGN_EXPORT const std::string& GetFilePath( void)
{ return m_sFName ; }
private :
std::ifstream m_InFile ;
std::string m_sFName ;
std::string m_sRemInit ;
bool m_bSkipEmptyLine ;
int m_nLineNbr ;
bool m_bUnget ;
std::string m_sUnget ;
int m_nDeltaLineUnget ;
} ;