38#include <wx/textfile.h> 
   39#include <wx/txtstrm.h> 
   40#include <wx/wfstream.h> 
   51    if( footprint == 
nullptr ) 
 
 
   83        m_errors.move_push( std::make_unique<IO_ERROR>( ioe ) );
 
   86    catch( 
const std::exception& se )
 
   96            m_errors.move_push( std::make_unique<IO_ERROR>( ioe ) );
 
 
  109    long long int generatedTimestamp = 0;
 
 
  171    size_t                                      num_elements = 
m_queue.size();
 
  172    std::vector<std::future<size_t>>            returns( num_elements );
 
  175            [ 
this, &queue_parsed ]() -> 
size_t 
  182                wxArrayString fpnames;
 
  187                            m_lib_table->FootprintEnumerate( fpnames, nickname, 
false );
 
  190                for( wxString fpname : fpnames )
 
  196                                queue_parsed.
move_push( std::unique_ptr<FOOTPRINT_INFO>( fpinfo ) );
 
  209    for( 
size_t ii = 0; ii < num_elements; ++ii )
 
  210        returns[ii] = 
tp.submit_task( fp_thread );
 
  212    for( 
const std::future<size_t>& ret : returns )
 
  214        std::future_status status = ret.wait_for( std::chrono::milliseconds( 250 ) );
 
  216        while( status != std::future_status::ready )
 
  221            status = ret.wait_for( std::chrono::milliseconds( 250 ) );
 
  225    std::unique_ptr<FOOTPRINT_INFO> fpi;
 
  227    while( queue_parsed.
pop( fpi ) )
 
  228        m_list.push_back( std::move( fpi ) );
 
  231               []( std::unique_ptr<FOOTPRINT_INFO> 
const& lhs,
 
  232                   std::unique_ptr<FOOTPRINT_INFO> 
const& rhs ) -> 
bool 
 
  249    wxFileName          tmpFileName = wxFileName::CreateTempFileName( aFilePath );
 
  250    wxFFileOutputStream outStream( tmpFileName.GetFullPath() );
 
  251    wxTextOutputStream  txtStream( outStream );
 
  253    if( !outStream.IsOk() )
 
  260    for( std::unique_ptr<FOOTPRINT_INFO>& fpinfo : 
m_list )
 
  262        txtStream << fpinfo->GetLibNickname() << endl;
 
  263        txtStream << fpinfo->GetName() << endl;
 
  266        txtStream << wxString::Format( wxT( 
"%d" ), fpinfo->GetOrderNum() ) << endl;
 
  267        txtStream << wxString::Format( wxT( 
"%u" ), fpinfo->GetPadCount() ) << endl;
 
  268        txtStream << wxString::Format( wxT( 
"%u" ), fpinfo->GetUniquePadCount() ) << endl;
 
  277    if( !wxRenameFile( tmpFileName.GetFullPath(), aFilePath, 
true ) )
 
  281        wxRemoveFile( tmpFileName.GetFullPath() );
 
 
  288    wxTextFile cacheFile( aFilePath );
 
  295        if( cacheFile.Exists() && cacheFile.Open() )
 
  299            while( cacheFile.GetCurrentLine() + 6 < cacheFile.GetLineCount() )
 
  301                wxString             libNickname    = cacheFile.GetNextLine();
 
  302                wxString             
name           = cacheFile.GetNextLine();
 
  305                int                  orderNum       = wxAtoi( cacheFile.GetNextLine() );
 
  306                unsigned int         padCount       = (unsigned) wxAtoi( cacheFile.GetNextLine() );
 
  307                unsigned int         uniquePadCount = (unsigned) wxAtoi( cacheFile.GetNextLine() );
 
  311                                                                       padCount,  uniquePadCount );
 
  313                m_list.emplace_back( std::unique_ptr<FOOTPRINT_INFO>( fpinfo ) );
 
  327    if( cacheFile.IsOpened() )
 
 
const FOOTPRINT * GetEnumeratedFootprint(const wxString &aNickname, const wxString &aFootprintName)
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
 
long long GenerateTimestamp(const wxString *aNickname)
Generate a hashed timestamp representing the last-mod-times of the library indicated by aNickname,...
 
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
 
RAII class to safely set/reset nil KIIDs for use in footprint/symbol loading.
 
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
 
A progress reporter interface for use in multi-threaded environments.
 
Synchronized, locking queue.
 
bool pop(T &aReceiver)
Pop a value if the queue into the provided variable.
 
void move_push(T &&aValue)
Move a value onto the queue.
 
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
 
wxString UnescapeString(const wxString &aSource)
 
wxString EscapeString(const wxString &aSource, ESCAPE_CONTEXT aContext)
The Escape/Unescape routines use HTML-entity-reference-style encoding to handle characters which are:...
 
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
 
BS::thread_pool< 0 > thread_pool
 
Definition of file extensions used in Kicad.