MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / AddConstant

Method AddConstant

lib/mdflib/mdflib/src/hdcomment.cpp:113–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void HdComment::AddConstant(MdString constant, std::string expression) {
114
115 if (constant.Text().empty()) {
116 MDF_ERROR() << "An empty constant are not allowed";
117 return;
118 }
119 if (const auto itr = constant_list_.find(constant);
120 itr != constant_list_.cend() ) {
121 MDF_ERROR()
122 << "A duplicate constant have been found. Constant/Expression: "
123 << constant.Text() << "/" << expression;
124 return;
125 }
126 constant_list_.emplace(std::move(constant), std::move(expression));
127}
128
129const MdConstantList& HdComment::Constants() const {
130 return constant_list_;

Callers 2

TESTFunction · 0.80
TEST_FFunction · 0.80

Calls 4

emptyMethod · 0.80
findMethod · 0.80
cendMethod · 0.80
TextMethod · 0.45

Tested by 2

TESTFunction · 0.64
TEST_FFunction · 0.64