KiCad PCB EDA Suite
Loading...
Searching...
No Matches
orcad_cache.cpp File Reference
#include <sch_io/orcad/orcad_cache.h>
#include <algorithm>
#include <utility>
#include <set>
#include <ki_exception.h>

Go to the source code of this file.

Functions

std::optional< ORCAD_PRIMITIVEOrcadReadPrimitive (ORCAD_STREAM &aStream)
 Consumes one primitive and its optional preamble.
 
std::optional< ORCAD_SYMBOL_PINOrcadReadSymbolPin (ORCAD_STRUCT_READER &aReader)
 A zero byte marks an empty pin slot and returns nullopt.
 
ORCAD_SYMBOL_DEF OrcadReadSymbolDef (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes, bool aWithPins)
 Set aWithPins to read the trailing pin and property lists.
 
ORCAD_SYMBOL_DEF OrcadReadSthInPages0 (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 
ORCAD_DRAWN_INSTANCE OrcadReadDrawnInstance (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 
ORCAD_DEVICE OrcadReadDevice (ORCAD_STRUCT_READER &aReader)
 
ORCAD_PACKAGE OrcadReadPackage (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes)
 
static void storeFramedRecord (ORCAD_STRUCT_READER &aReader, const ORCAD_PREFIXES &aPrefixes, std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols, std::map< std::string, ORCAD_PACKAGE > &aPackages)
 
static bool cacheSectionAcceptsType (int aSection, int aTypeId)
 
void OrcadParseCache (const std::vector< char > &aData, const std::vector< std::string > &aStrings, const ORCAD_WARN_FN &aWarn, std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols, std::map< std::string, ORCAD_PACKAGE > &aPackages)
 The first entry is the default; later entries become variants.
 
void OrcadParseSymbolStream (const std::vector< char > &aData, const std::vector< std::string > &aStrings, std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols)
 Throws IO_ERROR for invalid framing or trailing bytes.
 
void OrcadParsePackageStream (const std::vector< char > &aData, const std::vector< std::string > &aStrings, std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols, std::map< std::string, ORCAD_PACKAGE > &aPackages)
 Package streams contain counted PartCells and LibraryParts, followed by one Package.
 
void OrcadMergeCacheStreams (std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols, std::map< std::string, ORCAD_PACKAGE > &aPackages, std::map< std::string, ORCAD_SYMBOL_DEF > &&aExtraSymbols, std::map< std::string, ORCAD_PACKAGE > &&aExtraPackages)
 Existing symbols gain variants.
 
void OrcadMergeSymbolGeneralProperties (std::map< std::string, ORCAD_SYMBOL_DEF > &aSymbols, const std::map< std::string, ORCAD_SYMBOL_DEF > &aMetadataSymbols)
 

Function Documentation

◆ cacheSectionAcceptsType()

static bool cacheSectionAcceptsType ( int aSection,
int aTypeId )
static

Definition at line 718 of file orcad_cache.cpp.

References ORCAD_ST_LIBRARY_PART, ORCAD_ST_PACKAGE, and ORCAD_ST_PART_CELL.

Referenced by OrcadParseCache().

◆ OrcadMergeCacheStreams()

void OrcadMergeCacheStreams ( std::map< std::string, ORCAD_SYMBOL_DEF > & aSymbols,
std::map< std::string, ORCAD_PACKAGE > & aPackages,
std::map< std::string, ORCAD_SYMBOL_DEF > && aExtraSymbols,
std::map< std::string, ORCAD_PACKAGE > && aExtraPackages )

Existing symbols gain variants.

Existing packages retain their cache definition.

Definition at line 910 of file orcad_cache.cpp.

References name.

Referenced by SCH_IO_ORCAD::loadOlbSymbols(), and SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadMergeSymbolGeneralProperties()

void OrcadMergeSymbolGeneralProperties ( std::map< std::string, ORCAD_SYMBOL_DEF > & aSymbols,
const std::map< std::string, ORCAD_SYMBOL_DEF > & aMetadataSymbols )

Definition at line 960 of file orcad_cache.cpp.

References name.

Referenced by BOOST_AUTO_TEST_CASE(), and SCH_IO_ORCAD::LoadSchematicFile().

◆ OrcadParseCache()

void OrcadParseCache ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings,
const ORCAD_WARN_FN & aWarn,
std::map< std::string, ORCAD_SYMBOL_DEF > & aSymbols,
std::map< std::string, ORCAD_PACKAGE > & aPackages )

◆ OrcadParsePackageStream()

void OrcadParsePackageStream ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings,
std::map< std::string, ORCAD_SYMBOL_DEF > & aSymbols,
std::map< std::string, ORCAD_PACKAGE > & aPackages )

◆ OrcadParseSymbolStream()

void OrcadParseSymbolStream ( const std::vector< char > & aData,
const std::vector< std::string > & aStrings,
std::map< std::string, ORCAD_SYMBOL_DEF > & aSymbols )

◆ OrcadReadDevice()

◆ OrcadReadDrawnInstance()

◆ OrcadReadPackage()

◆ OrcadReadPrimitive()

std::optional< ORCAD_PRIMITIVE > OrcadReadPrimitive ( ORCAD_STREAM & aStream)

Consumes one primitive and its optional preamble.

Throws IO_ERROR for invalid framing or length. Returns nullopt for a recognized body that is not supported.

Definition at line 316 of file orcad_cache.cpp.

References ORCAD_STREAM::GetOffset(), ORCAD_PRIM_SYMBOL_VECTOR, ORCAD_STREAM::ReadU8(), and THROW_IO_ERRORF.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and OrcadReadSymbolDef().

◆ OrcadReadSthInPages0()

ORCAD_SYMBOL_DEF OrcadReadSthInPages0 ( ORCAD_STRUCT_READER & aReader,
const ORCAD_PREFIXES & aPrefixes )

Definition at line 500 of file orcad_cache.cpp.

References OrcadReadSymbolDef().

Referenced by ORCAD_STRUCT_READER::ReadStructure().

◆ OrcadReadSymbolDef()

◆ OrcadReadSymbolPin()

◆ storeFramedRecord()

static void storeFramedRecord ( ORCAD_STRUCT_READER & aReader,
const ORCAD_PREFIXES & aPrefixes,
std::map< std::string, ORCAD_SYMBOL_DEF > & aSymbols,
std::map< std::string, ORCAD_PACKAGE > & aPackages )
static