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 );
78 bool DesignBlockExists(
const wxString& aLibraryPath,
const wxString& aDesignBlockName,
79 const std::map<std::string, UTF8>* aProperties =
nullptr );
82 wxString& aDesignBlockNameOut,
83 const std::map<std::string, UTF8>* aProperties =
nullptr )
88 void CreateLibrary(
const wxString& aLibraryPath,
89 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
91 virtual bool DeleteLibrary(
const wxString& aLibraryPath,
92 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
95 bool IsLibraryWritable(
const wxString& aLibraryPath )
override;
97 DESIGN_BLOCK* DesignBlockLoad(
const wxString& aLibraryPath,
const wxString& aDesignBlockName,
98 bool aKeepUUID =
false,
99 const std::map<std::string, UTF8>* aProperties =
nullptr );
101 void DesignBlockSave(
const wxString& aLibraryPath,
const DESIGN_BLOCK* aDesignBlock,
102 const std::map<std::string, UTF8>* aProperties =
nullptr );
104 void DesignBlockDelete(
const wxString& aLibraryPath,
const wxString& aDesignBlockName,
105 const std::map<std::string, UTF8>* aProperties =
nullptr );
@ KICAD_SEXP
S-expression KiCad file format.
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.