KiCad PCB EDA Suite
Loading...
Searching...
No Matches
EASYPC::COMPOUND_FILE Class Reference

A compound file held in memory; any malformed structure throws IO_ERROR. More...

#include <easypc_file.h>

Public Member Functions

 COMPOUND_FILE (const wxString &aPath)
 
 ~COMPOUND_FILE ()
 
const SOURCE_FB_ENTRY & Root () const
 
std::vector< const SOURCE_FB_ENTRY * > Children (const SOURCE_FB_ENTRY &aStorage) const
 The members of a storage in directory-tree order.
 
const SOURCE_FB_ENTRY * FindChild (const SOURCE_FB_ENTRY &aStorage, const std::u16string &aName) const
 
std::vector< uint8_t > ReadStream (const SOURCE_FB_ENTRY &aStream) const
 
FILE_KIND FileKind () const
 
int32_t LibraryProduct () const
 The LibFormat product, 1 when missing, short or 0.
 

Private Attributes

std::vector< uint8_t > m_image
 
std::unique_ptr< CFB::CompoundFileReader > m_reader
 
std::map< uint32_t, SOURCE_FB_ENTRY > m_entries
 
std::map< uint32_t, std::vector< uint32_t > > m_children
 storage id to member ids in tree order
 

Detailed Description

A compound file held in memory; any malformed structure throws IO_ERROR.

Definition at line 79 of file easypc_file.h.

Constructor & Destructor Documentation

◆ COMPOUND_FILE()

EASYPC::COMPOUND_FILE::COMPOUND_FILE ( const wxString & aPath)
explicit

Definition at line 109 of file easypc_file.cpp.

References _, m_children, m_entries, m_image, m_reader, EASYPC::ReadWholeFile(), and THROW_IO_ERROR.

◆ ~COMPOUND_FILE()

EASYPC::COMPOUND_FILE::~COMPOUND_FILE ( )
default

Member Function Documentation

◆ Children()

std::vector< const SOURCE_FB_ENTRY * > EASYPC::COMPOUND_FILE::Children ( const SOURCE_FB_ENTRY & aStorage) const

The members of a storage in directory-tree order.

Definition at line 186 of file easypc_file.cpp.

References EASYPC::SOURCE_FB_ENTRY::Id, m_children, and m_entries.

Referenced by FindChild().

◆ FileKind()

FILE_KIND EASYPC::COMPOUND_FILE::FileKind ( ) const

Definition at line 236 of file easypc_file.cpp.

References _, FindChild(), ReadStream(), Root(), text, and THROW_IO_ERROR.

Referenced by EASYPC::LoadDesign(), and EASYPC::Probe().

◆ FindChild()

const SOURCE_FB_ENTRY * EASYPC::COMPOUND_FILE::FindChild ( const SOURCE_FB_ENTRY & aStorage,
const std::u16string & aName ) const

Definition at line 200 of file easypc_file.cpp.

References Children().

Referenced by FileKind(), LibraryProduct(), and EASYPC::LoadDesign().

◆ LibraryProduct()

int32_t EASYPC::COMPOUND_FILE::LibraryProduct ( ) const

The LibFormat product, 1 when missing, short or 0.

Definition at line 259 of file easypc_file.cpp.

References FindChild(), ReadStream(), and Root().

◆ ReadStream()

std::vector< uint8_t > EASYPC::COMPOUND_FILE::ReadStream ( const SOURCE_FB_ENTRY & aStream) const

◆ Root()

const SOURCE_FB_ENTRY & EASYPC::COMPOUND_FILE::Root ( ) const
inline

Definition at line 85 of file easypc_file.h.

References m_entries.

Referenced by FileKind(), LibraryProduct(), and EASYPC::LoadDesign().

Member Data Documentation

◆ m_children

std::map<uint32_t, std::vector<uint32_t> > EASYPC::COMPOUND_FILE::m_children
private

storage id to member ids in tree order

Definition at line 102 of file easypc_file.h.

Referenced by Children(), and COMPOUND_FILE().

◆ m_entries

std::map<uint32_t, SOURCE_FB_ENTRY> EASYPC::COMPOUND_FILE::m_entries
private

Definition at line 101 of file easypc_file.h.

Referenced by Children(), COMPOUND_FILE(), and Root().

◆ m_image

std::vector<uint8_t> EASYPC::COMPOUND_FILE::m_image
private

Definition at line 99 of file easypc_file.h.

Referenced by COMPOUND_FILE(), and ReadStream().

◆ m_reader

std::unique_ptr<CFB::CompoundFileReader> EASYPC::COMPOUND_FILE::m_reader
private

Definition at line 100 of file easypc_file.h.

Referenced by COMPOUND_FILE(), and ReadStream().


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