|
|
|
@ -83,10 +83,15 @@ const wxString LIB_TABLE_ROW::GetFullURI( bool aSubstituted ) const |
|
|
|
void LIB_TABLE_ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const |
|
|
|
throw( IO_ERROR, boost::interprocess::lock_exception ) |
|
|
|
{ |
|
|
|
// In Kicad, we save path and file names using the Unix notation (separator = '/')
|
|
|
|
// So ensure separator is always '/' is saved URI string
|
|
|
|
wxString uri = GetFullURI(); |
|
|
|
uri.Replace( '\\', '/' ); |
|
|
|
|
|
|
|
out->Print( nestLevel, "(lib (name %s)(type %s)(uri %s)(options %s)(descr %s))\n", |
|
|
|
out->Quotew( GetNickName() ).c_str(), |
|
|
|
out->Quotew( GetType() ).c_str(), |
|
|
|
out->Quotew( GetFullURI() ).c_str(), |
|
|
|
out->Quotew( uri ).c_str(), |
|
|
|
out->Quotew( GetOptions() ).c_str(), |
|
|
|
out->Quotew( GetDescr() ).c_str() |
|
|
|
); |
|
|
|
@ -143,7 +148,17 @@ void LIB_TABLE_ROW::Parse( std::unique_ptr< LIB_TABLE_ROW >& aRow, LIB_TABLE_LEX |
|
|
|
in->Duplicate( tok ); |
|
|
|
sawUri = true; |
|
|
|
in->NeedSYMBOLorNUMBER(); |
|
|
|
aRow->SetFullURI( in->FromUTF8() ); |
|
|
|
// Saved path and file names use the Unix notation (separator = '/')
|
|
|
|
// However old files, and files edited by hands can use the woindows
|
|
|
|
// separator. Force the unix notation
|
|
|
|
// (It works on windows, and moreover, wxFileName and wxDir takes care to that
|
|
|
|
// on windows)
|
|
|
|
// moreover, URLs use the '/' as separator
|
|
|
|
{ |
|
|
|
wxString uri = in->FromUTF8(); |
|
|
|
uri.Replace( '\\', '/' ); |
|
|
|
aRow->SetFullURI( uri ); |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
case T_type: |
|
|
|
|