OdbDesignLib
OdbDesign ODB++ Parsing Library
SymbolName.h
1 #pragma once
2 
3 #include <vector>
4 #include <string>
5 #include <sstream>
6 #include <memory>
7 #include "../../enums.h"
8 #include "../../odbdesign_export.h"
9 #include "../parse_error.h"
10 #include "../../IProtoBuffable.h"
11 #include "../../ProtoBuf/symbolname.pb.h"
12 
13 // TODO: add SymbolName serialization
14 
15 namespace Odb::Lib::FileModel::Design
16 {
17  class ODBDESIGN_EXPORT SymbolName : public IProtoBuffable<Odb::Lib::Protobuf::SymbolName>
18  {
19  public:
20  SymbolName();
21 
22  std::string GetName() const;
23  UnitType GetUnitType() const;
24 
25  bool Parse(const std::filesystem::path& path, const std::string& line, int lineNumber);
26 
27  // Inherited via IProtoBuffable
28  std::unique_ptr<Odb::Lib::Protobuf::SymbolName> to_protobuf() const override;
29  void from_protobuf(const Odb::Lib::Protobuf::SymbolName& message) override;
30 
31  typedef std::vector<std::shared_ptr<SymbolName>> Vector;
32  typedef std::map<std::string, std::shared_ptr<SymbolName>> StringMap;
33 
34  private:
35  std::string m_name;
36  UnitType m_unitType;
37 
38  };
39 }