3 #include "../../odbdesign_export.h"
5 #include "StepDirectory.h"
6 #include "EdaDataFile.h"
9 #include "MiscInfoFile.h"
10 #include "MatrixFile.h"
11 #include "StandardFontsFile.h"
13 #include "../../IProtoBuffable.h"
14 #include "../../ProtoBuf/filearchive.pb.h"
15 #include "SymbolsDirectory.h"
16 #include "AttrListFile.h"
19 namespace Odb::Lib::FileModel::Design
27 std::string GetRootDir()
const;
28 std::string GetProductName()
const;
29 std::string GetFilename()
const;
30 std::string GetFilePath()
const;
32 const StepDirectory::StringMap& GetStepsByName()
const;
33 const SymbolsDirectory::StringMap& GetSymbolsDirectoriesByName()
const;
39 std::shared_ptr<StepDirectory> GetStepDirectory(
const std::string& stepName =
"")
const;
45 bool ParseFileModel();
48 std::unique_ptr<Odb::Lib::Protobuf::FileArchive> to_protobuf()
const override;
49 void from_protobuf(
const Odb::Lib::Protobuf::FileArchive& message)
override;
51 typedef std::vector<std::shared_ptr<FileArchive>> Vector;
52 typedef std::map<std::string, std::shared_ptr<FileArchive>> StringMap;
55 std::string m_rootDir;
56 std::string m_productName;
57 std::string m_filename;
58 std::string m_filePath;
60 StepDirectory::StringMap m_stepsByName;
64 SymbolsDirectory::StringMap m_symbolsDirectoriesByName;
67 bool ParseDesignDirectory(
const std::filesystem::path& path);
68 bool ParseStepDirectories(
const std::filesystem::path& path);
69 bool ParseMiscInfoFile(
const std::filesystem::path& path);
70 bool ParseMatrixFile(
const std::filesystem::path& path);
71 bool ParseStandardFontsFile(
const std::filesystem::path& path);
72 bool ParseSymbolsDirectories(
const std::filesystem::path& path);
73 bool ParseMiscAttrListFile(
const std::filesystem::path& path);
75 bool ExtractDesignArchive(
const std::filesystem::path& path, std::filesystem::path& extractedPath);
77 static std::string findRootDir(
const std::filesystem::path& extractedPath);
78 static bool pathContainsTopLevelDesignDirs(
const std::filesystem::path& path);
80 static inline constexpr
const char* TOPLEVEL_DESIGN_DIR_NAMES[] =