OdbDesignLib
OdbDesign ODB++ Parsing Library
 
Loading...
Searching...
No Matches
LayerDirectory.h
1#pragma once
2
3#include <string>
4#include <map>
5#include <memory>
6#include <filesystem>
7#include "../../odbdesign_export.h"
8#include "ComponentsFile.h"
9#include "../../IProtoBuffable.h"
10#include "layerdirectory.pb.h"
11#include "FeaturesFile.h"
12#include "AttrListFile.h"
13#include "ToolsFile.h"
14#include "../ISaveable.h"
15
16
17namespace Odb::Lib::FileModel::Design
18{
19 class ODBDESIGN_EXPORT LayerDirectory : public IProtoBuffable<Odb::Lib::Protobuf::LayerDirectory>, public ISaveable
20 {
21 public:
22 LayerDirectory(std::filesystem::path path);
23 virtual ~LayerDirectory();
24
25 std::string GetName() const;
26 std::filesystem::path GetPath() const;
27
28 bool Parse();
29 // Inherited via ISaveable
30 bool Save(const std::filesystem::path& directory) override;
31
32 bool ParseComponentsFile(std::filesystem::path directory);
33 bool ParseFeaturesFile(std::filesystem::path directory);
34 bool ParseAttrListFile(std::filesystem::path directory);
35 bool ParseToolsFile(std::filesystem::path directory);
36
37 const ComponentsFile& GetComponentsFile() const;
38 const FeaturesFile& GetFeaturesFile() const;
39 const AttrListFile& GetAttrListFile() const;
40 const ToolsFile& GetToolsFile() const;
41
42 typedef std::map<std::string, std::shared_ptr<LayerDirectory>> StringMap;
43
44 // Inherited via IProtoBuffable
45 std::unique_ptr<Odb::Lib::Protobuf::LayerDirectory> to_protobuf() const override;
46 void from_protobuf(const Odb::Lib::Protobuf::LayerDirectory& message) override;
47
48 private:
49 std::string m_name;
50 std::filesystem::path m_path;
51
52 ComponentsFile m_componentsFile;
53 FeaturesFile m_featuresFile;
54 AttrListFile m_attrListFile;
55 ToolsFile m_toolFile;
56
57 };
58}