MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / GetWord

Function GetWord

src/cec-client/cec-client.cpp:138–168  ·  view source on GitHub ↗

get the first word (separated by whitespace) from string data and place that in word then remove that word from string data

Source from the content-addressed store, hash-verified

136//get the first word (separated by whitespace) from string data and place that in word
137//then remove that word from string data
138static 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
170static cec_logical_address GetAddressFromInput(std::string& arguments)
171{

Callers 12

GetAddressFromInputFunction · 0.85
ProcessCommandSPFunction · 0.85
ProcessCommandONFunction · 0.85
ProcessCommandSTANDBYFunction · 0.85
ProcessCommandPOLLFunction · 0.85
ProcessCommandPFunction · 0.85
ProcessCommandPAFunction · 0.85
ProcessCommandOSDFunction · 0.85
ProcessCommandMONFunction · 0.85
ProcessCommandATFunction · 0.85
ProcessCommandLOGFunction · 0.85
ProcessConsoleCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected