Fixes issues with IDF file I/O on Windows (the famous 'ascii vs. binary' issue) and the reported problem of partial paths when KISYS3DMOD is specified.

This commit is contained in:
unknown 2015-01-13 11:47:07 +01:00 committed by jean-pierre charras
parent 960ea566d6
commit b269128b8c
3 changed files with 10 additions and 4 deletions

View File

@ -378,7 +378,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
IDF3_COMP_OUTLINE* outline;
outline = aIDFBoard.GetComponentOutline( modfile->GetShape3DName() );
outline = aIDFBoard.GetComponentOutline( modfile->GetShape3DFullFilename() );
if( !outline )
throw( std::runtime_error( aIDFBoard.GetError() ) );

View File

@ -200,6 +200,9 @@ void BOARD_OUTLINE::readOutlines( std::ifstream& aBoardFile, IDF3::IDF_VERSION a
// rewind to the start of the last line; the routine invoking
// this is responsible for checking that the current '.END_ ...'
// matches the section header.
if(aBoardFile.eof())
aBoardFile.clear();
aBoardFile.seekg( pos );
if( outlines.size() > 0 )
@ -2998,6 +3001,9 @@ void IDF3_COMP_OUTLINE::readProperties( std::ifstream& aLibFile )
if( token.size() >= 5 && CompareToken( ".END_", token.substr( 0, 5 ) ) )
{
if(aLibFile.eof())
aLibFile.clear();
aLibFile.seekg( pos );
return;
}

View File

@ -2306,7 +2306,7 @@ void IDF3_BOARD::readBoardFile( const std::string& aFileName, bool aNoSubstitute
try
{
brd.open( aFileName.c_str(), std::ios_base::in );
brd.open( aFileName.c_str(), std::ios_base::in | std::ios_base::binary );
if( !brd.is_open() )
{
@ -2682,7 +2682,7 @@ void IDF3_BOARD::readLibFile( const std::string& aFileName )
try
{
lib.open( aFileName.c_str(), std::ios_base::in );
lib.open( aFileName.c_str(), std::ios_base::in | std::ios_base::binary );
IDF3::FILE_STATE state = IDF3::FILE_START;
@ -3883,7 +3883,7 @@ IDF3_COMP_OUTLINE* IDF3_BOARD::GetComponentOutline( wxString aFullFileName )
try
{
model.open( fname.c_str(), std::ios_base::in );
model.open( fname.c_str(), std::ios_base::in | std::ios_base::binary );
std::string iline; // the input line