|
KiCad PCB EDA Suite
|
ReadStructure can recover from a body error when the prefix supplies a valid end offset. More...
#include <orcad_structures.h>
Public Member Functions | |
| ORCAD_STRUCT_READER (ORCAD_STREAM &aStream, const std::vector< std::string > *aStrings=nullptr, ORCAD_WARN_FN aWarn=nullptr) | |
| ORCAD_STREAM & | Stream () |
| ORCAD_PREFIXES | ReadPrefixes (int aExpectedType=-1, size_t aEnclosingEnd=ORCAD_STREAM::npos, size_t aLongPrefixCount=ORCAD_STREAM::npos) |
| aLongPrefixCount overrides the type depth; aEnclosingEnd bounds all stops. | |
| std::string | Resolve (uint32_t aIndex) const |
| String-table lookup; returns "" for out-of-range indices. | |
| std::map< std::string, std::string > | PropsDict (const ORCAD_PREFIXES &aPrefixes) const |
| Resolve the short-prefix (nameIdx, valueIdx) pairs; empty names are dropped. | |
| void | SkipStructure (const ORCAD_PREFIXES &aPrefixes, const wxString &aWhat) |
| Throws IO_ERROR if the end is unknown or behind the cursor. | |
| ORCAD_READ_RESULT | ReadStructure () |
| Skip unknown bodies. | |
| void | Warn (const wxString &aMsg) const |
| Report a recoverable problem to the warning sink (no-op when none was given). | |
Private Attributes | |
| ORCAD_STREAM & | m_stream |
| const std::vector< std::string > * | m_strings |
| ORCAD_WARN_FN | m_warn |
ReadStructure can recover from a body error when the prefix supplies a valid end offset.
Definition at line 74 of file orcad_structures.h.
| ORCAD_STRUCT_READER::ORCAD_STRUCT_READER | ( | ORCAD_STREAM & | aStream, |
| const std::vector< std::string > * | aStrings = nullptr, | ||
| ORCAD_WARN_FN | aWarn = nullptr ) |
| std::map< std::string, std::string > ORCAD_STRUCT_READER::PropsDict | ( | const ORCAD_PREFIXES & | aPrefixes | ) | const |
Resolve the short-prefix (nameIdx, valueIdx) pairs; empty names are dropped.
Definition at line 202 of file orcad_structures.cpp.
References name, ORCAD_PREFIXES::props, and Resolve().
Referenced by OrcadParsePackageStream(), OrcadParsePage(), OrcadReadDrawnInstance(), OrcadReadGraphicInst(), OrcadReadPackage(), OrcadReadPlacedInstance(), OrcadReadSymbolDef(), and readOccHeader().
| ORCAD_PREFIXES ORCAD_STRUCT_READER::ReadPrefixes | ( | int | aExpectedType = -1, |
| size_t | aEnclosingEnd = ORCAD_STREAM::npos, | ||
| size_t | aLongPrefixCount = ORCAD_STREAM::npos ) |
aLongPrefixCount overrides the type depth; aEnclosingEnd bounds all stops.
Invalid or inconsistent prefixes throw IO_ERROR.
Definition at line 111 of file orcad_structures.cpp.
References ORCAD_PREFIXES::bodyLens, ORCAD_PREFIXES::bodyStart, ORCAD_PREFIXES::end, m_stream, ORCAD_STREAM::npos, OrcadLongPrefixCount(), ORCAD_PREFIXES::props, ORCAD_PREFIXES::start, ORCAD_PREFIXES::stops, THROW_IO_ERROR, THROW_IO_ERRORF, and ORCAD_PREFIXES::typeId.
Referenced by BOOST_AUTO_TEST_CASE(), OrcadParseCache(), OrcadParsePackageStream(), OrcadParsePage(), OrcadParsePageOrder(), OrcadParseSymbolStream(), OrcadReadDevice(), OrcadReadDrawnInstance(), OrcadReadSymbolPin(), readOccHeader(), and ReadStructure().
| ORCAD_READ_RESULT ORCAD_STRUCT_READER::ReadStructure | ( | ) |
Skip unknown bodies.
After a body error, resume at the prefix end when possible.
Definition at line 231 of file orcad_structures.cpp.
References ORCAD_PREFIXES::end, m_stream, ORCAD_ST_ALIAS, ORCAD_ST_BUS_ENTRY, ORCAD_ST_DRAWN_INSTANCE, ORCAD_ST_ERC_OBJECT, ORCAD_ST_GLOBAL, ORCAD_ST_GRAPHIC_ARC_INST, ORCAD_ST_GRAPHIC_BEZIER_INST, ORCAD_ST_GRAPHIC_BITMAP_INST, ORCAD_ST_GRAPHIC_BOX_INST, ORCAD_ST_GRAPHIC_COMMENT_TEXT_INST, ORCAD_ST_GRAPHIC_ELLIPSE_INST, ORCAD_ST_GRAPHIC_LINE_INST, ORCAD_ST_GRAPHIC_OLE_INST, ORCAD_ST_GRAPHIC_POLYGON_INST, ORCAD_ST_GRAPHIC_POLYLINE_INST, ORCAD_ST_OFFPAGE_CONNECTOR, ORCAD_ST_PLACED_INSTANCE, ORCAD_ST_PORT, ORCAD_ST_STH_IN_PAGES0, ORCAD_ST_SYMBOL_DISPLAY_PROP, ORCAD_ST_T0X10, ORCAD_ST_T0X11, ORCAD_ST_TITLEBLOCK, ORCAD_ST_WIRE_BUS, ORCAD_ST_WIRE_SCALAR, OrcadReadAlias(), OrcadReadBusEntry(), OrcadReadDisplayProp(), OrcadReadDrawnInstance(), OrcadReadErcObject(), OrcadReadGraphicInst(), OrcadReadPinInst(), OrcadReadPlacedInstance(), OrcadReadPort(), OrcadReadSthInPages0(), OrcadReadTitleBlock(), OrcadReadWire(), ReadPrefixes(), result, SkipStructure(), ORCAD_PREFIXES::typeId, Warn(), and IO_ERROR::What().
Referenced by OrcadParsePage(), OrcadReadDisplayPropList(), OrcadReadDrawnInstance(), OrcadReadGraphicInst(), OrcadReadPlacedInstance(), OrcadReadSymbolDef(), and OrcadReadWire().
| std::string ORCAD_STRUCT_READER::Resolve | ( | uint32_t | aIndex | ) | const |
String-table lookup; returns "" for out-of-range indices.
Definition at line 193 of file orcad_structures.cpp.
References m_strings.
Referenced by OrcadReadDisplayProp(), OrcadReadDrawnInstance(), OrcadReadGraphicInst(), OrcadReadPlacedInstance(), and PropsDict().
| void ORCAD_STRUCT_READER::SkipStructure | ( | const ORCAD_PREFIXES & | aPrefixes, |
| const wxString & | aWhat ) |
Throws IO_ERROR if the end is unknown or behind the cursor.
Definition at line 218 of file orcad_structures.cpp.
References ORCAD_PREFIXES::end, m_stream, and THROW_IO_ERRORF.
Referenced by ReadStructure(), and storeFramedRecord().
|
inline |
Definition at line 80 of file orcad_structures.h.
References m_stream.
Referenced by OrcadReadAlias(), OrcadReadBusEntry(), OrcadReadDevice(), OrcadReadDisplayProp(), OrcadReadDisplayPropList(), OrcadReadDrawnInstance(), OrcadReadErcObject(), OrcadReadGraphicInst(), OrcadReadPackage(), OrcadReadPinInst(), OrcadReadPlacedInstance(), OrcadReadPort(), OrcadReadSymbolDef(), OrcadReadSymbolPin(), OrcadReadTitleBlock(), OrcadReadWire(), and storeFramedRecord().
| void ORCAD_STRUCT_READER::Warn | ( | const wxString & | aMsg | ) | const |
Report a recoverable problem to the warning sink (no-op when none was given).
Definition at line 44 of file orcad_structures.cpp.
References m_warn.
Referenced by ReadStructure().
|
private |
Definition at line 103 of file orcad_structures.h.
Referenced by ORCAD_STRUCT_READER(), ReadPrefixes(), ReadStructure(), SkipStructure(), and Stream().
|
private |
Definition at line 104 of file orcad_structures.h.
Referenced by ORCAD_STRUCT_READER(), and Resolve().
|
private |
Definition at line 105 of file orcad_structures.h.
Referenced by ORCAD_STRUCT_READER(), and Warn().