MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getExpressionString

Method getExpressionString

src/Gui/ExpressionBinding.cpp:146–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146std::string ExpressionBinding::getExpressionString(bool no_throw) const
147{
148 try {
149 if (!getExpression()) {
150 throw Base::RuntimeError("No expression found.");
151 }
152 return getExpression()->toString();
153 }
154 catch (Base::Exception& e) {
155 if (no_throw) {
156 FC_ERR("failed to get expression string: " << e.what());
157 }
158 else {
159 throw;
160 }
161 }
162 catch (std::exception& e) {
163 if (no_throw) {
164 FC_ERR("failed to get expression string: " << e.what());
165 }
166 else {
167 throw;
168 }
169 }
170 catch (...) {
171 if (no_throw) {
172 FC_ERR("failed to get expression string: unknown exception");
173 }
174 else {
175 throw;
176 }
177 }
178 return {};
179}
180
181std::string ExpressionBinding::getEscapedExpressionString() const
182{

Callers

nothing calls this directly

Calls 3

getExpressionFunction · 0.85
toStringMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected