get the first word (separated by whitespace) from string data and place that in word then remove that word from string data
| 136 | //get the first word (separated by whitespace) from string data and place that in word |
| 137 | //then remove that word from string data |
| 138 | static bool GetWord(std::string& data, std::string& word) |
| 139 | { |
| 140 | std::stringstream datastream(data); |
| 141 | std::string end; |
| 142 | |
| 143 | datastream >> word; |
| 144 | if (datastream.fail()) |
| 145 | { |
| 146 | data.clear(); |
| 147 | return false; |
| 148 | } |
| 149 | |
| 150 | size_t pos = data.find(word) + word.length(); |
| 151 | |
| 152 | if (pos >= data.length()) |
| 153 | { |
| 154 | data.clear(); |
| 155 | return true; |
| 156 | } |
| 157 | |
| 158 | data = data.substr(pos); |
| 159 | |
| 160 | datastream.clear(); |
| 161 | datastream.str(data); |
| 162 | |
| 163 | datastream >> end; |
| 164 | if (datastream.fail()) |
| 165 | data.clear(); |
| 166 | |
| 167 | return true; |
| 168 | } |
| 169 | |
| 170 | static cec_logical_address GetAddressFromInput(std::string& arguments) |
| 171 | { |
no outgoing calls
no test coverage detected