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

A library parsed once; items are then served by name without reading the file again. More...

#include <easypc_document.h>

Public Member Functions

 LIBRARY_FILE (const wxString &aPath)
 Throws IO_ERROR when the file is not a library or is malformed.
 
FILE_KIND Kind () const
 
const std::vector< wxString > & ItemNames () const
 Item names in directory order, unescaped.
 
bool HasItem (const wxString &aItemName) const
 
const std::vector< wxString > & Warnings () const
 Warnings for item names that collide after unescaping.
 
std::unique_ptr< LIBRARY_ITEM > LoadItem (const wxString &aItemName) const
 Throws IO_ERROR if no item has that name.
 

Static Public Member Functions

static long long Timestamp (const wxString &aPath)
 A library file's modification time, 0 when it does not exist.
 

Private Attributes

wxString m_path
 
COMPOUND_FILE m_file
 
FILE_KIND m_kind
 
int32_t m_product = PRODUCT_EASYPC
 
std::vector< const SOURCE_FB_ENTRY * > m_entries
 
std::vector< wxString > m_names
 
std::map< wxString, size_t > m_byName
 
std::vector< wxString > m_warnings
 

Detailed Description

A library parsed once; items are then served by name without reading the file again.

Definition at line 90 of file easypc_document.h.

Constructor & Destructor Documentation

◆ LIBRARY_FILE()

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

Throws IO_ERROR when the file is not a library or is malformed.

Definition at line 174 of file easypc_document.cpp.

References _, EASYPC::COMPONENT_LIBRARY, EASYPC::FileKindString(), m_entries, m_file, m_kind, m_path, m_product, and THROW_IO_ERROR.

Member Function Documentation

◆ HasItem()

bool EASYPC::LIBRARY_FILE::HasItem ( const wxString & aItemName) const
inline

◆ ItemNames()

const std::vector< wxString > & EASYPC::LIBRARY_FILE::ItemNames ( ) const
inline

Item names in directory order, unescaped.

Definition at line 102 of file easypc_document.h.

References m_names.

◆ Kind()

FILE_KIND EASYPC::LIBRARY_FILE::Kind ( ) const
inline

Definition at line 99 of file easypc_document.h.

References m_kind.

Referenced by SCH_IO_EASYPC::LoadSymbol().

◆ LoadItem()

◆ Timestamp()

long long EASYPC::LIBRARY_FILE::Timestamp ( const wxString & aPath)
static

A library file's modification time, 0 when it does not exist.

Definition at line 167 of file easypc_document.cpp.

Referenced by PCB_IO_EASYPC::GetLibraryTimestamp(), PCB_IO_EASYPC::library(), and SCH_IO_EASYPC::library().

◆ Warnings()

const std::vector< wxString > & EASYPC::LIBRARY_FILE::Warnings ( ) const
inline

Warnings for item names that collide after unescaping.

Definition at line 106 of file easypc_document.h.

References m_warnings.

Member Data Documentation

◆ m_byName

std::map<wxString, size_t> EASYPC::LIBRARY_FILE::m_byName
private

Definition at line 118 of file easypc_document.h.

Referenced by HasItem(), and LoadItem().

◆ m_entries

std::vector<const SOURCE_FB_ENTRY*> EASYPC::LIBRARY_FILE::m_entries
private

Definition at line 116 of file easypc_document.h.

Referenced by LIBRARY_FILE(), and LoadItem().

◆ m_file

COMPOUND_FILE EASYPC::LIBRARY_FILE::m_file
private

Definition at line 113 of file easypc_document.h.

Referenced by LIBRARY_FILE(), and LoadItem().

◆ m_kind

FILE_KIND EASYPC::LIBRARY_FILE::m_kind
private

Definition at line 114 of file easypc_document.h.

Referenced by Kind(), LIBRARY_FILE(), and LoadItem().

◆ m_names

std::vector<wxString> EASYPC::LIBRARY_FILE::m_names
private

Definition at line 117 of file easypc_document.h.

Referenced by ItemNames().

◆ m_path

wxString EASYPC::LIBRARY_FILE::m_path
private

Definition at line 112 of file easypc_document.h.

Referenced by LIBRARY_FILE(), and LoadItem().

◆ m_product

int32_t EASYPC::LIBRARY_FILE::m_product = PRODUCT_EASYPC
private

Definition at line 115 of file easypc_document.h.

Referenced by LIBRARY_FILE(), and LoadItem().

◆ m_warnings

std::vector<wxString> EASYPC::LIBRARY_FILE::m_warnings
private

Definition at line 119 of file easypc_document.h.

Referenced by Warnings().


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