OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
Loading...
Searching...
No Matches
PropertyRecord.cpp
Go to the documentation of this file.
1
#include "
PropertyRecord.h
"
2
#include "../../Text/Utf8Sanitizer.h"
3
4
namespace
Odb::Lib::FileModel::Design
5
{
6
// Inherited via IProtoBuffable
7
std::unique_ptr<Odb::Lib::Protobuf::PropertyRecord>
8
PropertyRecord::to_protobuf
()
const
9
{
10
std::unique_ptr<Odb::Lib::Protobuf::PropertyRecord> pPropertyRecordMessage(
new
Odb::Lib::Protobuf::PropertyRecord);
11
pPropertyRecordMessage->set_name(
Odb::Lib::Text::ToUtf8
(
name
));
12
pPropertyRecordMessage->set_value(
Odb::Lib::Text::ToUtf8
(
value
));
13
for
(
const
auto
& f :
floatValues
)
14
{
15
pPropertyRecordMessage->add_floatvalues(f);
16
}
17
return
pPropertyRecordMessage;
18
}
19
20
void
PropertyRecord::from_protobuf
(
const
Odb::Lib::Protobuf::PropertyRecord& message)
21
{
22
name
= message.name();
23
value
= message.value();
24
for
(
int
i = 0; i < message.floatvalues_size(); ++i)
25
{
26
floatValues
.push_back(message.floatvalues(i));
27
}
28
}
29
}
PropertyRecord.h
Odb::Lib::FileModel::Design
Definition
Constants.h:8
Odb::Lib::Text::ToUtf8
std::string ToUtf8(std::string_view input)
Converts input to valid UTF-8.
Definition
Utf8Sanitizer.cpp:354
Odb::Lib::FileModel::Design::PropertyRecord::name
std::string name
Definition
PropertyRecord.h:17
Odb::Lib::FileModel::Design::PropertyRecord::value
std::string value
Definition
PropertyRecord.h:18
Odb::Lib::FileModel::Design::PropertyRecord::to_protobuf
std::unique_ptr< Odb::Lib::Protobuf::PropertyRecord > to_protobuf() const override
Definition
PropertyRecord.cpp:8
Odb::Lib::FileModel::Design::PropertyRecord::floatValues
std::vector< double > floatValues
Definition
PropertyRecord.h:19
Odb::Lib::FileModel::Design::PropertyRecord::from_protobuf
void from_protobuf(const Odb::Lib::Protobuf::PropertyRecord &message) override
Definition
PropertyRecord.cpp:20
OdbDesignLib
FileModel
Design
PropertyRecord.cpp
Generated by
1.9.8