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

#include <altium_parser.h>

Public Member Functions

 ALTIUM_PARSER (const ALTIUM_COMPOUND_FILE &aFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
 
 ALTIUM_PARSER (std::unique_ptr< char[]> &aContent, size_t aSize)
 
 ~ALTIUM_PARSER ()=default
 
template<typename Type >
Type Read ()
 
template<typename Type >
Type Peek ()
 
wxScopedCharBuffer ReadCharBuffer ()
 
wxString ReadWxString ()
 
std::map< uint32_t, wxString > ReadWideStringTable ()
 
std::vector< char > ReadVector (size_t aSize)
 
int ReadBytes (char *aOut, size_t aSize)
 
int32_t ReadKicadUnit ()
 
int32_t ReadKicadUnitX ()
 
int32_t ReadKicadUnitY ()
 
VECTOR2I ReadVector2IPos ()
 
VECTOR2I ReadVector2ISize ()
 
size_t ReadAndSetSubrecordLength ()
 
std::map< wxString, wxString > ReadProperties (std::function< std::map< wxString, wxString >(const std::string &)> handleBinaryData=[](const std::string &) { return std::map< wxString, wxString >();})
 
void Skip (size_t aLength)
 
void SkipSubrecord ()
 
size_t GetRemainingBytes () const
 
size_t GetRemainingSubrecordBytes () const
 
bool HasParsingError ()
 

Static Public Member Functions

static int32_t ConvertToKicadUnit (const double aValue)
 
static int ReadInt (const std::map< wxString, wxString > &aProps, const wxString &aKey, int aDefault)
 
static double ReadDouble (const std::map< wxString, wxString > &aProps, const wxString &aKey, double aDefault)
 
static bool ReadBool (const std::map< wxString, wxString > &aProps, const wxString &aKey, bool aDefault)
 
static int32_t ReadKicadUnit (const std::map< wxString, wxString > &aProps, const wxString &aKey, const wxString &aDefault)
 
static wxString ReadString (const std::map< wxString, wxString > &aProps, const wxString &aKey, const wxString &aDefault)
 
static wxString ReadUnicodeString (const std::map< wxString, wxString > &aProps, const wxString &aKey, const wxString &aDefault)
 

Private Attributes

std::unique_ptr< char[]> m_content
 
size_t m_size
 
char * m_pos
 
char * m_subrecord_end
 
bool m_error
 

Detailed Description

Definition at line 95 of file altium_parser.h.

Constructor & Destructor Documentation

◆ ALTIUM_PARSER() [1/2]

ALTIUM_PARSER::ALTIUM_PARSER ( const ALTIUM_COMPOUND_FILE aFile,
const CFB::COMPOUND_FILE_ENTRY *  aEntry 
)

◆ ALTIUM_PARSER() [2/2]

ALTIUM_PARSER::ALTIUM_PARSER ( std::unique_ptr< char[]> &  aContent,
size_t  aSize 
)

Definition at line 283 of file altium_parser.cpp.

References m_content, m_error, m_pos, m_size, and m_subrecord_end.

◆ ~ALTIUM_PARSER()

ALTIUM_PARSER::~ALTIUM_PARSER ( )
default

Member Function Documentation

◆ ConvertToKicadUnit()

int32_t ALTIUM_PARSER::ConvertToKicadUnit ( const double  aValue)
static

Definition at line 390 of file altium_parser.cpp.

References KiROUND().

Referenced by AREGION6::AREGION6(), BOOST_AUTO_TEST_CASE(), and ReadKicadUnit().

◆ GetRemainingBytes()

◆ GetRemainingSubrecordBytes()

size_t ALTIUM_PARSER::GetRemainingSubrecordBytes ( ) const
inline

Definition at line 308 of file altium_parser.h.

References m_pos, and m_subrecord_end.

Referenced by AARC6::AARC6(), AFILL6::AFILL6(), APAD6::APAD6(), and ATRACK6::ATRACK6().

◆ HasParsingError()

◆ Peek()

template<typename Type >
Type ALTIUM_PARSER::Peek ( )
inline

Definition at line 121 of file altium_parser.h.

References m_error, and m_pos.

Referenced by ALTIUM_PCB::ParseFootprint().

◆ Read()

◆ ReadAndSetSubrecordLength()

◆ ReadBool()

◆ ReadBytes()

int ALTIUM_PARSER::ReadBytes ( char *  aOut,
size_t  aSize 
)
inline

Definition at line 201 of file altium_parser.h.

References GetRemainingBytes(), m_error, and m_pos.

Referenced by ATEXT6::ATEXT6().

◆ ReadCharBuffer()

wxScopedCharBuffer ALTIUM_PARSER::ReadCharBuffer ( )
inline

Definition at line 131 of file altium_parser.h.

References GetRemainingBytes(), m_error, and m_pos.

Referenced by ALTIUM_DESIGNER_PLUGIN::FootprintEnumerate(), and ReadWxString().

◆ ReadDouble()

double ALTIUM_PARSER::ReadDouble ( const std::map< wxString, wxString > &  aProps,
const wxString &  aKey,
double  aDefault 
)
static

◆ ReadInt()

int ALTIUM_PARSER::ReadInt ( const std::map< wxString, wxString > &  aProps,
const wxString &  aKey,
int  aDefault 
)
static

◆ ReadKicadUnit() [1/2]

◆ ReadKicadUnit() [2/2]

int32_t ALTIUM_PARSER::ReadKicadUnit ( const std::map< wxString, wxString > &  aProps,
const wxString &  aKey,
const wxString &  aDefault 
)
static

Definition at line 441 of file altium_parser.cpp.

References _, ConvertToKicadUnit(), and ReadString().

◆ ReadKicadUnitX()

int32_t ALTIUM_PARSER::ReadKicadUnitX ( )
inline

Definition at line 221 of file altium_parser.h.

References ReadKicadUnit().

Referenced by APAD6::APAD6(), and ReadVector2IPos().

◆ ReadKicadUnitY()

int32_t ALTIUM_PARSER::ReadKicadUnitY ( )
inline

Definition at line 226 of file altium_parser.h.

References ReadKicadUnit().

Referenced by APAD6::APAD6(), and ReadVector2IPos().

◆ ReadProperties()

◆ ReadString()

◆ ReadUnicodeString()

wxString ALTIUM_PARSER::ReadUnicodeString ( const std::map< wxString, wxString > &  aProps,
const wxString &  aKey,
const wxString &  aDefault 
)
static

Definition at line 483 of file altium_parser.cpp.

References ReadString().

Referenced by ACOMPONENT6::ACOMPONENT6().

◆ ReadVector()

std::vector< char > ALTIUM_PARSER::ReadVector ( size_t  aSize)
inline

◆ ReadVector2IPos()

VECTOR2I ALTIUM_PARSER::ReadVector2IPos ( )
inline

◆ ReadVector2ISize()

VECTOR2I ALTIUM_PARSER::ReadVector2ISize ( )
inline

Definition at line 238 of file altium_parser.h.

References ReadKicadUnit().

Referenced by APAD6::APAD6().

◆ ReadWideStringTable()

std::map< uint32_t, wxString > ALTIUM_PARSER::ReadWideStringTable ( )
inline

Definition at line 156 of file altium_parser.h.

References GetRemainingBytes(), and m_pos.

Referenced by ALTIUM_PCB::ParseWideStrings6Data().

◆ ReadWxString()

wxString ALTIUM_PARSER::ReadWxString ( )
inline

◆ Skip()

◆ SkipSubrecord()

Member Data Documentation

◆ m_content

std::unique_ptr<char[]> ALTIUM_PARSER::m_content
private

Definition at line 321 of file altium_parser.h.

Referenced by ALTIUM_PARSER(), and GetRemainingBytes().

◆ m_error

bool ALTIUM_PARSER::m_error
private

◆ m_pos

◆ m_size

size_t ALTIUM_PARSER::m_size
private

Definition at line 322 of file altium_parser.h.

Referenced by ALTIUM_PARSER(), and GetRemainingBytes().

◆ m_subrecord_end

char* ALTIUM_PARSER::m_subrecord_end
private

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