mirror of
https://github.com/HackHerz/pusher
synced 2025-12-06 02:10:19 +00:00
New version of the json library
This commit is contained in:
parent
34bd85a206
commit
bf4d174431
3 changed files with 8324 additions and 1985 deletions
10299
src/json/json.hpp
10299
src/json/json.hpp
File diff suppressed because it is too large
Load diff
|
|
@ -192,7 +192,7 @@ int main(int argc, char **argv)
|
||||||
if(devices[i].id.length() > idLength) { idLength = devices[i].id.length(); }
|
if(devices[i].id.length() > idLength) { idLength = devices[i].id.length(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
cout
|
cout
|
||||||
<< "ID\033[" << (idLength - 2 + 2) << "C"
|
<< "ID\033[" << (idLength - 2 + 2) << "C"
|
||||||
<< "Title\033[" << (titleLength - 5 + 2) << "C"
|
<< "Title\033[" << (titleLength - 5 + 2) << "C"
|
||||||
<< "Model" << endl;
|
<< "Model" << endl;
|
||||||
|
|
@ -202,9 +202,9 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
for(unsigned int i = 0; i < devices.size(); i++)
|
for(unsigned int i = 0; i < devices.size(); i++)
|
||||||
{
|
{
|
||||||
cout
|
cout
|
||||||
<< devices[i].id << "\033[" << (idLength - devices[i].id.length() + 2) << "C"
|
<< devices[i].id << "\033[" << (idLength - devices[i].id.length() + 2) << "C"
|
||||||
<< devices[i].title << "\033[" << (titleLength - devices[i].title.length() + 2) << "C"
|
<< devices[i].title << "\033[" << (titleLength - devices[i].title.length() + 2) << "C"
|
||||||
<< devices[i].model << endl;
|
<< devices[i].model << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -260,7 +260,7 @@ int main(int argc, char **argv)
|
||||||
cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
|
cerr << "error: " << e.error() << " for arg " << e.argId() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// errors thrown by pushhandler
|
// errors thrown by pushhandler
|
||||||
catch(PusherError& e)
|
catch(PusherError& e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ vector<PushHandler::Device> PushHandler::getDevices()
|
||||||
Device buf;
|
Device buf;
|
||||||
|
|
||||||
buf.title = element["title"].get<string>();
|
buf.title = element["title"].get<string>();
|
||||||
buf.id = element["id"].get<string>();
|
buf.id = to_string(element["id"].get<int>());
|
||||||
buf.model = element["model"].get<string>();
|
buf.model = element["model"].get<string>();
|
||||||
|
|
||||||
buffer.push_back(buf);
|
buffer.push_back(buf);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue