24#ifndef DESIGN_BLOCK_IO_H
25#define DESIGN_BLOCK_IO_H
40 DESIGN_BLOCK_FILE_UNKNOWN = 0,
46 static const wxString ShowType( DESIGN_BLOCK_FILE_T aFileType );
48 static DESIGN_BLOCK_FILE_T EnumFromStr(
const wxString& aFileType );
49 static DESIGN_BLOCK_FILE_T GuessPluginTypeFromLibPath(
const wxString& aLibPath,
int aCtl = 0 );
53 static bool ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps,
54 const wxString& aOldFilePath,
const wxString& aNewFilePath );
64 long long GetLibraryTimestamp(
const wxString& aLibraryPath )
const;
66 void DesignBlockEnumerate( wxArrayString& aDesignBlockNames,
const wxString& aLibraryPath,
68 const std::map<std::string, UTF8>* aProperties =
nullptr );
72 const std::map<std::string, UTF8>* aProperties =
nullptr )
74 return DesignBlockLoad( aLibraryPath, aDesignBlockName,
false, aProperties );
78 const std::map<std::string, UTF8>* aProperties =
nullptr )
80 return DesignBlockLoad( aLibraryPath, aDesignBlockName,
true, aProperties ) !=
nullptr;
84 wxString& aDesignBlockNameOut,
85 const std::map<std::string, UTF8>* aProperties =
nullptr )
90 void CreateLibrary(
const wxString& aLibraryPath,
91 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
93 virtual bool DeleteLibrary(
const wxString& aLibraryPath,
94 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
97 bool IsLibraryWritable(
const wxString& aLibraryPath )
override;
99 DESIGN_BLOCK* DesignBlockLoad(
const wxString& aLibraryPath,
const wxString& aDesignBlockName,
100 bool aKeepUUID =
false,
101 const std::map<std::string, UTF8>* aProperties =
nullptr );
103 void DesignBlockSave(
const wxString& aLibraryPath,
const DESIGN_BLOCK* aDesignBlock,
104 const std::map<std::string, UTF8>* aProperties =
nullptr );
106 void DesignBlockDelete(
const wxString& aLibraryPath,
const wxString& aDesignBlockName,
107 const std::map<std::string, UTF8>* aProperties =
nullptr );
110 const std::map<std::string, UTF8>* aProperties =
nullptr )
@ KICAD_SEXP
S-expression KiCad file format.
bool DesignBlockExists(const wxString &aLibraryPath, const wxString &aDesignBlockName, const std::map< std::string, UTF8 > *aProperties=nullptr)
virtual void PrefetchLib(const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr)
const DESIGN_BLOCK * GetEnumeratedDesignBlock(const wxString &aLibraryPath, const wxString &aDesignBlockName, const std::map< std::string, UTF8 > *aProperties=nullptr)
DESIGN_BLOCK * ImportDesignBlock(const wxString &aDesignBlockPath, wxString &aDesignBlockNameOut, const std::map< std::string, UTF8 > *aProperties=nullptr)
Container that describes file type info.