38#ifndef QA_PCBNEW_DATA_LOCATION 
   39    #define QA_PCBNEW_DATA_LOCATION "???" 
   44    const char* env = std::getenv( 
"KICAD_TEST_PCBNEW_DATA_DIR" );
 
 
   79    std::unique_ptr<BOARD_ITEM> board;
 
   83        board.reset( parser.
Parse() );
 
 
   95                                                  std::istream&      aFallback )
 
   97    std::istream* in_stream = 
nullptr;
 
   98    std::ifstream file_stream;
 
  100    if( aFilename.empty() )
 
  103        in_stream = &aFallback;
 
  107        file_stream.open( aFilename );
 
  109        if( !file_stream.is_open() )
 
  114        in_stream = &file_stream;
 
 
  122                                                          std::istream& aFallback )
 
  124    std::istream* in_stream = 
nullptr;
 
  125    std::ifstream file_stream;
 
  127    if( aFilename.empty() )
 
  130        in_stream = &aFallback;
 
  134        file_stream.open( aFilename );
 
  136        if( !file_stream.is_open() )
 
  141        in_stream = &file_stream;
 
 
#define QA_PCBNEW_DATA_LOCATION
 
General utilities for PCB file IO for QA programs.
 
Information pertinent to a Pcbnew printed circuit board.
 
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
 
Read a Pcbnew s-expression formatted LINE_READER object and returns the appropriate BOARD_ITEM object...
 
A #PLUGIN derivation for saving and loading Pcbnew s-expression formatted files.
 
void FootprintSave(const wxString &aLibraryPath, const FOOTPRINT *aFootprint, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aFootprint to an existing library located at aLibraryPath.
 
void SaveBoard(const wxString &aFileName, BOARD *aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
 
LINE_READER that wraps a given std::istream instance.
 
void SetStream(std::istream &aStream)
Set the stream for this line reader.
 
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
 
std::unique_ptr< ITEM > ReadItemFromStream(std::istream &aStream)
Read a specific kind of BOARD_ITEM from a stream.
 
std::unique_ptr< BOARD > ReadBoardFromFileOrStream(const std::string &aFilename, std::istream &aFallback)
Read a board from a file, or another stream, as appropriate.
 
std::unique_ptr< FOOTPRINT > ReadFootprintFromFileOrStream(const std::string &aFilename, std::istream &aFallback)
 
void DumpBoardToFile(BOARD &board, const std::string &aFilename)
Utility function to simply write a Board out to a file.
 
void DumpFootprintToFile(const FOOTPRINT &aFootprint, const std::string &aLibraryPath)
Same as DumpBoardToFile, but for footprints.
 
std::unique_ptr< BOARD_ITEM > ReadBoardItemFromStream(std::istream &aStream)
Utility function to read a BOARD_ITEM (probably a FOOTPRINT or a BOARD) from a file.
 
Pcbnew s-expression file format parser definition.