Commit 067bf851 authored by Dick Hollenbeck's avatar Dick Hollenbeck

change IOError class name spelling to IO_ERROR to conform to coding standards

parent 7a92a96a
...@@ -224,18 +224,18 @@ bool DSNLEXER::IsSymbol( int aTok ) ...@@ -224,18 +224,18 @@ bool DSNLEXER::IsSymbol( int aTok )
} }
void DSNLEXER::ThrowIOError( wxString aText, int charOffset ) throw (IOError) void DSNLEXER::ThrowIOError( wxString aText, int charOffset ) throw( IO_ERROR )
{ {
// append to aText, do not overwrite // append to aText, do not overwrite
aText << wxT(" ") << _("in") << wxT(" \"") << CurSource() aText << wxT(" ") << _("in") << wxT(" \"") << CurSource()
<< wxT("\" ") << _("on line") << wxT(" ") << reader->LineNumber() << wxT("\" ") << _("on line") << wxT(" ") << reader->LineNumber()
<< wxT(" ") << _("at offset") << wxT(" ") << charOffset; << wxT(" ") << _("at offset") << wxT(" ") << charOffset;
throw IOError( aText ); throw IO_ERROR( aText );
} }
void DSNLEXER::Expecting( int aTok ) throw( IOError ) void DSNLEXER::Expecting( int aTok ) throw( IO_ERROR )
{ {
wxString errText( _("Expecting") ); wxString errText( _("Expecting") );
errText << wxT(" ") << GetTokenString( aTok ); errText << wxT(" ") << GetTokenString( aTok );
...@@ -243,7 +243,7 @@ void DSNLEXER::Expecting( int aTok ) throw( IOError ) ...@@ -243,7 +243,7 @@ void DSNLEXER::Expecting( int aTok ) throw( IOError )
} }
void DSNLEXER::Expecting( const wxString& text ) throw( IOError ) void DSNLEXER::Expecting( const wxString& text ) throw( IO_ERROR )
{ {
wxString errText( _("Expecting") ); wxString errText( _("Expecting") );
errText << wxT(" '") << text << wxT("'"); errText << wxT(" '") << text << wxT("'");
...@@ -251,7 +251,7 @@ void DSNLEXER::Expecting( const wxString& text ) throw( IOError ) ...@@ -251,7 +251,7 @@ void DSNLEXER::Expecting( const wxString& text ) throw( IOError )
} }
void DSNLEXER::Unexpected( int aTok ) throw( IOError ) void DSNLEXER::Unexpected( int aTok ) throw( IO_ERROR )
{ {
wxString errText( _("Unexpected") ); wxString errText( _("Unexpected") );
errText << wxT(" ") << GetTokenString( aTok ); errText << wxT(" ") << GetTokenString( aTok );
...@@ -259,7 +259,7 @@ void DSNLEXER::Unexpected( int aTok ) throw( IOError ) ...@@ -259,7 +259,7 @@ void DSNLEXER::Unexpected( int aTok ) throw( IOError )
} }
void DSNLEXER::Unexpected( const wxString& text ) throw( IOError ) void DSNLEXER::Unexpected( const wxString& text ) throw( IO_ERROR )
{ {
wxString errText( _("Unexpected") ); wxString errText( _("Unexpected") );
errText << wxT(" '") << text << wxT("'"); errText << wxT(" '") << text << wxT("'");
...@@ -267,7 +267,7 @@ void DSNLEXER::Unexpected( const wxString& text ) throw( IOError ) ...@@ -267,7 +267,7 @@ void DSNLEXER::Unexpected( const wxString& text ) throw( IOError )
} }
void DSNLEXER::NeedLEFT() throw( IOError ) void DSNLEXER::NeedLEFT() throw( IO_ERROR )
{ {
int tok = NextTok(); int tok = NextTok();
if( tok != DSN_LEFT ) if( tok != DSN_LEFT )
...@@ -275,7 +275,7 @@ void DSNLEXER::NeedLEFT() throw( IOError ) ...@@ -275,7 +275,7 @@ void DSNLEXER::NeedLEFT() throw( IOError )
} }
void DSNLEXER::NeedRIGHT() throw( IOError ) void DSNLEXER::NeedRIGHT() throw( IO_ERROR )
{ {
int tok = NextTok(); int tok = NextTok();
if( tok != DSN_RIGHT ) if( tok != DSN_RIGHT )
...@@ -283,7 +283,7 @@ void DSNLEXER::NeedRIGHT() throw( IOError ) ...@@ -283,7 +283,7 @@ void DSNLEXER::NeedRIGHT() throw( IOError )
} }
int DSNLEXER::NeedSYMBOL() throw( IOError ) int DSNLEXER::NeedSYMBOL() throw( IO_ERROR )
{ {
int tok = NextTok(); int tok = NextTok();
if( !IsSymbol( tok ) ) if( !IsSymbol( tok ) )
...@@ -292,7 +292,7 @@ int DSNLEXER::NeedSYMBOL() throw( IOError ) ...@@ -292,7 +292,7 @@ int DSNLEXER::NeedSYMBOL() throw( IOError )
} }
int DSNLEXER::NeedSYMBOLorNUMBER() throw( IOError ) int DSNLEXER::NeedSYMBOLorNUMBER() throw( IO_ERROR )
{ {
int tok = NextTok(); int tok = NextTok();
if( !IsSymbol( tok ) && tok!=DSN_NUMBER ) if( !IsSymbol( tok ) && tok!=DSN_NUMBER )
...@@ -312,7 +312,7 @@ static inline bool isSpace( int cc ) ...@@ -312,7 +312,7 @@ static inline bool isSpace( int cc )
} }
int DSNLEXER::NextTok() throw (IOError) int DSNLEXER::NextTok() throw( IO_ERROR )
{ {
char* cur = next; char* cur = next;
char* head = cur; char* head = cur;
...@@ -1380,7 +1380,7 @@ class DSNTEST : public wxApp ...@@ -1380,7 +1380,7 @@ class DSNTEST : public wxApp
DSNLEXER* lexer; DSNLEXER* lexer;
int nestLevel; int nestLevel;
void recursion() throw( IOError ); void recursion() throw( IO_ERROR );
void indent() void indent()
{ {
...@@ -1485,7 +1485,7 @@ bool DSNTEST::OnInit() ...@@ -1485,7 +1485,7 @@ bool DSNTEST::OnInit()
} }
printf("\n"); printf("\n");
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
fprintf( stderr, "%s\n", CONV_TO_UTF8( ioe.errorText ) ); fprintf( stderr, "%s\n", CONV_TO_UTF8( ioe.errorText ) );
} }
...@@ -1494,7 +1494,7 @@ bool DSNTEST::OnInit() ...@@ -1494,7 +1494,7 @@ bool DSNTEST::OnInit()
} }
void DSNTEST::recursion() throw(IOError) void DSNTEST::recursion() throw( IO_ERROR )
{ {
int tok; int tok;
const char* space = ""; const char* space = "";
......
...@@ -90,7 +90,7 @@ FILE_LINE_READER::FILE_LINE_READER( FILE* aFile, const wxString& aFileName, unsi ...@@ -90,7 +90,7 @@ FILE_LINE_READER::FILE_LINE_READER( FILE* aFile, const wxString& aFileName, unsi
} }
unsigned FILE_LINE_READER::ReadLine() throw (IOError) unsigned FILE_LINE_READER::ReadLine() throw( IO_ERROR )
{ {
length = 0; length = 0;
line[0] = 0; line[0] = 0;
...@@ -101,7 +101,7 @@ unsigned FILE_LINE_READER::ReadLine() throw (IOError) ...@@ -101,7 +101,7 @@ unsigned FILE_LINE_READER::ReadLine() throw (IOError)
length += strlen( line + length ); length += strlen( line + length );
if( length == maxLineLength ) if( length == maxLineLength )
throw IOError( _("Line length exceeded") ); throw IO_ERROR( _("Line length exceeded") );
// a normal line breaks here, once through while loop // a normal line breaks here, once through while loop
if( length+1 < capacity || line[length-1] == '\n' ) if( length+1 < capacity || line[length-1] == '\n' )
...@@ -117,7 +117,7 @@ unsigned FILE_LINE_READER::ReadLine() throw (IOError) ...@@ -117,7 +117,7 @@ unsigned FILE_LINE_READER::ReadLine() throw (IOError)
} }
unsigned STRING_LINE_READER::ReadLine() throw (IOError) unsigned STRING_LINE_READER::ReadLine() throw( IO_ERROR )
{ {
size_t nlOffset = lines.find( '\n', ndx ); size_t nlOffset = lines.find( '\n', ndx );
...@@ -129,7 +129,7 @@ unsigned STRING_LINE_READER::ReadLine() throw (IOError) ...@@ -129,7 +129,7 @@ unsigned STRING_LINE_READER::ReadLine() throw (IOError)
if( length ) if( length )
{ {
if( length >= maxLineLength ) if( length >= maxLineLength )
throw IOError( _("Line length exceeded") ); throw IO_ERROR( _("Line length exceeded") );
if( length+1 > capacity ) // +1 for terminating nul if( length+1 > capacity ) // +1 for terminating nul
expandCapacity( length+1 ); expandCapacity( length+1 );
...@@ -186,7 +186,7 @@ const char* OUTPUTFORMATTER::GetQuoteChar( const char* wrapee, const char* quote ...@@ -186,7 +186,7 @@ const char* OUTPUTFORMATTER::GetQuoteChar( const char* wrapee, const char* quote
} }
int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap ) throw( IOError ) int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap ) throw( IO_ERROR )
{ {
int ret = vsnprintf( &buffer[0], buffer.size(), fmt, ap ); int ret = vsnprintf( &buffer[0], buffer.size(), fmt, ap );
if( ret >= (int) buffer.size() ) if( ret >= (int) buffer.size() )
...@@ -202,7 +202,7 @@ int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap ) throw( IOError ) ...@@ -202,7 +202,7 @@ int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap ) throw( IOError )
} }
int OUTPUTFORMATTER::sprint( const char* fmt, ... ) throw( IOError ) int OUTPUTFORMATTER::sprint( const char* fmt, ... ) throw( IO_ERROR )
{ {
va_list args; va_list args;
...@@ -214,7 +214,7 @@ int OUTPUTFORMATTER::sprint( const char* fmt, ... ) throw( IOError ) ...@@ -214,7 +214,7 @@ int OUTPUTFORMATTER::sprint( const char* fmt, ... ) throw( IOError )
} }
int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IOError ) int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IO_ERROR )
{ {
#define NESTWIDTH 2 ///< how many spaces per nestLevel #define NESTWIDTH 2 ///< how many spaces per nestLevel
...@@ -243,7 +243,7 @@ int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IOError ...@@ -243,7 +243,7 @@ int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IOError
} }
const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IOError ) const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IO_ERROR )
{ {
// derived class's notion of what a quote character is // derived class's notion of what a quote character is
char quote = *GetQuoteChar( "(" ); char quote = *GetQuoteChar( "(" );
...@@ -268,7 +268,7 @@ const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IOError ) ...@@ -268,7 +268,7 @@ const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IOError )
// a decision was made to make all S-expression strings be on a single // a decision was made to make all S-expression strings be on a single
// line. You can embedd \n (human readable) in the text but not // line. You can embedd \n (human readable) in the text but not
// '\n' which is 0x0a. // '\n' which is 0x0a.
throw IOError( _( "S-expression string has newline" ) ); throw IO_ERROR( _( "S-expression string has newline" ) );
} }
} }
...@@ -285,7 +285,7 @@ const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IOError ) ...@@ -285,7 +285,7 @@ const char* OUTPUTFORMATTER::Quoted( std::string* aWrapee ) throw( IOError )
//-----<STRING_FORMATTER>---------------------------------------------------- //-----<STRING_FORMATTER>----------------------------------------------------
void STRING_FORMATTER::write( const char* aOutBuf, int aCount ) throw( IOError ) void STRING_FORMATTER::write( const char* aOutBuf, int aCount ) throw( IO_ERROR )
{ {
mystring.append( aOutBuf, aCount ); mystring.append( aOutBuf, aCount );
} }
...@@ -314,7 +314,7 @@ const char* STREAM_OUTPUTFORMATTER::GetQuoteChar( const char* wrapee ) ...@@ -314,7 +314,7 @@ const char* STREAM_OUTPUTFORMATTER::GetQuoteChar( const char* wrapee )
} }
void STREAM_OUTPUTFORMATTER::write( const char* aOutBuf, int aCount ) throw( IOError ) void STREAM_OUTPUTFORMATTER::write( const char* aOutBuf, int aCount ) throw( IO_ERROR )
{ {
int lastWrite; int lastWrite;
...@@ -326,7 +326,7 @@ void STREAM_OUTPUTFORMATTER::write( const char* aOutBuf, int aCount ) throw( IOE ...@@ -326,7 +326,7 @@ void STREAM_OUTPUTFORMATTER::write( const char* aOutBuf, int aCount ) throw( IOE
if( !os.IsOk() ) if( !os.IsOk() )
{ {
throw IOError( _( "OUTPUTSTREAM_OUTPUTFORMATTER write error" ) ); throw IO_ERROR( _( "OUTPUTSTREAM_OUTPUTFORMATTER write error" ) );
} }
} }
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
typedef wxXmlProperty XATTR; typedef wxXmlProperty XATTR;
void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
switch( GetType() ) switch( GetType() )
{ {
...@@ -48,7 +48,7 @@ void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) ...@@ -48,7 +48,7 @@ void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
} }
void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
{ {
std::string utf8; std::string utf8;
......
...@@ -613,7 +613,7 @@ void WinEDA_SchematicFrame::LoadSettings() ...@@ -613,7 +613,7 @@ void WinEDA_SchematicFrame::LoadSettings()
{ {
m_TemplateFieldNames.Parse( &lexer ); m_TemplateFieldNames.Parse( &lexer );
} }
catch( IOError e ) catch( IO_ERROR e )
{ {
// @todo show error msg // @todo show error msg
D(printf("templatefieldnames parsing error: '%s'\n", D(printf("templatefieldnames parsing error: '%s'\n",
......
...@@ -1055,7 +1055,7 @@ bool EXPORT_HELP::WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxStr ...@@ -1055,7 +1055,7 @@ bool EXPORT_HELP::WriteGENERICNetList( WinEDA_SchematicFrame* frame, const wxStr
STREAM_OUTPUTFORMATTER outputFormatter( os ); STREAM_OUTPUTFORMATTER outputFormatter( os );
xroot->Format( &outputFormatter, 0 ); xroot->Format( &outputFormatter, 0 );
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
delete xroot; delete xroot;
goto L_error; goto L_error;
......
...@@ -31,7 +31,7 @@ wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx ) ...@@ -31,7 +31,7 @@ wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx )
} }
} }
void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ) void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR )
{ {
// user may want spaces in his field name, ug, so quote them for the parser. // user may want spaces in his field name, ug, so quote them for the parser.
out->Print( nestLevel, "(field (name \"%s\")", CONV_TO_UTF8(m_Name) ); out->Print( nestLevel, "(field (name \"%s\")", CONV_TO_UTF8(m_Name) );
...@@ -46,7 +46,7 @@ void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const thr ...@@ -46,7 +46,7 @@ void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const thr
} }
void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError ) void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IO_ERROR )
{ {
TFIELD_T tok; TFIELD_T tok;
...@@ -87,7 +87,7 @@ void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError ) ...@@ -87,7 +87,7 @@ void TEMPLATE_FIELDNAME::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError )
} }
void TEMPLATES::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ) void TEMPLATES::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR )
{ {
// We'll keep this general, and include the \n, even though the only known // We'll keep this general, and include the \n, even though the only known
// use at this time will not want the newlines or the indentation. // use at this time will not want the newlines or the indentation.
...@@ -97,7 +97,7 @@ void TEMPLATES::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOErr ...@@ -97,7 +97,7 @@ void TEMPLATES::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOErr
out->Print( 0, ")\n" ); out->Print( 0, ")\n" );
} }
void TEMPLATES::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError ) void TEMPLATES::Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IO_ERROR )
{ {
TFIELD_T tok; TFIELD_T tok;
......
...@@ -66,7 +66,7 @@ struct TEMPLATE_FIELDNAME ...@@ -66,7 +66,7 @@ struct TEMPLATE_FIELDNAME
* Function Format * Function Format
* serializes this object out as text into the given OUTPUTFORMATTER. * serializes this object out as text into the given OUTPUTFORMATTER.
*/ */
void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ); void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR );
/** /**
* Function Parse * Function Parse
...@@ -81,7 +81,7 @@ struct TEMPLATE_FIELDNAME ...@@ -81,7 +81,7 @@ struct TEMPLATE_FIELDNAME
* *
* @param aSpec is the input token stream of keywords and symbols. * @param aSpec is the input token stream of keywords and symbols.
*/ */
void Parse( TEMPLATE_FIELDNAMES_LEXER* aSpec ) throw( IOError ); void Parse( TEMPLATE_FIELDNAMES_LEXER* aSpec ) throw( IO_ERROR );
/** /**
* Function GetDefaultFieldName * Function GetDefaultFieldName
...@@ -106,13 +106,13 @@ public: ...@@ -106,13 +106,13 @@ public:
* Function Format * Function Format
* serializes this object out as text into the given OUTPUTFORMATTER. * serializes this object out as text into the given OUTPUTFORMATTER.
*/ */
void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IOError ); void Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR );
/** /**
* Function Parse * Function Parse
* fills this object from information in the input stream handled by TEMPLATE_FIELDNAMES_LEXER * fills this object from information in the input stream handled by TEMPLATE_FIELDNAMES_LEXER
*/ */
void Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IOError ); void Parse( TEMPLATE_FIELDNAMES_LEXER* in ) throw( IO_ERROR );
/** /**
......
...@@ -102,7 +102,7 @@ class DSNLEXER ...@@ -102,7 +102,7 @@ class DSNLEXER
void init(); void init();
int readLine() throw (IOError) int readLine() throw( IO_ERROR )
{ {
unsigned len = reader->ReadLine(); unsigned len = reader->ReadLine();
...@@ -213,29 +213,29 @@ public: ...@@ -213,29 +213,29 @@ public:
* this lower level function returning an int (so the enum does not collide * this lower level function returning an int (so the enum does not collide
* with another usage). * with another usage).
* @return int - the type of token found next. * @return int - the type of token found next.
* @throw IOError - only if the LINE_READER throws it. * @throw IO_ERROR - only if the LINE_READER throws it.
*/ */
int NextTok() throw (IOError); int NextTok() throw( IO_ERROR );
/** /**
* Function NeedSYMBOL * Function NeedSYMBOL
* calls NextTok() and then verifies that the token read in * calls NextTok() and then verifies that the token read in
* satisfies bool IsSymbol(). * satisfies bool IsSymbol().
* If not, an IOError is thrown. * If not, an IO_ERROR is thrown.
* @return int - the actual token read in. * @return int - the actual token read in.
* @throw IOError, if the next token does not satisfy IsSymbol() * @throw IO_ERROR, if the next token does not satisfy IsSymbol()
*/ */
int NeedSYMBOL() throw( IOError ); int NeedSYMBOL() throw( IO_ERROR );
/** /**
* Function NeedSYMBOLorNUMBER * Function NeedSYMBOLorNUMBER
* calls NextTok() and then verifies that the token read in * calls NextTok() and then verifies that the token read in
* satisfies bool IsSymbol() or tok==DSN_NUMBER. * satisfies bool IsSymbol() or tok==DSN_NUMBER.
* If not, an IOError is thrown. * If not, an IO_ERROR is thrown.
* @return int - the actual token read in. * @return int - the actual token read in.
* @throw IOError, if the next token does not satisfy the above test * @throw IO_ERROR, if the next token does not satisfy the above test
*/ */
int NeedSYMBOLorNUMBER() throw( IOError ); int NeedSYMBOLorNUMBER() throw( IO_ERROR );
/** /**
* Function CurTok * Function CurTok
...@@ -311,58 +311,58 @@ public: ...@@ -311,58 +311,58 @@ public:
* encapsulates the formatting of an error message which contains the exact * encapsulates the formatting of an error message which contains the exact
* location within the input file of something the caller is rejecting. * location within the input file of something the caller is rejecting.
*/ */
void ThrowIOError( wxString aText, int charOffset ) throw (IOError); void ThrowIOError( wxString aText, int charOffset ) throw( IO_ERROR );
/** /**
* Function Expecting * Function Expecting
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param aTok is the token/keyword type which was expected at the current input location. * @param aTok is the token/keyword type which was expected at the current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void Expecting( int aTok ) throw( IOError ); void Expecting( int aTok ) throw( IO_ERROR );
/** /**
* Function Expecting * Function Expecting
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param aErrorMsg is the token/keyword type which was expected at the * @param aErrorMsg is the token/keyword type which was expected at the
* current input location. * current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void Expecting( const wxString& aErrorMsg ) throw( IOError ); void Expecting( const wxString& aErrorMsg ) throw( IO_ERROR );
/** /**
* Function Unexpected * Function Unexpected
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param aTok is the token/keyword type which was not expected at the * @param aTok is the token/keyword type which was not expected at the
* current input location. * current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void Unexpected( int aTok ) throw( IOError ); void Unexpected( int aTok ) throw( IO_ERROR );
/** /**
* Function Unexpected * Function Unexpected
* throws an IOError exception with an input file specific error message. * throws an IO_ERROR exception with an input file specific error message.
* @param aErrorMsg is the token/keyword type which was not expected at the * @param aErrorMsg is the token/keyword type which was not expected at the
* current input location. * current input location.
* @throw IOError with the location within the input file of the problem. * @throw IO_ERROR with the location within the input file of the problem.
*/ */
void Unexpected( const wxString& aErrorMsg ) throw( IOError ); void Unexpected( const wxString& aErrorMsg ) throw( IO_ERROR );
/** /**
* Function NeedLEFT * Function NeedLEFT
* calls NextTok() and then verifies that the token read in is a DSN_LEFT. * calls NextTok() and then verifies that the token read in is a DSN_LEFT.
* If it is not, an IOError is thrown. * If it is not, an IO_ERROR is thrown.
* @throw IOError, if the next token is not a DSN_LEFT * @throw IO_ERROR, if the next token is not a DSN_LEFT
*/ */
void NeedLEFT() throw( IOError ); void NeedLEFT() throw( IO_ERROR );
/** /**
* Function NeedRIGHT * Function NeedRIGHT
* calls NextTok() and then verifies that the token read in is a DSN_RIGHT. * calls NextTok() and then verifies that the token read in is a DSN_RIGHT.
* If it is not, an IOError is thrown. * If it is not, an IO_ERROR is thrown.
* @throw IOError, if the next token is not a DSN_RIGHT * @throw IO_ERROR, if the next token is not a DSN_RIGHT
*/ */
void NeedRIGHT() throw( IOError ); void NeedRIGHT() throw( IO_ERROR );
/** /**
* Function GetTokenText * Function GetTokenText
......
...@@ -42,20 +42,20 @@ ...@@ -42,20 +42,20 @@
/** /**
* Struct IOError * Struct IO_ERROR
* is a class used to hold an error message and may be used to throw exceptions * is a class used to hold an error message and may be used to throw exceptions
* containing meaningful error messages. * containing meaningful error messages.
*/ */
struct IOError struct IO_ERROR
{ {
wxString errorText; wxString errorText;
IOError( const wxChar* aMsg ) : IO_ERROR( const wxChar* aMsg ) :
errorText( aMsg ) errorText( aMsg )
{ {
} }
IOError( const wxString& aMsg ) : IO_ERROR( const wxString& aMsg ) :
errorText( aMsg ) errorText( aMsg )
{ {
} }
...@@ -104,9 +104,9 @@ public: ...@@ -104,9 +104,9 @@ public:
* counter. If the line is larger than aMaxLineLength passed to the * counter. If the line is larger than aMaxLineLength passed to the
* constructor, then an exception is thrown. The line is nul terminated. * constructor, then an exception is thrown. The line is nul terminated.
* @return unsigned - The number of bytes read, 0 at end of file. * @return unsigned - The number of bytes read, 0 at end of file.
* @throw IOError when a line is too long. * @throw IO_ERROR when a line is too long.
*/ */
virtual unsigned ReadLine() throw( IOError ) = 0; virtual unsigned ReadLine() throw( IO_ERROR ) = 0;
/** /**
* Function GetSource * Function GetSource
...@@ -181,7 +181,7 @@ public: ...@@ -181,7 +181,7 @@ public:
fclose( fp ); fclose( fp );
} }
unsigned ReadLine() throw( IOError ); // see LINE_READER::ReadLine() description unsigned ReadLine() throw( IO_ERROR ); // see LINE_READER::ReadLine() description
/** /**
* Function Rewind * Function Rewind
...@@ -228,7 +228,7 @@ public: ...@@ -228,7 +228,7 @@ public:
source = aSource; source = aSource;
} }
unsigned ReadLine() throw(IOError); // see LINE_READER::ReadLine() description unsigned ReadLine() throw( IO_ERROR ); // see LINE_READER::ReadLine() description
}; };
...@@ -251,8 +251,8 @@ class OUTPUTFORMATTER ...@@ -251,8 +251,8 @@ class OUTPUTFORMATTER
{ {
std::vector<char> buffer; std::vector<char> buffer;
int sprint( const char* fmt, ... ) throw( IOError ); int sprint( const char* fmt, ... ) throw( IO_ERROR );
int vprint( const char* fmt, va_list ap ) throw( IOError ); int vprint( const char* fmt, va_list ap ) throw( IO_ERROR );
protected: protected:
...@@ -283,9 +283,9 @@ protected: ...@@ -283,9 +283,9 @@ protected:
* *
* @param aOutBuf is the start of a byte buffer to write. * @param aOutBuf is the start of a byte buffer to write.
* @param aCount tells how many bytes to write. * @param aCount tells how many bytes to write.
* @throw IOError, if there is a problem outputting, such as a full disk. * @throw IO_ERROR, if there is a problem outputting, such as a full disk.
*/ */
virtual void write( const char* aOutBuf, int aCount ) throw( IOError ) = 0; virtual void write( const char* aOutBuf, int aCount ) throw( IO_ERROR ) = 0;
#if defined(__GNUG__) // The GNU C++ compiler defines this #if defined(__GNUG__) // The GNU C++ compiler defines this
...@@ -312,9 +312,9 @@ public: ...@@ -312,9 +312,9 @@ public:
* @param ... a variable list of parameters that will get blended into * @param ... a variable list of parameters that will get blended into
* the output under control of the format string. * the output under control of the format string.
* @return int - the number of characters output. * @return int - the number of characters output.
* @throw IOError, if there is a problem outputting, such as a full disk. * @throw IO_ERROR, if there is a problem outputting, such as a full disk.
*/ */
int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) throw( IOError ); int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) throw( IO_ERROR );
/** /**
* Function GetQuoteChar * Function GetQuoteChar
...@@ -350,11 +350,11 @@ public: ...@@ -350,11 +350,11 @@ public:
* *
* @return const char* - useful for passing to printf() style functions that * @return const char* - useful for passing to printf() style functions that
* must output utf8 streams. * must output utf8 streams.
* @throw IOError, if aWrapee has any \r or \n bytes in it which is * @throw IO_ERROR, if aWrapee has any \r or \n bytes in it which is
* illegal according to the DSNLEXER who does not ever want them * illegal according to the DSNLEXER who does not ever want them
* within a string. * within a string.
*/ */
virtual const char* Quoted( std::string* aWrapee ) throw( IOError ); virtual const char* Quoted( std::string* aWrapee ) throw( IO_ERROR );
//-----</interface functions>----------------------------------------- //-----</interface functions>-----------------------------------------
}; };
...@@ -402,7 +402,7 @@ public: ...@@ -402,7 +402,7 @@ public:
//-----<OUTPUTFORMATTER>------------------------------------------------ //-----<OUTPUTFORMATTER>------------------------------------------------
protected: protected:
void write( const char* aOutBuf, int aCount ) throw( IOError ); void write( const char* aOutBuf, int aCount ) throw( IO_ERROR );
//-----</OUTPUTFORMATTER>----------------------------------------------- //-----</OUTPUTFORMATTER>-----------------------------------------------
}; };
...@@ -434,7 +434,7 @@ public: ...@@ -434,7 +434,7 @@ public:
const char* GetQuoteChar( const char* wrapee ); const char* GetQuoteChar( const char* wrapee );
protected: protected:
void write( const char* aOutBuf, int aCount ) throw( IOError ); void write( const char* aOutBuf, int aCount ) throw( IO_ERROR );
//-----</OUTPUTFORMATTER>----------------------------------------------- //-----</OUTPUTFORMATTER>-----------------------------------------------
}; };
......
...@@ -52,9 +52,9 @@ public: ...@@ -52,9 +52,9 @@ public:
* writes this object as UTF8 out to an OUTPUTFORMATTER as an S-expression. * writes this object as UTF8 out to an OUTPUTFORMATTER as an S-expression.
* @param out The formatter to write to. * @param out The formatter to write to.
* @param nestLevel A multiple of the number of spaces to preceed the output with. * @param nestLevel A multiple of the number of spaces to preceed the output with.
* @throw IOError if a system error writing the output, such as a full disk. * @throw IO_ERROR if a system error writing the output, such as a full disk.
*/ */
virtual void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ); virtual void Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR );
/** /**
* Function FormatContents * Function FormatContents
...@@ -62,9 +62,9 @@ public: ...@@ -62,9 +62,9 @@ public:
* This is the same as Format() except that the outer wrapper is not included. * This is the same as Format() except that the outer wrapper is not included.
* @param out The formatter to write to. * @param out The formatter to write to.
* @param nestLevel A multiple of the number of spaces to preceed the output with. * @param nestLevel A multiple of the number of spaces to preceed the output with.
* @throw IOError if a system error writing the output, such as a full disk. * @throw IO_ERROR if a system error writing the output, such as a full disk.
*/ */
virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ); virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR );
// The following functions did not appear in the base class until recently. // The following functions did not appear in the base class until recently.
// Overload them even if they are present in base class, just to make sure // Overload them even if they are present in base class, just to make sure
......
...@@ -294,7 +294,7 @@ protected: ///< derived classes must implement ...@@ -294,7 +294,7 @@ protected: ///< derived classes must implement
* part is done, then LIBRARY::ReloadPart() must be called on this same part * part is done, then LIBRARY::ReloadPart() must be called on this same part
* and all parts that inherit it must be reparsed. * and all parts that inherit it must be reparsed.
*/ */
virtual void WritePart( const STRING& aPartName, const STRING& aSExpression ) throw ( IO_ERROR ) = 0; virtual void WritePart( const STRING& aPartName, const STRING& aSExpression ) throw( IO_ERROR ) = 0;
protected: protected:
...@@ -318,7 +318,7 @@ class LIBS ...@@ -318,7 +318,7 @@ class LIBS
* will find it and load it into its containing LIBRARY, even if that means * will find it and load it into its containing LIBRARY, even if that means
* having to load a new LIBRARY as given in the library table. * having to load a new LIBRARY as given in the library table.
*/ */
static PART* GetPart( const LPID& aLogicalPartID ) throw ( IO_ERROR ); static PART* GetPart( const LPID& aLogicalPartID ) throw( IO_ERROR );
/** /**
* Function GetLIBRARY * Function GetLIBRARY
...@@ -444,9 +444,9 @@ public: ...@@ -444,9 +444,9 @@ public:
* There can be some self referential issues that mean all the parts in the PARTS_LIST * There can be some self referential issues that mean all the parts in the PARTS_LIST
* have to reparsed. * have to reparsed.
*/ */
virtual void WritePart( PART* aPart ) throw ( IO_ERROR ) = 0; virtual void WritePart( PART* aPart ) throw( IO_ERROR ) = 0;
virtual void SetPartBody( PART* aPart, const STRING& aSExpression ) throw ( IO_ERROR ); virtual void SetPartBody( PART* aPart, const STRING& aSExpression ) throw( IO_ERROR );
/** /**
* Function GetRevisions * Function GetRevisions
......
This diff is collapsed.
This diff is collapsed.
...@@ -112,7 +112,7 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event ) ...@@ -112,7 +112,7 @@ void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event )
// if an exception is thrown by FromBOARD or ExportPCB(), then // if an exception is thrown by FromBOARD or ExportPCB(), then
// ~SPECCTRA_DB() will close the file. // ~SPECCTRA_DB() will close the file.
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
ok = false; ok = false;
...@@ -719,7 +719,7 @@ PADSTACK* SPECCTRA_DB::makeVia( const SEGVIA* aVia ) ...@@ -719,7 +719,7 @@ PADSTACK* SPECCTRA_DB::makeVia( const SEGVIA* aVia )
} }
void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IOError ) void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ERROR )
{ {
TYPE_COLLECTOR items; TYPE_COLLECTOR items;
...@@ -905,7 +905,7 @@ typedef std::set<std::string> STRINGSET; ...@@ -905,7 +905,7 @@ typedef std::set<std::string> STRINGSET;
typedef std::pair<STRINGSET::iterator, bool> STRINGSET_PAIR; typedef std::pair<STRINGSET::iterator, bool> STRINGSET_PAIR;
void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
{ {
TYPE_COLLECTOR items; TYPE_COLLECTOR items;
......
...@@ -96,7 +96,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) ...@@ -96,7 +96,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
db.LoadSESSION( fullFileName ); db.LoadSESSION( fullFileName );
db.FromSESSION( GetBoard() ); db.FromSESSION( GetBoard() );
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
SetLocaleTo_Default( ); // revert to the current locale SetLocaleTo_Default( ); // revert to the current locale
...@@ -193,7 +193,7 @@ static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution ) ...@@ -193,7 +193,7 @@ static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution )
} }
TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) throw( IOError ) TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) throw( IO_ERROR )
{ {
int layerNdx = findLayerName( aPath->layer_id ); int layerNdx = findLayerName( aPath->layer_id );
...@@ -216,7 +216,7 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) thro ...@@ -216,7 +216,7 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) thro
} }
SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNetCode ) throw( IOError ) SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNetCode ) throw( IO_ERROR )
{ {
SEGVIA* via = 0; SEGVIA* via = 0;
SHAPE* shape; SHAPE* shape;
...@@ -351,7 +351,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet ...@@ -351,7 +351,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
// no UI code in this function, throw exception to report problems to the // no UI code in this function, throw exception to report problems to the
// UI handler: void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) // UI handler: void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError ) void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IO_ERROR )
{ {
sessionBoard = aBoard; // not owned here sessionBoard = aBoard; // not owned here
......
...@@ -63,7 +63,7 @@ int main( int argc, char** argv ) ...@@ -63,7 +63,7 @@ int main( int argc, char** argv )
// db.LoadPCB( filename ); // db.LoadPCB( filename );
db.LoadSESSION( filename ); db.LoadSESSION( filename );
} }
catch( IOError ioe ) catch( IO_ERROR ioe )
{ {
fprintf( stderr, "%s\n", CONV_TO_UTF8(ioe.errorText) ); fprintf( stderr, "%s\n", CONV_TO_UTF8(ioe.errorText) );
failed = true; failed = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment