MCPcopy Create free account
hub / github.com/KLayout/klayout / from_string

Method from_string

src/laybasic/laybasic/layMargin.cc:72–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72Margin
73Margin::from_string (const std::string &s)
74{
75 Margin res;
76
77 tl::Extractor ex (s.c_str ());
78 if (ex.test ("*")) {
79 double v = 0.0;
80 ex.read (v);
81 res.set_relative_mode (true);
82 res.set_relative_value (v);
83 if (! ex.at_end ()) {
84 ex.read (v);
85 res.set_absolute_value (v);
86 }
87 } else {
88 double v = 0.0;
89 ex.read (v);
90 res.set_relative_mode (false);
91 res.set_absolute_value (v);
92 if (ex.test ("*")) {
93 ex.read (v);
94 res.set_relative_value (v);
95 }
96 }
97
98 return res;
99}
100
101double
102Margin::get (double dim) const

Callers 6

configureMethod · 0.45
add_stipple2Function · 0.45
add_line_style2Function · 0.45
config_getFunction · 0.45
configureMethod · 0.45
configureMethod · 0.45

Calls 4

c_strMethod · 0.45
testMethod · 0.45
readMethod · 0.45
at_endMethod · 0.45

Tested by

no test coverage detected