13 #define ZUTILS_E_NOAT (-100)
14 #define ZUTILS_E_NOSP (-101)
15 #define ZUTILS_E_BADADD (-102)
16 #define ZUTILS_E_SERIALSIZE (-103)
31 std::vector<std::string> & serial,
32 const std::string & response
35 size_t at = response.find(
'@', 0);
37 if(at == std::string::npos)
42 while(at != std::string::npos)
44 size_t sp = response.find(
' ', at);
46 if(sp == std::string::npos)
56 int add = std::stoi( response.substr(at+1, sp-at-1));
58 address.push_back(add);
60 at = response.find(
'@', at+1);
62 sp = response.rfind(
' ', at);
63 size_t ed = response.find_first_of(
"\n@", sp);
64 if(ed == std::string::npos) ed = response.size();
71 std::string ser = response.substr(sp+1, ed - sp-1);
73 serial.push_back(ser);
int parseSystemSerial(std::vector< int > &address, std::vector< std::string > &serial, const std::string &response)
Parse the system.serial query.
#define ZUTILS_E_SERIALSIZE