KiCad PCB EDA Suite
Loading...
Searching...
No Matches
orcad_page.cpp File Reference
#include <sch_io/orcad/orcad_page.h>
#include <algorithm>
#include <utility>
#include <ki_exception.h>
#include <sch_io/orcad/orcad_library.h>
#include <sch_io/orcad/orcad_stream.h>
#include <sch_io/orcad/orcad_structures.h>

Go to the source code of this file.

Functions

ORCAD_RAW_PAGE OrcadParsePage (const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn, ORCAD_DIALECT aDialect)
 A modern body failure skips that structure.
 
static std::vector< std::string > pageOrderBody (ORCAD_STREAM &aStream)
 
std::vector< std::string > OrcadParsePageOrder (const std::vector< char > &aData, ORCAD_DIALECT aDialect)
 Returns display order.
 
std::vector< std::string > OrcadParseSchematicFolderOrder (const std::vector< char > &aData)
 Unlisted Views storages can be stale.
 
static uint8_t readOccHeader (ORCAD_STRUCT_READER &aReader, int aExpectType, std::map< std::string, std::string > *aProps=nullptr)
 
static ORCAD_OCC_SCOPE readOccScope (ORCAD_STRUCT_READER &aReader)
 
static void readOccurrence (ORCAD_STRUCT_READER &aReader, ORCAD_OCC_SCOPE &aScope)
 
static ORCAD_OCC_SCOPE readOccTree (ORCAD_STRUCT_READER &aReader)
 
ORCAD_OCC_SCOPE OrcadReadOccurrenceTree (const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn, ORCAD_DIALECT aDialect)
 Returns occurrence references and child scopes.
 

Function Documentation

◆ OrcadParsePage()

◆ OrcadParsePageOrder()

std::vector< std::string > OrcadParsePageOrder ( const std::vector< char > & aData,
ORCAD_DIALECT aDialect = {} )

Returns display order.

The caller must reconcile these names with available page streams.

Definition at line 199 of file orcad_page.cpp.

References ORCAD_DIALECT::legacy, ORCAD_ST_SCH_LIB, pageOrderBody(), and ORCAD_STRUCT_READER::ReadPrefixes().

Referenced by SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadParseSchematicFolderOrder()

std::vector< std::string > OrcadParseSchematicFolderOrder ( const std::vector< char > & aData)

Unlisted Views storages can be stale.

Import them only if a hierarchy occurrence refers to them.

Definition at line 211 of file orcad_page.cpp.

References ORCAD_STREAM::AtEnd(), ORCAD_STREAM::ReadLzt(), ORCAD_STREAM::ReadU16(), ORCAD_STREAM::Skip(), and THROW_IO_ERROR.

Referenced by SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadReadOccurrenceTree()

ORCAD_OCC_SCOPE OrcadReadOccurrenceTree ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings,
const ORCAD_WARN_FN & aWarn,
ORCAD_DIALECT aDialect = {} )

Returns occurrence references and child scopes.

Modern parse errors return an empty scope; legacy ones throw IO_ERROR.

Definition at line 386 of file orcad_page.cpp.

References ORCAD_DIALECT::legacy, readOccTree(), ORCAD_STREAM::ReadU32(), ORCAD_STREAM::ReadU8(), ORCAD_STREAM::Remaining(), THROW_IO_ERRORF, and IO_ERROR::What().

Referenced by SCH_IO_ORCAD::LoadSchematicFile().

◆ pageOrderBody()

static std::vector< std::string > pageOrderBody ( ORCAD_STREAM & aStream)
static

◆ readOccHeader()

static uint8_t readOccHeader ( ORCAD_STRUCT_READER & aReader,
int aExpectType,
std::map< std::string, std::string > * aProps = nullptr )
static

◆ readOccScope()

◆ readOccTree()

◆ readOccurrence()