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_EDIT_FRAME::AddLibraryFile(), ACTION_MENU::AddQuitOrClose(), AltiumSpecialStringsToKiCadVariables(), 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(), BOOST_FIXTURE_TEST_CASE(), PANEL_SYM_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), CONNECTION_GRAPH::buildConnectionGraph(), DS_DRAW_ITEM_LIST::BuildFullText(), PNS::buildHullForPrimitiveShape(), PNS_LOG_VIEWER_FRAME::buildListTree(), EAGLE_PLUGIN::cacheLib(), PYTHON_ACTION_PLUGIN::CallMethod(), PYTHON_FOOTPRINT_WIZARD::CallMethod(), FOOTPRINT_EDIT_FRAME::canCloseWindow(), PL_EDITOR_FRAME::canCloseWindow(), SIM_PLOT_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(), PANEL_SETUP_BOARD_STACKUP::createBmComboBox(), createBoard(), BOARD_ADAPTER::createLayers(), PCB_BASE_EDIT_FRAME::createNewLibrary(), KICAD_MANAGER_FRAME::CreateNewProject(), SYMBOL_EDIT_FRAME::CreateNewSymbol(), 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(), SCH_SEXPR_PLUGIN_CACHE::DeleteSymbol(), SCH_LEGACY_PLUGIN_CACHE::DeleteSymbol(), SYMBOL_EDIT_FRAME::DeleteSymbolFromLibrary(), SCH_SEXPR_PLUGIN::DeleteSymbolLib(), SCH_LEGACY_PLUGIN::DeleteSymbolLib(), 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_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), KIGFX::PREVIEW::DimensionLabel(), DIALOG_PAD_PROPERTIES::displayPrimitivesList(), CVPCB_MAINFRAME::DisplayStatus(), 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(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawBoardCharacteristics(), CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarShape(), SCH_DRAWING_TOOLS::DrawSheet(), EDIT_TOOL::Duplicate(), DSNLEXER::Duplicate(), PCB_EDIT_FRAME::Edit_Zone_Params(), PAD_TOOL::EnumeratePads(), CONNECTION_GRAPH::ercCheckBusToBusEntryConflicts(), CONNECTION_GRAPH::ercCheckHierSheets(), CONNECTION_GRAPH::ercCheckMultipleDrivers(), DRC_ENGINE::EvalRules(), DIALOG_SIM_SETTINGS::evaluateDCControls(), LIBEVAL::UOP::Exec(), 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_SYMBOL::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_PREVIEW_3D_MODEL::formatOffsetValue(), HIERARCHY_NAVIG_DLG::formatPageString(), PANEL_PREVIEW_3D_MODEL::formatRotationValue(), PANEL_PREVIEW_3D_MODEL::formatScaleValue(), formatWildcardExt(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::FromSESSION(), GbrMakeProjectGUIDfromString(), WX_HTML_REPORT_BOX::generateHtml(), DIALOG_SPICE_MODEL::generatePowerSource(), PLACE_FILE_EXPORTER::GenPositionData(), CURSOR_STORE::Get(), SYMBOL_LIBRARY_MANAGER::GetBufferedSymbol(), 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_TRACK::GetMsgPanelInfo(), PCB_GROUP::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_SHAPE::GetMsgPanelInfo(), SCH_SYMBOL::GetMsgPanelInfo(), PCB_VIA::GetMsgPanelInfo(), FOOTPRINT::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PAD::GetMsgPanelInfo(), DRC_CONSTRAINT::GetName(), ALTIUM_PCB::GetNetCode(), CADSTAR_SCH_ARCHIVE_LOADER::getNetName(), FOOTPRINT::GetNextPadName(), PNS::MOUSE_TRAIL_TRACER::GetPosture(), 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(), LIB_FIELD::GetSelectMenuText(), SCH_SHEET_PIN::GetSelectMenuText(), SCH_FIELD::GetSelectMenuText(), DS_DRAW_ITEM_POLYPOLYGONS::GetSelectMenuText(), PCB_GROUP::GetSelectMenuText(), PCB_TRACK::GetSelectMenuText(), SCH_LINE::GetSelectMenuText(), FP_TEXT::GetSelectMenuText(), LIB_PIN::GetSelectMenuText(), DS_DRAW_ITEM_RECT::GetSelectMenuText(), SCH_TEXT::GetSelectMenuText(), GERBER_DRAW_ITEM::GetSelectMenuText(), PCB_DIMENSION_BASE::GetSelectMenuText(), SCH_LABEL::GetSelectMenuText(), PCB_SHAPE::GetSelectMenuText(), DS_DRAW_ITEM_TEXT::GetSelectMenuText(), SCH_SHEET::GetSelectMenuText(), SCH_GLOBALLABEL::GetSelectMenuText(), PCB_VIA::GetSelectMenuText(), SCH_HIERLABEL::GetSelectMenuText(), BOARD::GetSelectMenuText(), FOOTPRINT::GetSelectMenuText(), PAD::GetSelectMenuText(), SCH_SYMBOL::GetSelectMenuText(), ZONE::GetSelectMenuText(), GetSemanticVersion(), NGSPICE::GetSettingCommands(), 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(), PCB_DIMENSION_BASE::GetValueText(), GERBVIEW_FRAME::GetVisibleElementColor(), EDA_DRAW_FRAME::GetZoomLevelIndicator(), ALTIUM_PCB::HelperCreateAndAddDrawsegment(), 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(), inDiffPair(), LAYERS_MAP_DIALOG::initDialog(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), DRC_ENGINE::InitEngine(), DIALOG_FOOTPRINT_WIZARD_LIST::initLists(), PCB_CALCULATOR_FRAME::initTrackWidthPanel(), DIALOG_ANNOTATE::InitValues(), CADSTAR_ARCHIVE_PARSER::InsertAttributeAtEnd(), insideArea(), insideBackCourtyard(), insideCourtyard(), insideFrontCourtyard(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_INSPECTION_TOOL::InspectDRCError(), io_benchmark_func(), GERBVIEW_FRAME::IsElementVisible(), PNS::ROUTER::isStartingPointRoutable(), kiCadComponentRotation(), KIWAY::KiFACE(), LayerName(), LIBEVAL::COMPILER::lexDefault(), FABMASTER_PLUGIN::Load(), CADSTAR_PCB_ARCHIVE_LOADER::Load(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), LEGACY_PLUGIN::Load(), SCH_EAGLE_PLUGIN::Load(), FP_CACHE::Load(), EAGLE_PLUGIN::Load(), GPCB_FPL_CACHE::Load(), PCB_IO::Load(), IO_MGR::Load(), SCH_SEXPR_PLUGIN_CACHE::Load(), SCH_LEGACY_PLUGIN_CACHE::Load(), RENDER_3D_LEGACY::load3dModels(), SYMBOL_LIBS::LoadAllLibraries(), CADSTAR_ARCHIVE_PARSER::LoadArchiveFile(), CADSTAR_PCB_ARCHIVE_LOADER::loadAreas(), 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(), GERBVIEW_FRAME::LoadExcellonFiles(), CADSTAR_PCB_ARCHIVE_LOADER::loadFigures(), SCH_SEXPR_PLUGIN::loadFile(), SCH_LEGACY_PLUGIN::loadFile(), LEGACY_PLUGIN::loadFOOTPRINT(), FABMASTER::loadFootprints(), SYMBOL_LIB_TABLE::LoadGlobalTable(), FP_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_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(), PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel(), PANEL_SETUP_BOARD_STACKUP::onAddDielectricLayer(), DIALOG_SYMBOL_FIELDS_TABLE::OnAddField(), DIALOG_BOM::OnAddGenerator(), DIALOG_NET_INSPECTOR::onAddNet(), PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness(), DIALOG_SCHEMATIC_SETUP::OnAuxiliaryAction(), DIALOG_BOARD_SETUP::OnAuxiliaryAction(), DIALOG_EDIT_SYMBOLS_LIBID::onClickOrphansButton(), PNS::SHOVE::onCollidingArc(), PNS::SHOVE::onCollidingSegment(), PANEL_SETUP_BOARD_STACKUP::onColorSelected(), PANEL_SETUP_RULES::OnCompile(), DIALOG_PAD_PROPERTIES::onCornerRadiusChange(), DIALOG_LIB_SYMBOL_PROPERTIES::OnDeleteField(), DIALOG_SHEET_PROPERTIES::OnDeleteField(), DIALOG_SYMBOL_PROPERTIES::OnDeleteField(), 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_LIB_SYMBOL_PROPERTIES::OnGridCellChanging(), DIALOG_SYMBOL_PROPERTIES::OnGridCellChanging(), KICAD_MANAGER_FRAME::OnIdle(), FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList(), KIGFX::WX_VIEW_CONTROLS::onMotion(), EDA_3D_CANVAS::OnMouseMove(), APPEARANCE_CONTROLS::OnNetGridRightClick(), DIALOG_PAD_PROPERTIES::OnPadShapeSelection(), PAGED_DIALOG::OnPageChange(), 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(), DIALOG_SHEET_PROPERTIES::onSheetFilenameChanged(), TERMINATE_HANDLER::OnTerminate(), PCB_CALCULATOR_FRAME::OnTWResetButtonClick(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SYMBOL_VIEWER_FRAME::onUpdateUnitChoice(), PCB_CALCULATOR_FRAME::OnViaResetButtonClick(), DIALOG_PAGES_SETTINGS::OnWksFileSelection(), PL_EDITOR_FRAME::OpenProjectFiles(), BM2CMP_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), EDA_ITEM::operator<(), PNS::LINE_PLACER::optimizeTailHeadTransition(), EAGLE_PLUGIN::packageCircle(), EAGLE_PLUGIN::packagePolygon(), EAGLE_PLUGIN::packageRectangle(), EAGLE_PLUGIN::packageText(), EAGLE_PLUGIN::packageWire(), PCAD2KICAD::PCB_PAD::Parse(), PCAD2KICAD::PCB_VIA::Parse(), CADSTAR_PCB_ARCHIVE_PARSER::MATERIAL::Parse(), FP_LIB_TABLE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINALCODE::Parse(), SYMBOL_LIB_TABLE::Parse(), ALTIUM_PCB::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(), KICAD_NETLIST_PARSER::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(), 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(), SCH_ALTIUM_PLUGIN::ParseAltiumSch(), SCH_ALTIUM_PLUGIN::ParseArc(), PCB_PARSER::parseARC(), 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(), DRC_RULES_PARSER::parseDRC_RULE(), SCH_ALTIUM_PLUGIN::ParseFileHeader(), SCH_ALTIUM_PLUGIN::ParseFileName(), PCB_PARSER::parseFP_TEXT(), SCH_ALTIUM_PLUGIN::ParseImage(), SCH_ALTIUM_PLUGIN::ParseImplementation(), parseInt(), SCH_ALTIUM_PLUGIN::ParseLabel(), DRC_RULES_PARSER::parseLayer(), PCB_PARSER::parseLayers(), SCH_ALTIUM_PLUGIN::ParseLine(), ALTIUM_PCB::ParseModelsData(), ALTIUM_PCB::ParsePads6Data(), PCB_PARSER::parsePCB_TRACK(), PCB_PARSER::parsePCB_VIA(), SCH_ALTIUM_PLUGIN::ParsePin(), SCH_ALTIUM_PLUGIN::ParsePolygon(), SCH_ALTIUM_PLUGIN::ParsePolyline(), SCH_ALTIUM_PLUGIN::ParsePort(), SCH_ALTIUM_PLUGIN::ParsePowerPort(), SCH_ALTIUM_PLUGIN::ParseRectangle(), ALTIUM_PCB::ParseRegions6Data(), SCH_ALTIUM_PLUGIN::ParseRoundRectangle(), SCH_ALTIUM_PLUGIN::ParseSheetEntry(), SCH_ALTIUM_PLUGIN::ParseSheetName(), SCH_ALTIUM_PLUGIN::ParseStorage(), CADSTAR_ARCHIVE_PARSER::ParseTextFields(), ALTIUM_PCB::ParseTexts6Data(), DRC_RULES_PARSER::parseValueWithUnits(), PCB_PARSER::parseZONE(), SCH_EDITOR_CONTROL::Paste(), HPGL_PLOTTER::PenTo(), DIALOG_BOM::pluginInit(), DIALOG_RESCUE_EACH::PopulateInstanceList(), KICAD_MANAGER_FRAME::PrintPrjInfo(), FOOTPRINT_WIZARD_FRAME::Process_Special_Functions(), PNS::SHOVE::pushOrShoveVia(), 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(), FOOTPRINT_EDITOR_CONTROL::RepairFootprint(), ReplaceIllegalFileNameChars(), BOARD_INSPECTION_TOOL::reportClearance(), DRC_RULES_PARSER::reportError(), DRC_TEST_PROVIDER::reportRuleStatistics(), DRC_ENGINE::ReportViolation(), BOARD_INSPECTION_TOOL::reportZoneConnection(), WIDGET_HOTKEY_LIST::resolveKeyConflicts(), SCHEMATIC::ResolveTextVar(), 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(), FP_CACHE::Save(), SYMBOL_EDIT_FRAME::Save(), PCB_IO::Save(), IO_MGR::Save(), SYMBOL_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(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), ROUTER_TOOL::saveRouterDebugLog(), SYMBOL_EDIT_FRAME::saveSymbolAs(), SIM_PLOT_FRAME::saveWorkbook(), SchGetLibSymbol(), 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::shoveIteration(), PNS::SHOVE::ShoveLines(), PNS::SHOVE::shoveLineToHullSet(), PNS::SHOVE::shoveMainLoop(), PNS::SHOVE::ShoveMultiLines(), PNS::SHOVE::ShoveObstacleLine(), RC_ITEM::ShowCoord(), COMMON_CONTROL::ShowHelp(), DIALOG_IMPORT_GFX::showPCBdefaultLineWidth(), DIALOG_IMPORT_GFX::showPcbImportOffsets(), RC_ITEM::ShowReport(), SCH_IO_MGR::ShowType(), IO_MGR::ShowType(), PNS::WALKAROUND::singleStep(), PNS::DRAGGER::Start(), SCH_BITMAP::SwapData(), SCH_SHEET_PIN::SwapData(), SCH_SHEET::SwapData(), PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard(), SYMBOL_EDIT_FRAME::SyncLibraries(), PNS_KICAD_IFACE_BASE::syncZone(), PANEL_SETUP_LAYERS::testLayerNames(), ERC_TESTER::TestMultUnitPinConflicts(), ERC_TESTER::TestPinToPin(), SPICE_VALUE::ToString(), DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow(), DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow(), DIALOG_SCH_IMPORT_SETTINGS::TransferDataFromWindow(), DIALOG_IMPORT_SETTINGS::TransferDataFromWindow(), DIALOG_PIN_PROPERTIES::TransferDataFromWindow(), DIALOG_GENCAD_EXPORT_OPTIONS::TransferDataFromWindow(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_SIM_SETTINGS::TransferDataFromWindow(), PANEL_SETUP_LAYERS::TransferDataFromWindow(), DIALOG_EXPORT_IDF3::TransferDataFromWindow(), PANEL_SETUP_FORMATTING::TransferDataToWindow(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_GRID_SETTINGS::TransferDataToWindow(), DIALOG_PNS_LENGTH_TUNING_SETTINGS::TransferDataToWindow(), DIALOG_SIM_SETTINGS::TransferDataToWindow(), WRL1GROUP::TranslateToSG(), WRL1SEPARATOR::TranslateToSG(), WRL2SHAPE::TranslateToSG(), WRL2INLINE::TranslateToSG(), WRL2BOX::TranslateToSG(), WRL2MATERIAL::TranslateToSG(), WRL2SWITCH::TranslateToSG(), WRL2TRANSFORM::TranslateToSG(), WRL2APPEARANCE::TranslateToSG(), X3DIFACESET::TranslateToSG(), WRL2FACESET::TranslateToSG(), X3DTRANSFORM::TranslateToSG(), X3DSHAPE::TranslateToSG(), X3DAPP::TranslateToSG(), TRANSLINE_IDENT::TRANSLINE_IDENT(), PCB_CALCULATOR_FRAME::TranslineTypeSelection(), DSNLEXER::Unexpected(), GL_CONTEXT_MANAGER::UnlockCtx(), HIGHLIGHT_MENU::update(), SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), ACTION_TOOLBAR::UpdateControlWidth(), DIALOG_BOARD_STATISTICS::updateDrillGrid(), BM2CMP_FRAME::updateImageInfo(), DIALOG_PAD_PROPERTIES::UpdateLayersDropdown(), ROUTER_TOOL::updateMessagePanel(), PCB_CONTROL::UpdateMessagePanel(), SCH_EDIT_FRAME::UpdateNetHighlightStatus(), SCH_EDITOR_CONTROL::updatePastedSheet(), SIM_PLOT_FRAME::updatePlot(), DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues(), FOOTPRINT_EDIT_FRAME::UpdateTitle(), SYMBOL_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::UpdateTitle(), CONSOLE_PROGRESS_REPORTER::updateUI(), DIALOG_BOARD_STATISTICS::updateWidets(), EDA_DRAW_FRAME::UpdateZoomSelectBox(), SCH_FIELD_VALIDATOR::Validate(), UNIT_BINDER::Validate(), REGEX_VALIDATOR::Validate(), SPICE_VALIDATOR::Validate(), validateAxisOptions(), PANEL_SYM_LIB_TABLE::verifyTables(), PANEL_FP_LIB_TABLE::verifyTables(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), SYMBOL_ASYNC_LOADER::worker(), FOOTPRINT_LIST_IMPL::WriteCacheToFile(), WriteHotKeyConfig(), 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:515
void Unexpected(int aTok) const
Throw an IO_ERROR exception with an input file specific error message.
Definition: dsnlexer.cpp:338

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