4 #ifndef ODBDESIGN_ATTRLISTFILE_H
5 #define ODBDESIGN_ATTRLISTFILE_H
10 #include "../../IProtoBuffable.h"
11 #include "../../ProtoBuf/attrlistfile.pb.h"
12 #include "../../odbdesign_export.h"
13 #include "../IStreamSaveable.h"
16 namespace Odb::Lib::FileModel::Design
23 typedef std::map<std::string, std::string> AttributeMap;
25 std::string GetUnits()
const;
26 const AttributeMap& GetAttributes()
const;
28 bool Parse(std::filesystem::path directory);
30 bool Save(std::ostream& os)
override;
33 std::unique_ptr<Odb::Lib::Protobuf::AttrListFile> to_protobuf()
const override;
34 void from_protobuf(
const Odb::Lib::Protobuf::AttrListFile& message)
override;
37 std::filesystem::path m_directory;
38 std::filesystem::path m_path;
40 AttributeMap m_attributesByName;
42 bool attributeValueIsOptional(
const std::string& attributeName)
const;
44 inline static const auto ATTRLIST_FILENAMES = {
"attrlist" };
45 inline static const char* OPTIONAL_ATTRIBUTES[] = {
"" };