KiCad PCB EDA Suite
Loading...
Searching...
No Matches
embedded_files.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14 * Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include "embedded_files.h"
22
23#include <wx/base64.h>
24#include <wx/debug.h>
25#include <wx/filename.h>
26#include <wx/log.h>
27#include <wx/mstream.h>
28#include <wx/wfstream.h>
29
30#include <map>
31#include <memory>
32#include <sstream>
33
34#include <zstd.h>
35
36#include <kiid.h>
37#include <mmh3_hash.h>
38#include <paths.h>
39#include <picosha2.h>
41
42
44{
46 hash.add( decompressedData );
47
48 is_valid = ( hash.digest().ToString() == data_hash );
49 return is_valid;
50}
51
52
54{
55 std::string new_sha;
56 picosha2::hash256_hex_string( decompressedData, new_sha );
57
58 is_valid = ( new_sha == data_hash );
59 return is_valid;
60}
61
62
64{
65 return wxString::Format( "%s://%s", FILEEXT::KiCadUriPrefix, name );
66}
67
68
69EMBEDDED_FILES::EMBEDDED_FILE* EMBEDDED_FILES::AddFile( const wxFileName& aName, bool aOverwrite )
70{
71 if( HasFile( aName.GetFullName() ) )
72 {
73 if( !aOverwrite )
74 return m_files[aName.GetFullName()].get();
75
76 m_files.erase( aName.GetFullName() );
77 }
78
79 wxFFileInputStream file( aName.GetFullPath() );
80 wxMemoryBuffer buffer;
81
82 if( !file.IsOk() )
83 return nullptr;
84
85 wxFileOffset length = file.GetLength();
86
87 std::shared_ptr<EMBEDDED_FILE> efile = std::make_shared<EMBEDDED_FILE>();
88 efile->name = aName.GetFullName();
89 efile->decompressedData.resize( length );
90
91 wxString ext = aName.GetExt().Upper();
92
93 // Handle some common file extensions
94 if( ext == "STP" || ext == "STPZ" || ext == "STEP" || ext == "WRL" || ext == "WRZ" )
95 {
97 }
98 else if( ext == "WOFF" || ext == "WOFF2" || ext == "TTF" || ext == "OTF" )
99 {
100 efile->type = EMBEDDED_FILE::FILE_TYPE::FONT;
101 }
102 else if( ext == "PDF" )
103 {
105 }
106 else if( ext == "KICAD_WKS" )
107 {
109 }
110
111 if( !efile->decompressedData.data() )
112 return nullptr;
113
114 char* data = efile->decompressedData.data();
115 wxFileOffset total_read = 0;
116
117 while( !file.Eof() && total_read < length )
118 {
119 file.Read( data, length - total_read );
120
121 size_t read = file.LastRead();
122 data += read;
123 total_read += read;
124 }
125
126 if( CompressAndEncode( *efile ) != RETURN_CODE::OK )
127 return nullptr;
128
129 efile->is_valid = true;
130
131 EMBEDDED_FILE* result = efile.get();
132 m_files[aName.GetFullName()] = std::move( efile );
133
136
137 return result;
138}
139
140
142{
143 AddFile( std::shared_ptr<EMBEDDED_FILE>( aFile ) );
144}
145
146
147void EMBEDDED_FILES::AddFile( std::shared_ptr<EMBEDDED_FILE> aFile )
148{
149 if( !aFile )
150 return;
151
152 wxString name = aFile->name;
153 auto [it, inserted] = m_files.emplace( std::move( name ), std::move( aFile ) );
154
155 // Fire the callback only when the file was actually inserted; std::map::emplace silently
156 // drops duplicates and we must not announce a stored pointer that no longer matches what
157 // the collection holds.
158 if( inserted && m_fileAddedCallback )
159 m_fileAddedCallback( it->second.get() );
160}
161
162
163// Remove a file from the collection
164void EMBEDDED_FILES::RemoveFile( const wxString& name, bool aErase )
165{
166 // aErase is retained for API compatibility; with shared_ptr ownership the map entry
167 // release will free the underlying file when no other collection still references it.
168 (void) aErase;
169
170 auto it = m_files.find( name );
171
172 if( it != m_files.end() )
173 m_files.erase( it );
174}
175
176
178 const std::set<wxString>& aExcludedNames )
179{
180 // Build the filtered set before touching m_files so self-assignment stays safe.
181 std::map<wxString, std::shared_ptr<EMBEDDED_FILE>> filtered;
182
183 for( const auto& [name, file] : aSource.m_files )
184 {
185 if( aExcludedNames.count( file->name ) )
186 continue;
187
188 filtered[name] = file;
189 }
190
191 m_files = std::move( filtered );
192}
193
194
196{
197 for( auto it = m_files.begin(); it != m_files.end(); )
198 {
199 if( it->second->type == EMBEDDED_FILE::FILE_TYPE::FONT )
200 it = m_files.erase( it );
201 else
202 ++it;
203 }
204}
205
206
207// Write the collection of files to a disk file in the specified format
208void EMBEDDED_FILES::WriteEmbeddedFiles( OUTPUTFORMATTER& aOut, bool aWriteData ) const
209{
210 ssize_t MIME_BASE64_LENGTH = 76;
211 aOut.Print( "(embedded_files " );
212
213 for( const auto& [name, entry] : m_files )
214 {
215 const EMBEDDED_FILE& file = *entry;
216
217 // Skip empty files
218 if( file.compressedEncodedData.empty() )
219 {
220 continue;
221 }
222
223 aOut.Print( "(file " );
224 aOut.Print( "(name %s)", aOut.Quotew( file.name ).c_str() );
225
226 const char* type = nullptr;
227
228 switch( file.type )
229 {
230 case EMBEDDED_FILE::FILE_TYPE::DATASHEET: type = "datasheet"; break;
231 case EMBEDDED_FILE::FILE_TYPE::FONT: type = "font"; break;
232 case EMBEDDED_FILE::FILE_TYPE::MODEL: type = "model"; break;
233 case EMBEDDED_FILE::FILE_TYPE::WORKSHEET: type = "worksheet"; break;
234 default: type = "other"; break;
235 }
236
237 aOut.Print( "(type %s)", type );
238
239 if( aWriteData )
240 {
241 aOut.Print( "(data" );
242
243 size_t first = 0;
244
245 while( first < file.compressedEncodedData.length() )
246 {
247 ssize_t remaining = file.compressedEncodedData.length() - first;
248 int length = std::min( remaining, MIME_BASE64_LENGTH );
249
250 std::string_view view( file.compressedEncodedData.data() + first, length );
251
252 aOut.Print( "\n%1s%.*s%s\n", first ? "" : "|", length, view.data(),
253 remaining == length ? "|" : "" );
254 first += MIME_BASE64_LENGTH;
255 }
256
257 aOut.Print( ")" ); // Close data
258 }
259
260 aOut.Print( "(checksum %s)", aOut.Quotew( file.data_hash ).c_str() );
261 aOut.Print( ")" ); // Close file
262 }
263
264 aOut.Print( ")" ); // Close embedded_files
265}
266
267
268// Compress and Base64 encode data
270{
271 std::vector<char> compressedData;
272 size_t estCompressedSize = ZSTD_compressBound( aFile.decompressedData.size() );
273 compressedData.resize( estCompressedSize );
274 size_t compressedSize = ZSTD_compress( compressedData.data(), estCompressedSize,
275 aFile.decompressedData.data(),
276 aFile.decompressedData.size(), 15 );
277
278 if( ZSTD_isError( compressedSize ) )
279 {
280 compressedData.clear();
282 }
283
284 const size_t dstLen = wxBase64EncodedSize( compressedSize );
285 aFile.compressedEncodedData.resize( dstLen );
286 size_t retval = wxBase64Encode( aFile.compressedEncodedData.data(), dstLen,
287 compressedData.data(), compressedSize );
288
289 if( retval != dstLen )
290 {
291 aFile.compressedEncodedData.clear();
293 }
294
296 hash.add( aFile.decompressedData );
297 aFile.data_hash = hash.digest().ToString();
298
299 return RETURN_CODE::OK;
300}
301
302
303// Decompress and Base64 decode data
305{
306 std::vector<char> compressedData;
307 size_t compressedSize = wxBase64DecodedSize( aFile.compressedEncodedData.size() );
308
309 if( compressedSize == 0 )
310 {
311 wxLogTrace( wxT( "KICAD_EMBED" ),
312 wxT( "%s:%s:%d\n * Base64DecodedSize failed for file '%s' with size %zu" ),
313 __FILE__, __FUNCTION__, __LINE__, aFile.name,
314 aFile.compressedEncodedData.size() );
316 }
317
318 compressedData.resize( compressedSize );
319 void* compressed = compressedData.data();
320
321 // The return value from wxBase64Decode is the actual size of the decoded data avoiding
322 // the modulo 4 padding of the base64 encoding
323 compressedSize = wxBase64Decode( compressed, compressedSize, aFile.compressedEncodedData );
324
325 unsigned long long estDecompressedSize = ZSTD_getFrameContentSize( compressed, compressedSize );
326
327 if( estDecompressedSize > 1e9 ) // Limit to 1GB
329
330 if( estDecompressedSize == ZSTD_CONTENTSIZE_ERROR
331 || estDecompressedSize == ZSTD_CONTENTSIZE_UNKNOWN )
332 {
334 }
335
336 aFile.decompressedData.resize( estDecompressedSize );
337 void* decompressed = aFile.decompressedData.data();
338
339 size_t decompressedSize = ZSTD_decompress( decompressed, estDecompressedSize,
340 compressed, compressedSize );
341
342 if( ZSTD_isError( decompressedSize ) )
343 {
344 wxLogTrace( wxT( "KICAD_EMBED" ),
345 wxT( "%s:%s:%d\n * ZSTD_decompress failed with error '%s'" ),
346 __FILE__, __FUNCTION__, __LINE__, ZSTD_getErrorName( decompressedSize ) );
347 aFile.decompressedData.clear();
349 }
350
351 aFile.decompressedData.resize( decompressedSize );
352
354 hash.add( aFile.decompressedData );
355 std::string new_hash = hash.digest().ToString();
356
357 if( aFile.data_hash.length() == 64 )
358 {
359 // SHA-256 hash from older file formats
360 std::string sha_hash;
361 picosha2::hash256_hex_string( aFile.decompressedData, sha_hash );
362
363 if( sha_hash != aFile.data_hash )
364 {
365 wxLogTrace( wxT( "KICAD_EMBED" ),
366 wxT( "%s:%s:%d\n * Checksum error in embedded file '%s'" ),
367 __FILE__, __FUNCTION__, __LINE__, aFile.name );
368 aFile.decompressedData.clear();
370 }
371 }
372 else if( new_hash != aFile.data_hash )
373 {
374 // Current MMH3 hash didn't match. Try the V1 hash algorithm for files
375 // saved before the tail-byte alignment fix.
377 v1hash.addDataV1( reinterpret_cast<const uint8_t*>( aFile.decompressedData.data() ),
378 aFile.decompressedData.size() );
379 std::string v1_hash = v1hash.digest().ToString();
380
381 if( v1_hash != aFile.data_hash )
382 {
383 wxLogTrace( wxT( "KICAD_EMBED" ),
384 wxT( "%s:%s:%d\n * Checksum error in embedded file '%s'" ),
385 __FILE__, __FUNCTION__, __LINE__, aFile.name );
386 aFile.decompressedData.clear();
388 }
389 }
390
391 aFile.data_hash = new_hash;
392
393 return RETURN_CODE::OK;
394}
395
396
398 std::string& aHash )
399{
400 wxFFileInputStream file( aFileName.GetFullPath() );
401
402 if( !file.IsOk() )
404
405 wxFileOffset length = file.GetLength();
406 std::vector<char> data( length );
407
408 if( !data.data() )
410
411 char* dataPtr = data.data();
412 wxFileOffset totalRead = 0;
413
414 while( !file.Eof() && totalRead < length )
415 {
416 file.Read( dataPtr, length - totalRead );
417 size_t bytesRead = file.LastRead();
418 dataPtr += bytesRead;
419 totalRead += bytesRead;
420 }
421
423 hash.add( data );
424 aHash = hash.digest().ToString();
425
426 return RETURN_CODE::OK;
427}
428
429
430// Parsing method
432{
433 // embedded files are version 20240706 and uses also Bars as separator
434 SetKnowsBar( true );
435
436 if( !aFiles )
437 THROW_PARSE_ERROR( "No embedded files object provided", CurSource(), CurLine(),
438 CurLineNumber(), CurOffset() );
439
440 using namespace EMBEDDED_FILES_T;
441
442 std::unique_ptr<EMBEDDED_FILES::EMBEDDED_FILE> file( nullptr );
443
444 for( T token = NextTok(); token != T_RIGHT; token = NextTok() )
445 {
446 if( token != T_LEFT )
447 Expecting( T_LEFT );
448
449 token = NextTok();
450
451 if( token != T_file )
452 Expecting( "file" );
453
454 if( file )
455 {
456 if( !file->compressedEncodedData.empty() )
457 {
460 {
461 THROW_PARSE_ERROR( "Checksum error in embedded file " + file->name,
462 CurSource(), CurLine(), CurLineNumber(), CurOffset() );
463 }
464 }
465
466 aFiles->AddFile( file.release() );
467 }
468
469 file = std::unique_ptr<EMBEDDED_FILES::EMBEDDED_FILE>( nullptr );
470
471 for( token = NextTok(); token != T_RIGHT; token = NextTok() )
472 {
473 if( token != T_LEFT )
474 Expecting( T_LEFT );
475
476 token = NextTok();
477
478 switch( token )
479 {
480 case T_checksum:
481 if( !file )
482 Expecting( T_name );
483
484 NeedSYMBOLorNUMBER();
485
486 if( !IsSymbol( token ) )
487 Expecting( "checksum data" );
488
489 file->data_hash = CurStr();
490 NeedRIGHT();
491 break;
492
493 case T_data:
494 if( !file )
495 Expecting( T_name);
496
497 try
498 {
499 NeedBAR();
500 }
501 catch( const PARSE_ERROR& e )
502 {
503 // No data in the file -- due to bug in writer for 9.0.0
504 if( curTok == T_RIGHT )
505 break;
506 else
507 throw e;
508 }
509 catch( ... )
510 {
511 throw;
512 }
513
514 token = NextTok();
515
516 file->compressedEncodedData.reserve( 1 << 17 );
517
518 while( token != T_BAR )
519 {
520 if( !IsSymbol( token ) )
521 Expecting( "base64 file data" );
522
523 file->compressedEncodedData += CurStr();
524 token = NextTok();
525 }
526
527 file->compressedEncodedData.shrink_to_fit();
528
529 NeedRIGHT();
530 break;
531
532 case T_name:
533 if( file )
534 {
535 wxLogTrace( wxT( "KICAD_EMBED" ),
536 wxT( "Duplicate 'name' tag in embedded file %s" ), file->name );
537 }
538
539 NeedSYMBOLorNUMBER();
540
541 file = std::make_unique<EMBEDDED_FILES::EMBEDDED_FILE>();
542 file->name = CurStr();
543 NeedRIGHT();
544
545 break;
546
547 case T_type:
548 if( !file )
549 Expecting( T_name );
550
551 token = NextTok();
552
553 switch( token )
554 {
555 case T_datasheet: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::DATASHEET; break;
556 case T_font: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::FONT; break;
557 case T_model: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::MODEL; break;
558 case T_worksheet: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::WORKSHEET; break;
559 case T_other: file->type = EMBEDDED_FILES::EMBEDDED_FILE::FILE_TYPE::OTHER; break;
560 default: Expecting( "datasheet, font, model, worksheet or other" ); break;
561 }
562
563 NeedRIGHT();
564 break;
565
566 default:
567 Expecting( "checksum, data or name" );
568 }
569 }
570 }
571
572 // Add the last file in the collection
573 if( file )
574 {
575 if( !file->compressedEncodedData.empty() )
576 {
579 {
580 THROW_PARSE_ERROR( "Checksum error in embedded file " + file->name,
581 CurSource(), CurLine(), CurLineNumber(), CurOffset() );
582 }
583 }
584
585 aFiles->AddFile( file.release() );
586 }
587}
588
589
590wxFileName EMBEDDED_FILES::GetTemporaryFileName( const wxString& aName ) const
591{
592 wxFileName cacheFile;
593
594 auto it = m_files.find( aName );
595
596 if( it == m_files.end() )
597 return cacheFile;
598
599 cacheFile.AssignDir( PATHS::GetUserCachePath() );
600 cacheFile.AppendDir( wxT( "embed" ) );
601
602 if( !PATHS::EnsurePathExists( cacheFile.GetFullPath() ) )
603 {
604 wxLogTrace( wxT( "KICAD_EMBED" ),
605 wxT( "%s:%s:%d\n * failed to create embed cache directory '%s'" ),
606 __FILE__, __FUNCTION__, __LINE__, cacheFile.GetPath() );
607
608 cacheFile.SetPath( wxFileName::GetTempDir() );
609 }
610
611 wxFileName inputName( aName );
612
613 // Store the cache file name using the data hash to allow for shared data between
614 // multiple projects using the same files as well as deconflicting files with the same name
615 cacheFile.SetName( "kicad_embedded_" + it->second->data_hash );
616 cacheFile.SetExt( inputName.GetExt() );
617
618 if( cacheFile.FileExists() && cacheFile.IsFileReadable() )
619 return cacheFile;
620
621 wxFFileOutputStream out( cacheFile.GetFullPath() );
622
623 if( !out.IsOk() )
624 {
625 cacheFile.Clear();
626 return cacheFile;
627 }
628
629 out.Write( it->second->decompressedData.data(), it->second->decompressedData.size() );
630
631 return cacheFile;
632}
633
634
635const std::vector<wxString>* EMBEDDED_FILES::GetFontFiles() const
636{
637 return &m_fontFiles;
638}
639
640
641const std::vector<wxString>* EMBEDDED_FILES::UpdateFontFiles()
642{
643 m_fontFiles.clear();
644
645 for( const auto& [name, entry] : m_files )
646 {
647 if( entry->type == EMBEDDED_FILE::FILE_TYPE::FONT )
648 m_fontFiles.push_back( GetTemporaryFileName( name ).GetFullPath() );
649 }
650
651 return &m_fontFiles;
652}
653
654
655// Move constructor
657 m_files( std::move( other.m_files ) ),
658 m_fontFiles( std::move( other.m_fontFiles ) ),
659 m_fileAddedCallback( std::move( other.m_fileAddedCallback ) ),
660 m_embedFonts( other.m_embedFonts )
661{
662 other.m_embedFonts = false;
663}
664
665
666// Move assignment operator
668{
669 if (this != &other)
670 {
672 m_files = std::move( other.m_files );
673 m_fontFiles = std::move( other.m_fontFiles );
674 m_fileAddedCallback = std::move( other.m_fileAddedCallback );
675 m_embedFonts = other.m_embedFonts;
676 other.m_embedFonts = false;
677 }
678
679 return *this;
680}
681
682
683// Copy constructor
684//
685// Shares ownership of the underlying EMBEDDED_FILE payloads via shared_ptr so that cloning a
686// container that transitively holds embedded files (e.g. a FOOTPRINT being snapshotted into the
687// undo stack) does not duplicate large blobs such as embedded 3D models. Mutations applied
688// through raw EMBEDDED_FILE* pointers obtained from one collection will be visible to other
689// collections that share the same shared_ptr; callers that require an isolated mutable copy
690// should construct a new EMBEDDED_FILE explicitly.
698
699
700EMBEDDED_FILES::EMBEDDED_FILES( const EMBEDDED_FILES& other, bool aDeepCopy ) :
703{
704 if( aDeepCopy )
705 {
706 // True deep copy is requested. Allocate a fresh EMBEDDED_FILE for each entry so that
707 // subsequent mutations through this collection cannot affect the source collection.
708 for( const auto& [name, file] : other.m_files )
709 m_files[name] = std::make_shared<EMBEDDED_FILE>( *file );
710
711 m_fontFiles = other.m_fontFiles;
712 }
713}
714
715
716// Copy assignment operator
717//
718// Assignment performs a deep copy (in contrast to the copy constructor, which shares ownership
719// of payloads). Assignment is used by callers such as FOOTPRINT::operator= and
720// LIB_SYMBOL::operator= where the destination is a live, separately editable object that may
721// later mutate EMBEDDED_FILE fields through raw pointers; aliasing would let those mutations
722// silently bleed into the source. The cheap-clone path for FOOTPRINT::Clone() goes through the
723// copy constructor instead.
725{
726 if( this != &other )
727 {
728 m_files.clear();
729
730 for( const auto& [name, file] : other.m_files )
731 m_files[name] = std::make_shared<EMBEDDED_FILE>( *file );
732
733 m_fontFiles = other.m_fontFiles;
736 }
737
738 return *this;
739}
const char * name
void ParseEmbedded(EMBEDDED_FILES *aFiles)
std::vector< wxString > m_fontFiles
void RemoveFile(const wxString &name, bool aErase=true)
Remove a file from the collection and frees the memory.
@ OUT_OF_MEMORY
Could not allocate memory.
@ FILE_NOT_FOUND
File not found on disk.
@ CHECKSUM_ERROR
Checksum in file does not match data.
wxFileName GetTemporaryFileName(const wxString &aName) const
void WriteEmbeddedFiles(OUTPUTFORMATTER &aOut, bool aWriteData) const
Output formatter for the embedded files.
const std::vector< wxString > * UpdateFontFiles()
Helper function to get a list of fonts for fontconfig to add to the library.
FILE_ADDED_CALLBACK m_fileAddedCallback
static RETURN_CODE DecompressAndDecode(EMBEDDED_FILE &aFile)
Takes data from the #compressedEncodedData buffer and Base64 decodes it.
static RETURN_CODE ComputeFileHash(const wxFileName &aFileName, std::string &aHash)
Compute the hash of a file on disk without fully embedding it.
bool HasFile(const wxString &name) const
void ClearEmbeddedFiles(bool aDeleteFiles=true)
void ClearEmbeddedFonts()
Remove all embedded fonts from the collection.
EMBEDDED_FILES & operator=(EMBEDDED_FILES &&other) noexcept
EMBEDDED_FILE * AddFile(const wxFileName &aName, bool aOverwrite)
Load a file from disk and adds it to the collection.
static uint32_t Seed()
const std::vector< wxString > * GetFontFiles() const
If we just need the cached version of the font files, we can use this function which is const and wil...
std::map< wxString, std::shared_ptr< EMBEDDED_FILE > > m_files
EMBEDDED_FILES()=default
static RETURN_CODE CompressAndEncode(EMBEDDED_FILE &aFile)
Take data from the #decompressedData buffer and compresses it using ZSTD into the #compressedEncodedD...
bool m_embedFonts
If set, fonts will be embedded in the element on save.
void AssignSharedFrom(const EMBEDDED_FILES &aSource, const std::set< wxString > &aExcludedNames={})
Replace this collection's files with references to aSource's files, skipping any whose name appears i...
A streaming C++ equivalent for MurmurHash3_x64_128.
Definition mmh3_hash.h:56
FORCE_INLINE void addDataV1(const uint8_t *data, size_t length)
Definition mmh3_hash.h:95
FORCE_INLINE void add(const std::string &input)
Definition mmh3_hash.h:117
FORCE_INLINE HASH_128 digest()
Definition mmh3_hash.h:136
An interface used to output 8 bit text in a convenient way.
Definition richio.h:291
std::string Quotew(const wxString &aWrapee) const
Definition richio.cpp:503
int PRINTF_FUNC_N Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition richio.cpp:418
static bool EnsurePathExists(const wxString &aPath, bool aPathToFile=false)
Attempts to create a given path if it does not exist.
Definition paths.cpp:518
static wxString GetUserCachePath()
Gets the stock (install) 3d viewer plugins path.
Definition paths.cpp:460
static const std::string KiCadUriPrefix
#define THROW_PARSE_ERROR(aProblem, aSource, aInputLine, aLineNumber, aByteIndex)
#define MIME_BASE64_LENGTH
std::vector< char > decompressedData
std::string ToString() const
Definition hash_128.h:43
A filename or source description, a problem input line, a line number, a byte offset,...
wxString result
Test unit parsing edge cases and error handling.
Definition of file extensions used in Kicad.