bool CTestArchivePlugIn::ReadTestArchive( const wchar_t* filename )
{
  if( 0 == filename || 0 == filename[0] )
    return false;

  ON_wString path = filename;
  PathRenameExtension( path.Array(), L".dat" );

  if( !PathFileExists(path) )
  {
    //RhinoApp().Print( L"Error reading test archive - File not found.\n" );
    return false;
  }

  CFile f;
  CFileException e;
  if( !f.Open(path, CFile::modeRead, &e) )
  {
    wchar_t msg[255];
  	memset( msg, 0, sizeof(wchar_t) * 255);
    e.GetErrorMessage( msg, 255 );
    RhinoApp().Print( L"Error reading test archive - %s\n", msg );
    return false;
  }

  try
  {
    CArchive ar( &f, CArchive::load );
    m_list.Serialize( ar );
    ar.Close();
    f.Close();
  }
  catch( CFileException* ex )
  {
    wchar_t msg[255];
  	memset( msg, 0, sizeof(wchar_t) * 255);
    ex->GetErrorMessage( msg, 255 );
    RhinoApp().Print( L"Error reading test archive - %s\n", msg );
    ex->Delete();
  }

  return true;
}
Пример #2
0
void ON_wString::AppendToArray( const ON_wString& s )
{
  AppendToArray( s.Length(), s.Array() );
}
Пример #3
0
void ON_wString::CopyToArray( const ON_wString& s )
{
  CopyToArray( s.Length(), s.Array() );
}