MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / OptionDetails

Class OptionDetails

Source/Utils/cxxopts.hpp:1228–1304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1226 class OptionAdder;
1227
1228 class OptionDetails
1229 {
1230 public:
1231 OptionDetails
1232 (
1233 std::string short_,
1234 std::string long_,
1235 String desc,
1236 std::shared_ptr<const Value> val
1237 )
1238 : m_short(std::move(short_))
1239 , m_long(std::move(long_))
1240 , m_desc(std::move(desc))
1241 , m_value(std::move(val))
1242 , m_count(0)
1243 {
1244 m_hash = std::hash<std::string>{}(m_long + m_short);
1245 }
1246
1247 OptionDetails(const OptionDetails& rhs)
1248 : m_desc(rhs.m_desc)
1249 , m_value(rhs.m_value->clone())
1250 , m_count(rhs.m_count)
1251 {
1252 }
1253
1254 OptionDetails(OptionDetails&& rhs) = default;
1255
1256 CXXOPTS_NODISCARD
1257 const String&
1258 description() const
1259 {
1260 return m_desc;
1261 }
1262
1263 CXXOPTS_NODISCARD
1264 const Value&
1265 value() const {
1266 return *m_value;
1267 }
1268
1269 CXXOPTS_NODISCARD
1270 std::shared_ptr<Value>
1271 make_storage() const
1272 {
1273 return m_value->clone();
1274 }
1275
1276 CXXOPTS_NODISCARD
1277 const std::string&
1278 short_name() const
1279 {
1280 return m_short;
1281 }
1282
1283 CXXOPTS_NODISCARD
1284 const std::string&
1285 long_name() const

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.80

Tested by

no test coverage detected