26#include <wx/filename.h>
132 EMBEDDED_FILE* AddFile(
const wxFileName& aName,
bool aOverwrite );
137 void AddFile( EMBEDDED_FILE* aFile );
144 void RemoveFile(
const wxString&
name,
bool aErase =
true );
154 void WriteEmbeddedFiles(
OUTPUTFORMATTER& aOut,
bool aWriteData )
const;
169 wxFileName fileName(
name );
194 const std::vector<wxString>* UpdateFontFiles();
200 const std::vector<wxString>* GetFontFiles()
const;
205 void ClearEmbeddedFonts();
214 static RETURN_CODE CompressAndEncode( EMBEDDED_FILE& aFile );
222 static RETURN_CODE DecompressAndDecode( EMBEDDED_FILE& aFile );
229 auto it =
m_files.find( aName );
231 return it ==
m_files.end() ? nullptr : it->second;
239 wxFileName GetTemporaryFileName(
const wxString& aName )
const;
256 virtual std::set<KIFONT::OUTLINE_FONT*>
GetFonts()
const
258 return std::set<KIFONT::OUTLINE_FONT*>();
std::vector< wxString > m_fontFiles
virtual void EmbedFonts()
void SetFileAddedCallback(FILE_ADDED_CALLBACK callback)
@ PERMISSIONS_ERROR
Could not read/write file.
@ FILE_ALREADY_EXISTS
File already exists in the collection.
@ OUT_OF_MEMORY
Could not allocate memory.
@ FILE_NOT_FOUND
File not found on disk.
@ CHECKSUM_ERROR
Checksum in file does not match data.
EMBEDDED_FILE * GetEmbeddedFile(const wxString &aName) const
Returns the embedded file with the given name or nullptr if it does not exist.
FILE_ADDED_CALLBACK m_fileAddedCallback
wxString GetEmbeddedFileLink(const EMBEDDED_FILE &aFile) const
Return the link for an embedded file.
bool HasFile(const wxString &name) const
virtual void RunOnNestedEmbeddedFiles(const std::function< void(EMBEDDED_FILES *)> &aFunction)
Provide access to nested embedded files, such as symbols in schematics and footprints in boards.
void ClearEmbeddedFiles(bool aDeleteFiles=true)
virtual std::set< KIFONT::OUTLINE_FONT * > GetFonts() const
wxFileName GetTemporaryFileName(EMBEDDED_FILE *aFile) const
const std::map< wxString, EMBEDDED_FILE * > & EmbeddedFileMap() const
void SetAreFontsEmbedded(bool aEmbedFonts)
std::function< void(EMBEDDED_FILE *)> FILE_ADDED_CALLBACK
FILE_ADDED_CALLBACK GetFileAddedCallback() const
std::map< wxString, EMBEDDED_FILE * > m_files
bool m_embedFonts
If set, fonts will be embedded in the element on save.
bool GetAreFontsEmbedded() const
Class OUTLINE_FONT implements outline font drawing.
A streaming C++ equivalent for MurmurHash3_x64_128.
FORCE_INLINE void add(const std::string &input)
FORCE_INLINE HASH_128 digest()
static const std::string KiCadUriPrefix
std::vector< char > decompressedData
std::string compressedEncodedData
Definition of file extensions used in Kicad.