MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / String

Class String

lite/load_and_run/src/helpers/common.h:172–187  ·  view source on GitHub ↗

* class for string option */

Source from the content-addressed store, hash-verified

170 * class for string option
171 */
172struct String final : public Value {
173 String(std::string v) : m_val(v), m_default_val(v) {}
174 static std::shared_ptr<String> make(const std::string& v) {
175 return std::make_shared<String>(v);
176 }
177 void set_value(const std::string& v) { m_val = v; }
178 std::string& get_value() { return m_val; }
179 std::string get_default() { return m_default_val; }
180 void reset_value() override { m_val = m_default_val; }
181 JsonValueType get_type() const override { return JsonValueType::String; }
182 std::string type_string() const override { return "String"; }
183
184private:
185 std::string m_val;
186 std::string m_default_val;
187};
188
189using OptionValMap = std::unordered_map<std::string, std::shared_ptr<lar::Value>>;
190

Callers 6

encode_single_optionsFunction · 0.70
encodeMethod · 0.70
build_infoMethod · 0.50
get_io_infoMethod · 0.50
get_io_infoMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected