KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ORCAD_STRUCT_READER Class Reference

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_STREAMStream ()
 
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_STREAMm_stream
 
const std::vector< std::string > * m_strings
 
ORCAD_WARN_FN m_warn
 

Detailed Description

ReadStructure can recover from a body error when the prefix supplies a valid end offset.

Definition at line 74 of file orcad_structures.h.

Constructor & Destructor Documentation

◆ ORCAD_STRUCT_READER()

ORCAD_STRUCT_READER::ORCAD_STRUCT_READER ( ORCAD_STREAM & aStream,
const std::vector< std::string > * aStrings = nullptr,
ORCAD_WARN_FN aWarn = nullptr )

Definition at line 35 of file orcad_structures.cpp.

References m_stream, m_strings, m_warn, and move.

Member Function Documentation

◆ PropsDict()

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

◆ ReadPrefixes()

◆ ReadStructure()

◆ Resolve()

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

◆ SkipStructure()

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

◆ Stream()

◆ Warn()

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

Member Data Documentation

◆ m_stream

ORCAD_STREAM& ORCAD_STRUCT_READER::m_stream
private

◆ m_strings

const std::vector<std::string>* ORCAD_STRUCT_READER::m_strings
private

Definition at line 104 of file orcad_structures.h.

Referenced by ORCAD_STRUCT_READER(), and Resolve().

◆ m_warn

ORCAD_WARN_FN ORCAD_STRUCT_READER::m_warn
private

Definition at line 105 of file orcad_structures.h.

Referenced by ORCAD_STRUCT_READER(), and Warn().


The documentation for this class was generated from the following files: