Loading common/richio.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -280,7 +280,7 @@ int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IO_ERRO } std::string OUTPUTFORMATTER::Quoted( const std::string& aWrapee ) throw( IO_ERROR ) std::string OUTPUTFORMATTER::Quotes( const std::string& aWrapee ) throw( IO_ERROR ) { static const char quoteThese[] = "\t ()\n\r"; Loading Loading @@ -329,6 +329,17 @@ std::string OUTPUTFORMATTER::Quoted( const std::string& aWrapee ) throw( IO_ERRO } std::string OUTPUTFORMATTER::Quotew( const wxString& aWrapee ) throw( IO_ERROR ) { // s-expressions atoms are always encoded as UTF-8. // The non-virutal function calls the virtual workhorse function, and if // a different quoting or escaping strategy is desired from the standard, // a derived class can overload Quotes() above, but // should never be a reason to overload this Quotew() here. return Quotes( (const char*) aWrapee.utf8_str() ); } //-----<STRING_FORMATTER>---------------------------------------------------- void STRING_FORMATTER::write( const char* aOutBuf, int aCount ) throw( IO_ERROR ) Loading common/xnode.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR ) switch( GetType() ) { case wxXML_ELEMENT_NODE: out->Print( nestLevel, "(%s", out->Quoted( GetName() ).c_str() ); out->Print( nestLevel, "(%s", out->Quotew( GetName() ).c_str() ); FormatContents( out, nestLevel ); if( GetNext() ) out->Print( 0, ")\n" ); Loading @@ -55,8 +55,8 @@ void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERRO { out->Print( 0, " (%s %s)", // attr names should never need quoting, no spaces, we designed the file. out->Quoted( attr->GetName() ).c_str(), out->Quoted( attr->GetValue() ).c_str() out->Quotew( attr->GetName() ).c_str(), out->Quotew( attr->GetValue() ).c_str() ); } Loading @@ -82,7 +82,7 @@ void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERRO break; case wxXML_TEXT_NODE: out->Print( 0, " %s", out->Quoted( GetContent() ).c_str() ); out->Print( 0, " %s", out->Quotew( GetContent() ).c_str() ); break; default: Loading eeschema/template_fieldnames.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -32,10 +32,10 @@ wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx ) void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR ) { out->Print( nestLevel, "(field (name %s)", out->Quoted( m_Name ).c_str() ); out->Print( nestLevel, "(field (name %s)", out->Quotew( m_Name ).c_str() ); if( !m_Value.IsEmpty() ) out->Print( 0, "(value %s)", out->Quoted( m_Value ).c_str() ); out->Print( 0, "(value %s)", out->Quotew( m_Value ).c_str() ); if( m_Visible ) out->Print( 0, " visible" ); Loading include/richio.h +3 −7 Original line number Diff line number Diff line Loading @@ -486,7 +486,7 @@ public: } /** * Function Quoted * Function Quotes * checks \a aWrapee input string for a need to be quoted * (e.g. contains a ')' character or a space), and for \" double quotes * within the string that need to be escaped such that the DSNLEXER Loading @@ -500,13 +500,9 @@ public: * * @throw IO_ERROR, if there is any kind of problem with the input string. */ virtual std::string Quoted( const std::string& aWrapee ) throw( IO_ERROR ); virtual std::string Quotes( const std::string& aWrapee ) throw( IO_ERROR ); std::string Quoted( const wxString& aWrapee ) throw( IO_ERROR ) { // s-expressions atoms are always encoded as UTF-8 return Quoted( (const char*) aWrapee.utf8_str() ); } std::string Quotew( const wxString& aWrapee ) throw( IO_ERROR ); //-----</interface functions>----------------------------------------- }; Loading new/sch_lib_table.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -157,10 +157,10 @@ void LIB_TABLE::ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR ) { out->Print( nestLevel, "(lib (logical %s)(type %s)(full_uri %s)(options %s))\n", out->Quoted( logicalName ).c_str(), out->Quoted( libType ).c_str(), out->Quoted( fullURI ).c_str(), out->Quoted( options ).c_str() out->Quotes( logicalName ).c_str(), out->Quotes( libType ).c_str(), out->Quotes( fullURI ).c_str(), out->Quotes( options ).c_str() ); } Loading Loading
common/richio.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -280,7 +280,7 @@ int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... ) throw( IO_ERRO } std::string OUTPUTFORMATTER::Quoted( const std::string& aWrapee ) throw( IO_ERROR ) std::string OUTPUTFORMATTER::Quotes( const std::string& aWrapee ) throw( IO_ERROR ) { static const char quoteThese[] = "\t ()\n\r"; Loading Loading @@ -329,6 +329,17 @@ std::string OUTPUTFORMATTER::Quoted( const std::string& aWrapee ) throw( IO_ERRO } std::string OUTPUTFORMATTER::Quotew( const wxString& aWrapee ) throw( IO_ERROR ) { // s-expressions atoms are always encoded as UTF-8. // The non-virutal function calls the virtual workhorse function, and if // a different quoting or escaping strategy is desired from the standard, // a derived class can overload Quotes() above, but // should never be a reason to overload this Quotew() here. return Quotes( (const char*) aWrapee.utf8_str() ); } //-----<STRING_FORMATTER>---------------------------------------------------- void STRING_FORMATTER::write( const char* aOutBuf, int aCount ) throw( IO_ERROR ) Loading
common/xnode.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR ) switch( GetType() ) { case wxXML_ELEMENT_NODE: out->Print( nestLevel, "(%s", out->Quoted( GetName() ).c_str() ); out->Print( nestLevel, "(%s", out->Quotew( GetName() ).c_str() ); FormatContents( out, nestLevel ); if( GetNext() ) out->Print( 0, ")\n" ); Loading @@ -55,8 +55,8 @@ void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERRO { out->Print( 0, " (%s %s)", // attr names should never need quoting, no spaces, we designed the file. out->Quoted( attr->GetName() ).c_str(), out->Quoted( attr->GetValue() ).c_str() out->Quotew( attr->GetName() ).c_str(), out->Quotew( attr->GetValue() ).c_str() ); } Loading @@ -82,7 +82,7 @@ void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERRO break; case wxXML_TEXT_NODE: out->Print( 0, " %s", out->Quoted( GetContent() ).c_str() ); out->Print( 0, " %s", out->Quotew( GetContent() ).c_str() ); break; default: Loading
eeschema/template_fieldnames.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -32,10 +32,10 @@ wxString TEMPLATE_FIELDNAME::GetDefaultFieldName( int aFieldNdx ) void TEMPLATE_FIELDNAME::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR ) { out->Print( nestLevel, "(field (name %s)", out->Quoted( m_Name ).c_str() ); out->Print( nestLevel, "(field (name %s)", out->Quotew( m_Name ).c_str() ); if( !m_Value.IsEmpty() ) out->Print( 0, "(value %s)", out->Quoted( m_Value ).c_str() ); out->Print( 0, "(value %s)", out->Quotew( m_Value ).c_str() ); if( m_Visible ) out->Print( 0, " visible" ); Loading
include/richio.h +3 −7 Original line number Diff line number Diff line Loading @@ -486,7 +486,7 @@ public: } /** * Function Quoted * Function Quotes * checks \a aWrapee input string for a need to be quoted * (e.g. contains a ')' character or a space), and for \" double quotes * within the string that need to be escaped such that the DSNLEXER Loading @@ -500,13 +500,9 @@ public: * * @throw IO_ERROR, if there is any kind of problem with the input string. */ virtual std::string Quoted( const std::string& aWrapee ) throw( IO_ERROR ); virtual std::string Quotes( const std::string& aWrapee ) throw( IO_ERROR ); std::string Quoted( const wxString& aWrapee ) throw( IO_ERROR ) { // s-expressions atoms are always encoded as UTF-8 return Quoted( (const char*) aWrapee.utf8_str() ); } std::string Quotew( const wxString& aWrapee ) throw( IO_ERROR ); //-----</interface functions>----------------------------------------- }; Loading
new/sch_lib_table.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -157,10 +157,10 @@ void LIB_TABLE::ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const throw( IO_ERROR ) { out->Print( nestLevel, "(lib (logical %s)(type %s)(full_uri %s)(options %s))\n", out->Quoted( logicalName ).c_str(), out->Quoted( libType ).c_str(), out->Quoted( fullURI ).c_str(), out->Quoted( options ).c_str() out->Quotes( logicalName ).c_str(), out->Quotes( libType ).c_str(), out->Quotes( fullURI ).c_str(), out->Quotes( options ).c_str() ); } Loading