KiCad PCB EDA Suite
|
Go to the source code of this file.
Typedefs | |
typedef boost::property_tree::ptree | PTREE |
typedef const PTREE | CPTREE |
typedef boost::property_tree::ptree_error | PTREE_ERROR |
Functions | |
void | Scan (PTREE *aTree, DSNLEXER *aLexer) |
Fill an empty PTREE with information from a KiCad s-expression stream. | |
void | Format (OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree) |
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative. | |
typedef boost::property_tree::ptree_error PTREE_ERROR |
void Format | ( | OUTPUTFORMATTER * | out, |
int | aNestLevel, | ||
int | aCtl, | ||
const CPTREE & | aTree | ||
) |
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition at line 200 of file ptree.cpp.
References formatNode().
Referenced by LIB_ID::GetUniStringLibId(), CADSTAR_ARCHIVE_PARSER::HEADER::Parse(), SYMBOL_EDIT_FRAME::UpdateTitle(), and DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem().
Fill an empty PTREE with information from a KiCad s-expression stream.
Use a DSNLEXER with an empty keyword table as aLexer. Useful for parsing s-expression files or strings of arbitrary grammars, say from a file or clipboard. The s-expression must be "KiCad compatible". See Documentation/s-expressions.txt for this KiCad compatible definition (it is the non-specctra mode). And also see in tools/property_tree.cpp for example usage.
FILE* fp = fopen( argv[1], "r" );
static const KEYWORD empty_keywords[1] = {};
DSNLEXER lexer( empty_keywords, 0, fp, wxString( From_UTF8( argv[1] ) ) );
try { PTREE doc; Scan( &doc, &lexer ); } catch( const IO_ERROR& ioe ) { fprintf( stderr, "%s\n", TO_UTF8( ioe.errorText ) ); }
Definition at line 86 of file ptree.cpp.
References DSNLEXER::CurTok(), DSN_EOF, DSN_LEFT, DSN_NONE, DSNLEXER::NextTok(), scanAtom(), scanList(), and DSNLEXER::Unexpected().
Referenced by SCH_EDITOR_CONTROL::AssignFootprints(), BACK_ANNOTATE::getPcbModulesFromString(), and scanList().