MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / split_long

Function split_long

simcore/framework/src/cli/cli.hpp:1854–1867  ·  view source on GitHub ↗

Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true

Source from the content-addressed store, hash-verified

1852
1853// Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true
1854inline bool split_long(const std::string &current, std::string &name, std::string &value) {
1855 if (current.size() > 2 && current.substr(0, 2) == "--" && valid_first_char(current[2])) {
1856 auto loc = current.find_first_of('=');
1857 if (loc != std::string::npos) {
1858 name = current.substr(2, loc - 2);
1859 value = current.substr(loc + 1);
1860 } else {
1861 name = current.substr(2);
1862 value = "";
1863 }
1864 return true;
1865 }
1866 return false;
1867}
1868
1869// Returns false if not a windows style option. Otherwise, sets opt name and value and returns true
1870inline bool split_windows_style(const std::string &current, std::string &name, std::string &value) {

Callers 2

_recognizeMethod · 0.85
_parse_argMethod · 0.85

Calls 3

valid_first_charFunction · 0.85
find_first_ofMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected