OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
Loading...
Searching...
No Matches
Part.cpp
Go to the documentation of this file.
1
#include "
Part.h
"
2
#include <string>
3
#include "part.pb.h"
4
#include <memory>
5
#include "../Text/Utf8Sanitizer.h"
6
7
namespace
Odb::Lib::ProductModel
8
{
9
Part::Part
(
const
std::string& name)
10
: m_name(name)
11
{
12
}
13
14
std::string
Part::GetName
()
const
15
{
16
return
m_name;
17
}
18
19
std::unique_ptr<Odb::Lib::Protobuf::ProductModel::Part>
Odb::Lib::ProductModel::Part::to_protobuf
()
const
20
{
21
auto
pPartMsg = std::make_unique<Odb::Lib::Protobuf::ProductModel::Part>();
22
pPartMsg->set_name(
Odb::Lib::Text::ToUtf8
(m_name));
23
return
pPartMsg;
24
}
25
26
void
Odb::Lib::ProductModel::Part::from_protobuf
(
const
Odb::Lib::Protobuf::ProductModel::Part& message)
27
{
28
m_name = message.name();
29
}
30
}
Part.h
Odb::Lib::ProductModel::Part::Part
Part(const std::string &name)
Definition
Part.cpp:9
Odb::Lib::ProductModel::Part::from_protobuf
void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Part &message) override
Definition
Part.cpp:26
Odb::Lib::ProductModel::Part::to_protobuf
std::unique_ptr< Odb::Lib::Protobuf::ProductModel::Part > to_protobuf() const override
Definition
Part.cpp:19
Odb::Lib::ProductModel::Part::GetName
std::string GetName() const
Definition
Part.cpp:14
Odb::Lib::ProductModel
Definition
Component.cpp:13
Odb::Lib::Text::ToUtf8
std::string ToUtf8(std::string_view input)
Converts input to valid UTF-8.
Definition
Utf8Sanitizer.cpp:354
OdbDesignLib
ProductModel
Part.cpp
Generated by
1.9.8