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

Function split_windows_style

simcore/framework/src/cli/cli.hpp:1870–1883  ·  view source on GitHub ↗

Returns false if not a windows style option. Otherwise, sets opt name and value and returns true

Source from the content-addressed store, hash-verified

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) {
1871 if (current.size() > 1 && current[0] == '/' && valid_first_char(current[1])) {
1872 auto loc = current.find_first_of(':');
1873 if (loc != std::string::npos) {
1874 name = current.substr(1, loc - 1);
1875 value = current.substr(loc + 1);
1876 } else {
1877 name = current.substr(1);
1878 value = "";
1879 }
1880 return true;
1881 }
1882 return false;
1883}
1884
1885// Splits a string into multiple long and short names
1886inline std::vector<std::string> split_names(std::string current) {

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