OdbDesignLib
OdbDesign ODB++ Parsing Library
 
Loading...
Searching...
No Matches
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 "symbolname.pb.h"
12
13// TODO: add SymbolName serialization
14
15namespace 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 int GetIndex() const;
24 UnitType GetUnitType() const;
25 void ApplyDefaultUnitTypeIfNone(UnitType unitType);
26
27 bool Parse(const std::filesystem::path& path, const std::string& line, int lineNumber);
28
29 // Inherited via IProtoBuffable
30 std::unique_ptr<Odb::Lib::Protobuf::SymbolName> to_protobuf() const override;
31 void from_protobuf(const Odb::Lib::Protobuf::SymbolName& message) override;
32
33 typedef std::vector<std::shared_ptr<SymbolName>> Vector;
34 typedef std::map<std::string, std::shared_ptr<SymbolName>> StringMap;
35
36 private:
37 std::string m_name;
38 UnitType m_unitType;
39 int m_index;
40
41 };
42}
43