-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDeleteRoute.cpp
35 lines (28 loc) · 982 Bytes
/
DeleteRoute.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
////////////////////////////////////////////////////////////////////////////////
// Gets a Route info by ID
////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include "../include/route4me.h"
#define KEY "11111111111111111111111111111111"
using namespace std;
int main()
{
// global init
CRoute4Me::init();
CRoute4Me route(KEY);
const char *route_id = "AC16E7D338B551013FF34266FE81A5EEXXX";
int ret = 0;
if(route.delete_route(route_id) == 0)
{
// use Json::StyledWriter instead of Json::FastWriter for a human friendly output
cout << "Response of delete route " << route_id << " is:" << endl << Json::FastWriter().write(route.get_json_resp()) << endl;
}
else
{
cout << "Error when delete route: code = " << route.get_err_code() << ", msg:" << route.get_err_msg() << endl;
ret = -1;
}
// global cleanup
CRoute4Me::cleanup();
return ret;
}