Returns false if not a windows style option. Otherwise, sets opt name and value and returns true
| 1868 | |
| 1869 | // Returns false if not a windows style option. Otherwise, sets opt name and value and returns true |
| 1870 | inline bool split_windows_style(const std::string ¤t, 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 |
| 1886 | inline std::vector<std::string> split_names(std::string current) { |
no test coverage detected