KiCad PCB EDA Suite
ptree.h File Reference
#include <boost/property_tree/ptree_fwd.hpp>
#include <richio.h>
#include <dsnlexer.h>

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. More...
 
void Format (OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
 Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative. More...
 

Typedef Documentation

◆ CPTREE

typedef const PTREE CPTREE

Definition at line 53 of file ptree.h.

◆ PTREE

typedef boost::property_tree::ptree PTREE

Definition at line 52 of file ptree.h.

◆ PTREE_ERROR

typedef boost::property_tree::ptree_error PTREE_ERROR

Definition at line 54 of file ptree.h.

Function Documentation

◆ Format()

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.

201 {
202  if( aTree.size() == 1 && !aTree.data().size() )
203  {
204  // The topmost node is basically only a container for the document root.
205  // It anchors the paths which traverse the tree deeper.
206  CITER it = aTree.begin();
207  formatNode( out, aNestLevel, aCtl, it->first, it->second );
208  }
209  else
210  {
211  // This is not expected, neither for sexpr nor xml.
212  formatNode( out, aNestLevel, aCtl, "", aTree );
213  }
214 }
static void formatNode(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const std::string &aKey, const CPTREE &aTree)
Definition: ptree.cpp:166
PTREE::const_iterator CITER
Definition: ptree.cpp:35

References formatNode().

Referenced by ACTION_MENU::AddClose(), WX_HTML_REPORT_BOX::addHeader(), WX_HTML_REPORT_PANEL::addHeader(), PROJECT_TREE_PANE::addItemToProjectTree(), GERBER_JOBFILE_WRITER::addJSONMaterialStackup(), SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), SYMBOL_TREE_MODEL_ADAPTER::AddLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), ACTION_MENU::AddQuitOrClose(), altium_layer_from_name(), APAD6::APAD6(), PCB_CONTROL::AppendBoard(), CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings(), HPGL_PLOTTER::Arc(), PROJECT_ARCHIVER::Archive(), KIID::AsLegacyTimestampString(), CVPCB_ASSOCIATION_TOOL::Associate(), CVPCB_MAINFRAME::AssociateFootprint(), AUTOPLACE_TOOL::autoplace(), AR_AUTOPLACER::AutoplaceFootprints(), SYMBOL_EDIT_FRAME::backupFile(), SETTINGS_MANAGER::BackupProject(), BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER(), FIELDS_GRID_TABLE< SCH_FIELD >::BoolFromString(), PIN_TABLE_DATA_MODEL::BoolFromString(), BOOST_AUTO_TEST_CASE(), PANEL_SYM_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), CONNECTION_GRAPH::buildConnectionGraph(), DS_DRAW_ITEM_LIST::BuildFullText(), EAGLE_PLUGIN::cacheLib(), PYTHON_ACTION_PLUGIN::CallMethod(), PYTHON_FOOTPRINT_WIZARD::CallMethod(), FOOTPRINT_EDIT_FRAME::canCloseWindow(), PL_EDITOR_FRAME::canCloseWindow(), PCB_EDIT_FRAME::canCloseWindow(), SCH_EDIT_FRAME::canCloseWindow(), SCH_EDIT_TOOL::ChangeTextType(), CADSTAR_PCB_ARCHIVE_LOADER::checkAndLogHatchCode(), PANEL_SETUP_LAYERS::CheckCopperLayerCount(), EDA_BASE_FRAME::CheckForAutoSaveFile(), BACK_ANNOTATE::checkForUnusedSymbols(), checkGlError(), EE_INSPECTION_TOOL::CheckSymbol(), DIALOG_IMAGE_EDITOR::CheckValues(), HPGL_PLOTTER::Circle(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), Collide(), collideSingleShapes(), DRC_RULE_CONDITION::Compile(), DRC_ENGINE::compileRules(), NETLIST_EXPORTER_PSPICE_SIM::ComponentToVector(), NUMBER_BADGE::computeSize(), ConfigBaseWriteDouble(), ConvertArcCenter(), DIALOG_BOARD_REANNOTATE::CoordTowxString(), ACTION_MENU::create(), createBoard(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), SYMBOL_EDIT_FRAME::CreateNewPart(), KICAD_MANAGER_FRAME::CreateNewProject(), DIALOG_ABOUT::createNotebookHtmlPage(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), CreateShapesSection(), SCH_SEXPR_PLUGIN::CreateSymbolLib(), SCH_LEGACY_PLUGIN::CreateSymbolLib(), CADSTAR_PCB_ARCHIVE_LOADER::createUniqueGroupID(), PROJECT_TREE_ITEM::Delete(), FOOTPRINT_EDIT_FRAME::DeleteFootprintFromLibrary(), SYMBOL_EDIT_FRAME::DeletePartFromLibrary(), SCH_SEXPR_PLUGIN_CACHE::DeleteSymbol(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), SCH_SEXPR_PLUGIN::DeleteSymbolLib(), SCH_LEGACY_PLUGIN::DeleteSymbolLib(), FABMASTER::detectType(), DIALOG_ABOUT::DIALOG_ABOUT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), KIGFX::PREVIEW::DimensionLabel(), SYMBOL_VIEWER_FRAME::DisplayLibInfos(), DIALOG_PAD_PROPERTIES::displayPrimitivesList(), CVPCB_MAINFRAME::DisplayStatus(), SYMBOL_PREVIEW_WIDGET::DisplaySymbol(), PCB_EDIT_FRAME::doCloseWindow(), SCH_FIELD::DoHypertextMenu(), doPrintFile(), EDA_3D_CANVAS::DoRePaint(), ACTION_TOOLBAR::doSelectAction(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarShape(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), DSNLEXER::Duplicate(), PCB_EDIT_FRAME::Edit_Zone_Params(), SCH_EDIT_TOOL::editFieldText(), PAD_TOOL::EnumeratePads(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckHierSheets(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), DRC_ENGINE::EvalRules(), DIALOG_SIM_SETTINGS::evaluateDCControls(), KICAD_MANAGER_CONTROL::Execute(), EXCELLON_IMAGE::Execute_EXCELLON_G_Command(), existsOnLayer(), DSNLEXER::Expecting(), FOOTPRINT_EDIT_FRAME::ExportFootprint(), DIALOG_EXPORT_SVG::ExportSVGFile(), PCB_EDIT_FRAME::ExportToGenCAD(), SYMBOL_EDITOR_CONTROL::ExportView(), FILE_LINE_READER::FILE_LINE_READER(), PCB_EDIT_FRAME::Files_io_from_id(), PNS::DIFF_PAIR_PLACER::FindDpPrimitivePair(), FP_LIB_TABLE::FindRow(), EXCELLON_IMAGE::FinishRouteCommand(), HPGL_PLOTTER::FlashPadCircle(), LIB_PART::Flatten(), GPCB_PLUGIN::FootprintDelete(), PCB_IO::FootprintDelete(), GPCB_PLUGIN::FootprintEnumerate(), PCB_IO::FootprintLibCreate(), GPCB_PLUGIN::FootprintLibDelete(), LEGACY_PLUGIN::FootprintLibDelete(), PCB_IO::FootprintLibDelete(), PCB_IO::FootprintSave(), FootprintWriteShape(), DS_DATA_MODEL_IO::Format(), NETLIST_EXPORTER_PSPICE::Format(), PCB_IO::format(), LIBEVAL::UOP::Format(), formatConstraint(), formatCoord(), DIALOG_NET_INSPECTOR::formatCount(), DIALOG_NET_INSPECTOR::formatNetCode(), PANEL_PREV_3D::formatOffsetValue(), HIERARCHY_NAVIG_DLG::formatPageString(), PANEL_PREV_3D::formatRotationValue(), PANEL_PREV_3D::formatScaleValue(), formatWildcardExt(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::FromSESSION(), GbrMakeProjectGUIDfromString(), FOOTPRINT_INFO_GENERATOR::GenerateHtml(), DIALOG_SPICE_MODEL::generatePowerSource(), PLACE_FILE_EXPORTER::GenPositionData(), CURSOR_STORE::Get(), SYMBOL_LIBRARY_MANAGER::GetBufferedPart(), GetBuildDate(), GetBuildVersion(), BACK_ANNOTATE::getChangeList(), FABMASTER::getColFromName(), TEMPLATE_FIELDNAME::GetDefaultFieldName(), SCH_SHEET::GetDefaultFieldName(), TOOL_ACTION::GetDescription(), EDA_BASE_FRAME::GetFileFromHistory(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), FOOTPRINT_LIST::GetFootprintInfo(), GetGerberProtelExtension(), BOARD_INSPECTION_TOOL::getItemDescription(), GetKeyName(), PCAD2KICAD::PCB::GetKiCadLayer(), GetKicadLockFilePath(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadNet(), CADSTAR_PCB_ARCHIVE_LOADER::getKiCadPad(), PCAD2KICAD::PCB::GetLayerNetNameRef(), PCAD2KICAD::PCB::GetLayerType(), SYMBOL_LIBRARY_MANAGER::getLibraryBuffer(), FOOTPRINT::GetLocalClearance(), PAD::GetLocalClearance(), CADSTAR_SCH_ARCHIVE_LOADER::getLocationOfNetElement(), GetMajorMinorVersion(), PCB_TEXT::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), PCB_GROUP::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), DIMENSION_BASE::GetMsgPanelInfo(), PCB_SHAPE::GetMsgPanelInfo(), SCH_COMPONENT::GetMsgPanelInfo(), FOOTPRINT::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), LEADER::GetMsgPanelInfo(), PAD::GetMsgPanelInfo(), DRC_CONSTRAINT::GetName(), ALTIUM_PCB::GetNetCode(), CADSTAR_SCH_ARCHIVE_LOADER::getNetName(), FOOTPRINT::GetNextPadName(), KIGFX::ACCELERATING_ZOOM_CONTROLLER::GetScaleForRotation(), KIGFX::CONSTANT_ZOOM_CONTROLLER::GetScaleForRotation(), DIALOG_PRINT_GENERIC::getScaleValue(), SCH_PIN::GetSelectMenuText(), LIB_CIRCLE::GetSelectMenuText(), LIB_RECTANGLE::GetSelectMenuText(), PCB_MARKER::GetSelectMenuText(), LIB_POLYLINE::GetSelectMenuText(), LIB_TEXT::GetSelectMenuText(), LIB_ARC::GetSelectMenuText(), PCB_TEXT::GetSelectMenuText(), DS_DRAW_ITEM_LINE::GetSelectMenuText(), FP_SHAPE::GetSelectMenuText(), PCB_GROUP::GetSelectMenuText(), DS_DRAW_ITEM_POLYPOLYGONS::GetSelectMenuText(), SCH_FIELD::GetSelectMenuText(), LIB_FIELD::GetSelectMenuText(), SCH_SHEET_PIN::GetSelectMenuText(), TRACK::GetSelectMenuText(), FP_TEXT::GetSelectMenuText(), SCH_LINE::GetSelectMenuText(), DS_DRAW_ITEM_RECT::GetSelectMenuText(), DIMENSION_BASE::GetSelectMenuText(), GERBER_DRAW_ITEM::GetSelectMenuText(), LIB_PIN::GetSelectMenuText(), SCH_TEXT::GetSelectMenuText(), DS_DRAW_ITEM_TEXT::GetSelectMenuText(), PCB_SHAPE::GetSelectMenuText(), SCH_LABEL::GetSelectMenuText(), VIA::GetSelectMenuText(), SCH_GLOBALLABEL::GetSelectMenuText(), SCH_HIERLABEL::GetSelectMenuText(), FOOTPRINT::GetSelectMenuText(), SCH_SHEET::GetSelectMenuText(), BOARD::GetSelectMenuText(), PAD::GetSelectMenuText(), SCH_COMPONENT::GetSelectMenuText(), ZONE::GetSelectMenuText(), GetSemanticVersion(), NETLIST_EXPORTER_PSPICE_SIM::GetSheetSimCommand(), SYMBOL_LIBRARY_MANAGER::GetUniqueLibraryName(), FIELDS_EDITOR_GRID_DATA_MODEL::GetValue(), AM_PARAM::GetValue(), FP_TEXT_GRID_TABLE::GetValueAsBool(), FIELDS_GRID_TABLE< SCH_FIELD >::GetValueAsBool(), FP_TEXT_GRID_TABLE::GetValueAsLong(), DIMENSION_BASE::GetValueText(), GERBVIEW_FRAME::GetVisibleElementColor(), EDA_DRAW_FRAME::GetZoomLevelIndicator(), ALTIUM_PCB::HelperCreateAndAddDrawsegment(), ALTIUM_PCB::HelperParseDimensions6Center(), ALTIUM_PCB::HelperParseDimensions6Datum(), ALTIUM_PCB::HelperParseDimensions6Leader(), ALTIUM_PCB::HelperParseDimensions6Linear(), ALTIUM_PCB::HelperParsePad6NonCopper(), IFSTREAM_LINE_READER::IFSTREAM_LINE_READER(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDIT_FRAME::ImportFootprint(), SCH_EDITOR_CONTROL::ImportFPAssignments(), KICAD_MANAGER_FRAME::ImportNonKiCadProject(), PANEL_SETUP_FORMATTING::ImportSettingsFrom(), FOOTPRINT_FILTER::ITERATOR::increment(), FOOTPRINT::IncrementReference(), LAYERS_MAP_DIALOG::initDialog(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), DRC_ENGINE::InitEngine(), DIALOG_FOOTPRINT_WIZARD_LIST::initLists(), PGM_BASE::InitPgm(), CADSTAR_ARCHIVE_PARSER::InsertAttributeAtEnd(), insideArea(), insideCourtyard(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), io_benchmark_func(), GERBVIEW_FRAME::IsElementVisible(), PNS::ROUTER::isStartingPointRoutable(), kiCadComponentRotation(), KIWAY::KiFACE(), LayerName(), LIBEVAL::COMPILER::lexDefault(), CADSTAR_PCB_ARCHIVE_LOADER::Load(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), SCH_EAGLE_PLUGIN::Load(), FP_CACHE::Load(), EAGLE_PLUGIN::Load(), GPCB_FPL_CACHE::Load(), IO_MGR::Load(), SCH_SEXPR_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::Load(), PART_LIBS::LoadAllLibraries(), PCB_TEST_FRAME_BASE::LoadAndDisplayBoard(), CADSTAR_ARCHIVE_PARSER::LoadArchiveFile(), CADSTAR_PCB_ARCHIVE_LOADER::loadAreas(), loadBoard(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoards(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets(), CADSTAR_PCB_ARCHIVE_LOADER::loadComponents(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), SCH_LEGACY_PLUGIN_CACHE::loadDocs(), CADSTAR_SCH_ARCHIVE_LOADER::loadDocumentationSymbols(), CADSTAR_PCB_ARCHIVE_LOADER::loadDocumentationSymbols(), EAGLE_PLUGIN::loadElements(), FABMASTER::loadEtch(), GERBVIEW_FRAME::LoadExcellonFiles(), CADSTAR_PCB_ARCHIVE_LOADER::loadFigures(), LEGACY_PLUGIN::loadFOOTPRINT(), FABMASTER::loadFootprints(), FP_LIB_TABLE::LoadGlobalTable(), SYMBOL_LIB_TABLE::LoadGlobalTable(), CADSTAR_PCB_ARCHIVE_LOADER::loadGroups(), DRC_ENGINE::loadImplicitRules(), SCH_EAGLE_PLUGIN::loadInstance(), EAGLE_PLUGIN::loadLibrary(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryAreas(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryCoppers(), CADSTAR_PCB_ARCHIVE_LOADER::loadLibraryFigures(), GERBVIEW_FRAME::LoadListOfGerberAndDrillFiles(), CADSTAR_SCH_ARCHIVE_LOADER::loadNets(), CADSTAR_PCB_ARCHIVE_LOADER::loadNets(), CADSTAR_PCB_ARCHIVE_LOADER::loadNetVia(), CADSTAR_SCH_ARCHIVE_LOADER::loadPartsLibrary(), SCH_EAGLE_PLUGIN::loadPin(), EAGLE_PLUGIN::loadPlain(), EAGLE_PLUGIN::loadPolygon(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances(), SCH_EAGLE_PLUGIN::loadSheet(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheetAndChildSheets(), SCH_EDIT_FRAME::LoadSheetFromFile(), CADSTAR_SCH_ARCHIVE_LOADER::loadSheets(), SCH_EAGLE_PLUGIN::loadSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary(), CADSTAR_PCB_ARCHIVE_LOADER::loadTemplates(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupMessage(), CADSTAR_PCB_ARCHIVE_LOADER::logBoardStackupWarning(), DIALOG_BOARD_REANNOTATE::LogChangePlan(), DIALOG_BOARD_REANNOTATE::LogFootprints(), DIALOG_BOARD_REANNOTATE::MakeSampleText(), DSN::SPECCTRA_DB::makeTRACK(), DSN::SPECCTRA_DB::makeVIA(), PCAD2KICAD::PCB::MapLayer(), memberOf(), SIM_PLOT_FRAME::menuSaveCsv(), HTML_MESSAGE_BOX::MessageSet(), PROJECT_FILE::MigrateFromLegacy(), BOARD_ITEM::Move(), DSNLEXER::NeedNUMBER(), SIM_PLOT_FRAME::NewPlotPanel(), NormalizePath(), not_implemented(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_PROPERTIES::On3DModelCellChanged(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_PROPERTIES::OnAdd3DModel(), PANEL_SETUP_BOARD_STACKUP::onAddDielectricLayer(), DIALOG_FIELDS_EDITOR_GLOBAL::OnAddField(), DIALOG_BOM::OnAddGenerator(), DIALOG_NET_INSPECTOR::onAddNet(), DIALOG_SCHEMATIC_SETUP::OnAuxiliaryAction(), DIALOG_BOARD_SETUP::OnAuxiliaryAction(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), PNS::SHOVE::onCollidingArc(), PNS::SHOVE::onCollidingSegment(), PANEL_SETUP_RULES::OnCompile(), DIALOG_PAD_PROPERTIES::onCornerRadiusChange(), DIALOG_SHEET_PROPERTIES::OnDeleteField(), DIALOG_SYMBOL_PROPERTIES::OnDeleteField(), DIALOG_LIB_SYMBOL_PROPERTIES::OnDeleteField(), PROJECT_TREE_PANE::onDeleteFile(), DIALOG_NET_INSPECTOR::onDeleteNet(), DIALOG_DRC::OnDRCItemRClick(), DIALOG_ERC::OnERCItemRClick(), DIALOG_EXPORT_STEP::onExportButton(), PCB_EDIT_FRAME::OnExportIDF3(), PCB_EDIT_FRAME::OnExportVRML(), DIALOG_CONFIGURE_PATHS::OnGridCellChanging(), DIALOG_SYMBOL_PROPERTIES::OnGridCellChanging(), DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging(), KICAD_MANAGER_FRAME::OnIdle(), SCH_EDIT_FRAME::OnImportProject(), FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList(), KIGFX::WX_VIEW_CONTROLS::onMotion(), EDA_3D_CANVAS::OnMouseMove(), APPEARANCE_CONTROLS::OnNetGridRightClick(), DIALOG_PAD_PROPERTIES::OnPadShapeSelection(), NUMBER_BADGE::onPaint(), LIB_TREE::onPreselect(), PANEL_SETUP_BOARD_STACKUP::onRemoveDielectricLayer(), PROJECT_TREE_PANE::onRenameFile(), DIALOG_NET_INSPECTOR::onRenameNet(), DIALOG_ERC::OnRunERCClick(), DIALOG_ERC::OnSaveReport(), DIALOG_DRC::OnSaveReport(), TERMINATE_HANDLER::OnTerminate(), PCB_CALCULATOR_FRAME::OnTWResetButtonClick(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SYMBOL_VIEWER_FRAME::onUpdateUnitChoice(), DIALOG_PAGES_SETTINGS::OnWksFileSelection(), PL_EDITOR_FRAME::OpenProjectFiles(), BM2CMP_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), EDA_ITEM::operator<(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageText(), EAGLE_PLUGIN::packageWire(), PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP(), PCAD2KICAD::PCB_VIA::Parse(), PCAD2KICAD::PCB_PAD::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Parse(), FP_LIB_TABLE::Parse(), SCH_ALTIUM_PLUGIN::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Parse(), ALTIUM_PCB::Parse(), SYMBOL_LIB_TABLE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Parse(), CADSTAR_ARCHIVE_PARSER::TIMESTAMP::Parse(), CADSTAR_ARCHIVE_PARSER::HEADER::Parse(), CADSTAR_ARCHIVE_PARSER::LINECODE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::Parse(), CADSTAR_ARCHIVE_PARSER::HATCHCODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::PADCODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::VIACODE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::LAYERPAIR::Parse(), KICAD_NETLIST_PARSER::Parse(), CADSTAR_ARCHIVE_PARSER::EVALUE::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_AREA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::COMPONENT_PAD::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::Parse(), CADSTAR_ARCHIVE_PARSER::CADSTAR_NETCLASS::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_BOARD::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse(), CADSTAR_ARCHIVE_PARSER::FIGURE::Parse(), CADSTAR_ARCHIVE_PARSER::ParseAllChildPoints(), ParseAltiumPcb(), SCH_ALTIUM_PLUGIN::ParseAltiumSch(), SCH_ALTIUM_PLUGIN::ParseArc(), PCB_PARSER::parseARC(), ALTIUM_PCB::ParseArcs6Data(), SCH_ALTIUM_PLUGIN::ParseBezier(), PCB_PARSER::parseBOARD_unchecked(), ALTIUM_PCB::ParseClasses6Data(), SCH_ALTIUM_PLUGIN::ParseComponent(), ALTIUM_PCB::ParseComponentsBodies6Data(), DRC_RULES_PARSER::parseConstraint(), SCH_ALTIUM_PLUGIN::ParseDesignator(), ALTIUM_PCB::ParseDimensions6Data(), DRC_RULES_PARSER::parseDRC_RULE(), SCH_ALTIUM_PLUGIN::ParseFileName(), ALTIUM_PCB::ParseFills6Data(), PCB_PARSER::parseFP_TEXT(), parseInt(), SCH_ALTIUM_PLUGIN::ParseLabel(), DRC_RULES_PARSER::parseLayer(), PCB_PARSER::parseLayers(), SCH_ALTIUM_PLUGIN::ParseLine(), ALTIUM_PCB::ParseModelsData(), PCB_PARSER::parsePAD(), ALTIUM_PCB::ParsePads6Data(), SCH_ALTIUM_PLUGIN::ParsePin(), SCH_ALTIUM_PLUGIN::ParsePolygon(), ALTIUM_PCB::ParsePolygons6Data(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), ALTIUM_PCB::ParseRegions6Data(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), ALTIUM_PCB::ParseShapeBasedRegions6Data(), SCH_ALTIUM_PLUGIN::ParseSheetEntry(), SCH_ALTIUM_PLUGIN::ParseSheetName(), CADSTAR_ARCHIVE_PARSER::ParseTextFields(), ALTIUM_PCB::ParseTexts6Data(), PCB_PARSER::parseTRACK(), ALTIUM_PCB::ParseTracks6Data(), DRC_RULES_PARSER::parseValueWithUnits(), PCB_PARSER::parseVIA(), ALTIUM_PCB::ParseVias6Data(), PCB_PARSER::parseZONE(), SCH_EDITOR_CONTROL::Paste(), HPGL_PLOTTER::PenTo(), DIALOG_BOM::pluginInit(), DIALOG_CHOOSE_SYMBOL::PopulateFootprintSelector(), DIALOG_RESCUE_EACH::PopulateInstanceList(), KICAD_MANAGER_FRAME::PrintPrjInfo(), FOOTPRINT_WIZARD_FRAME::Process_Special_Functions(), FABMASTER::processCustomPads(), FABMASTER::processFootprints(), FABMASTER::processGeometry(), FABMASTER::processLayers(), FABMASTER::processNets(), FABMASTER::processPadStackLayers(), FABMASTER::processPadStacks(), FABMASTER::processPins(), FABMASTER::processScaleFactor(), FABMASTER::processSimpleLayers(), FABMASTER::processText(), FABMASTER::processTraces(), FABMASTER::processVias(), ALTIUM_PARSER::PropertiesReadKicadUnit(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), SCH_EDIT_FRAME::PutDataInPreviousState(), LP_CACHE::ReadAndVerifyHeader(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), CVPCB_MAINFRAME::ReadSchematicNetlist(), EXCELLON_IMAGE::readToolInformation(), DIALOG_BOARD_REANNOTATE::ReannotateBoard(), NET_SELECTOR_COMBOPOPUP::rebuildList(), APPEARANCE_CONTROLS::rebuildNets(), SYMBOL_EDIT_FRAME::RebuildSymbolUnitsList(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), DIALOG_INSPECTOR::ReCreateDesignList(), HPGL_PLOTTER::Rect(), DIALOG_PLOT::reInitDialog(), RENDER_3D_RAYTRACE::Reload(), RENDER_3D_LEGACY::reload(), FP_CACHE::Remove(), GPCB_FPL_CACHE::Remove(), RENDER_3D_RAYTRACE::render(), RENDER_3D_RAYTRACE::renderTracing(), BOARD_EDITOR_CONTROL::RepairBoard(), ReplaceIllegalFileNameChars(), BOARD_INSPECTION_TOOL::reportClearance(), DRC_RULES_PARSER::reportError(), DRC_TEST_PROVIDER::reportRuleStatistics(), DRC_ENGINE::ReportViolation(), BOARD_INSPECTION_TOOL::reportZoneConnection(), WIDGET_HOTKEY_LIST::resolveKeyConflicts(), SCH_SHEET::ResolveTextVar(), SCH_GLOBALLABEL::ResolveTextVar(), WIDGET_SAVE_RESTORE::RestoreConfigToControls(), SYMBOL_EDIT_FRAME::Revert(), FOOTPRINT_EDIT_FRAME::RevertFootprint(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), TOOL_MANAGER::RunAction(), runDRCProto(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), DRC_ENGINE::RunTests(), SCH_SEXPR_PLUGIN::Save(), FP_CACHE::Save(), SYMBOL_EDIT_FRAME::Save(), PCB_IO::Save(), IO_MGR::Save(), PART_LIB::Save(), PCB_BASE_EDIT_FRAME::SaveCopyInUndoList(), SCH_EDIT_FRAME::SaveCopyInUndoList(), BITMAP_BASE::SaveData(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), SYMBOL_LIBRARY_MANAGER::SaveLibrary(), SYMBOL_EDIT_FRAME::saveLibrary(), FOOTPRINT_EDIT_FRAME::SaveLibraryAs(), SYMBOL_EDIT_FRAME::savePartAs(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), ROUTER_TOOL::saveRouterDebugLog(), SIM_PLOT_FRAME::saveWorkbook(), SchGetLibPart(), SCH_MARKER::Serialize(), PCB_MARKER::Serialize(), GERBVIEW_FRAME::SetElementVisibility(), FOOTPRINT_INFO_GENERATOR::SetHtmlAliasOf(), FOOTPRINT_INFO_GENERATOR::SetHtmlDesc(), FOOTPRINT_INFO_GENERATOR::SetHtmlKeywords(), KIWAY::SetLanguage(), DIALOG_PRINT_GENERIC::setScaleValue(), ZONE_SETTINGS::SetupLayersList(), FP_TEXT_GRID_TABLE::SetValue(), FIELDS_GRID_TABLE< SCH_FIELD >::SetValue(), FP_TEXT_GRID_TABLE::SetValueAsBool(), FIELDS_GRID_TABLE< SCH_FIELD >::SetValueAsBool(), FP_TEXT_GRID_TABLE::SetValueAsLong(), GERBVIEW_FRAME::SetVisibleElementColor(), PNS::SHOVE::ShoveLines(), PNS::SHOVE::ShoveObstacleLine(), RC_ITEM::ShowCoord(), DIALOG_CHOOSE_SYMBOL::ShowFootprintFor(), COMMON_CONTROL::ShowHelp(), DIALOG_IMPORT_GFX::showPCBdefaultLineWidth(), DIALOG_IMPORT_GFX::showPcbImportOffsets(), RC_ITEM::ShowReport(), SCH_IO_MGR::ShowType(), IO_MGR::ShowType(), StringFromValue(), SCH_BITMAP::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_SHEET::SwapData(), SYMBOL_EDIT_FRAME::SyncLibraries(), PNS_KICAD_IFACE_BASE::syncZone(), PANEL_SETUP_LAYERS::testLayerNames(), ERC_TESTER::TestMultUnitPinConflicts(), ERC_TESTER::TestPinToPin(), SPICE_VALUE::ToString(), TRACE_DESC::TRACE_DESC(), DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow(), DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow(), DIALOG_SCH_IMPORT_SETTINGS::TransferDataFromWindow(), DIALOG_IMPORT_SETTINGS::TransferDataFromWindow(), DIALOG_GENCAD_EXPORT_OPTIONS::TransferDataFromWindow(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_SIM_SETTINGS::TransferDataFromWindow(), DIALOG_PIN_PROPERTIES::TransferDataFromWindow(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), DIALOG_EXPORT_IDF3::TransferDataFromWindow(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_GRID_SETTINGS::TransferDataToWindow(), PANEL_SETUP_FORMATTING::TransferDataToWindow(), DIALOG_PNS_LENGTH_TUNING_SETTINGS::TransferDataToWindow(), TRANSLINE_IDENT::TRANSLINE_IDENT(), PCB_CALCULATOR_FRAME::TranslineTypeSelection(), DSNLEXER::Unexpected(), GL_CONTEXT_MANAGER::UnlockCtx(), HIGHLIGHT_MENU::update(), FOOTPRINT_VIEWER_FRAME::Update3DView(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), DIALOG_BOARD_STATISTICS::updateDrillGrid(), BM2CMP_FRAME::updateImageInfo(), DIALOG_PAD_PROPERTIES::UpdateLayersDropdown(), PCB_CONTROL::UpdateMessagePanel(), SCH_EDIT_FRAME::UpdateNetHighlightStatus(), SIM_PLOT_FRAME::updatePlot(), DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues(), FOOTPRINT_EDIT_FRAME::UpdateTitle(), SYMBOL_EDIT_FRAME::updateTitle(), PCB_EDIT_FRAME::UpdateTitle(), CONSOLE_PROGRESS_REPORTER::updateUI(), DIALOG_BOARD_STATISTICS::updateWidets(), EDA_DRAW_FRAME::UpdateZoomSelectBox(), UNIT_BINDER::Validate(), REGEX_VALIDATOR::Validate(), SPICE_VALIDATOR::Validate(), validateAxisOptions(), PANEL_SYM_LIB_TABLE::verifyTables(), PANEL_FP_LIB_TABLE::verifyTables(), walkaround2(), FOOTPRINT_LIST_IMPL::WriteCacheToFile(), WriteHotKeyConfig(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_ERC::writeReport(), and ZOOM_MENU::ZOOM_MENU().

◆ Scan()

void Scan ( PTREE aTree,
DSNLEXER aLexer 
)

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.

87 {
88  int tok = aLexer->CurTok();
89 
90  // conditionally read first token.
91  if( tok == DSN_NONE )
92  tok = aLexer->NextTok();
93 
94  if( tok == DSN_EOF )
95  {
96  aLexer->Unexpected( DSN_EOF );
97  }
98 
99  if( tok == DSN_LEFT )
100  {
101  scanList( aTree, aLexer );
102  }
103  else
104  {
105  scanAtom( aTree, aLexer );
106  }
107 }
void scanList(PTREE *aTree, DSNLEXER *aLexer)
Function scanList reads a sexpr list from the input stream into a new node with key aLexer->CurText()...
Definition: ptree.cpp:55
void scanAtom(PTREE *aTree, const DSNLEXER *aLexer)
Definition: ptree.cpp:78
int CurTok() const
Return whatever NextTok() returned the last time it was called.
Definition: dsnlexer.h:230
int NextTok()
Return the next token found in the input file or DSN_EOF when reaching the end of file.
Definition: dsnlexer.cpp:508
void Unexpected(int aTok) const
Throw an IO_ERROR exception with an input file specific error message.
Definition: dsnlexer.cpp:337

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().