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 );
54 static bool ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps,
55 const wxString& aOldFilePath,
const wxString& aNewFilePath );
65 long long GetLibraryTimestamp(
const wxString& aLibraryPath )
const;
67 void DesignBlockEnumerate( wxArrayString& aDesignBlockNames,
const wxString& aLibraryPath,
69 const std::map<std::string, UTF8>* aProperties =
nullptr );
73 const std::map<std::string, UTF8>* aProperties =
nullptr )
75 return DesignBlockLoad( aLibraryPath, aDesignBlockName,
false, aProperties );
79 const std::map<std::string, UTF8>* aProperties =
nullptr )
81 return DesignBlockLoad( aLibraryPath, aDesignBlockName,
true, aProperties ) !=
nullptr;
85 wxString& aDesignBlockNameOut,
86 const std::map<std::string, UTF8>* aProperties =
nullptr )
91 void CreateLibrary(
const wxString& aLibraryPath,
92 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
94 virtual bool DeleteLibrary(
const wxString& aLibraryPath,
95 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
98 bool IsLibraryWritable(
const wxString& aLibraryPath )
override;
100 DESIGN_BLOCK* DesignBlockLoad(
const wxString& aLibraryPath,
const wxString& aDesignBlockName,
101 bool aKeepUUID =
false,
102 const std::map<std::string, UTF8>* aProperties =
nullptr );
104 void DesignBlockSave(
const wxString& aLibraryPath,
const DESIGN_BLOCK* aDesignBlock,
105 const std::map<std::string, UTF8>* aProperties =
nullptr );
107 void DesignBlockDelete(
const wxString& aLibraryPath,
const wxString& aDesignBlockName,
108 const std::map<std::string, UTF8>* aProperties =
nullptr );
111 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.