#pragma once #include #include void SetError(int ErrorNum,const std::string &keyWord,int pos); void SetError(int num,const char *KeyWord,int pos); void SetError(); class SmoothieException { int errorCode; std::string keyword; int nowLine; static void Throwing() { //ここでブレークポイント int dummy=0; } public: static void Throw( int errorCode, const std::string &keyword, int nowLine ) { Throwing(); SetError( errorCode, keyword, nowLine ); } static void Throw( int errorCode, const std::string &keyword ) { Throwing(); SetError( errorCode, keyword,-1 ); } static void Throw( int errorCode ) { Throwing(); SetError( errorCode,"",-1 ); } static void Throw() { Throwing(); SetError(); } SmoothieException( int errorCode, const std::string &keyword, int nowLine ) : errorCode( errorCode ) , keyword( keyword ) , nowLine( nowLine ) { } SmoothieException( int errorCode, const std::string &keyword ) : errorCode( errorCode ) , keyword( keyword ) , nowLine( -1 ) { } SmoothieException( int errorCode ) : errorCode( errorCode ) , keyword( "" ) , nowLine( -1 ) { } SmoothieException() : errorCode( 300 ) , keyword( "" ) , nowLine( -1 ) { } int GetErrorCode() const { return errorCode; } const std::string &GetKeyword() const { return keyword; } int GetNowLine() const { return nowLine; } };