Class that encapsulates Rest API response. This object created indirectly.
More...
#include <ParseResponse.h>
|
void | read () |
|
void | readWithTimeout (int maxSec) |
|
int | available () |
|
void | freeBuffer () |
|
| ParseResponse (Process *client) |
|
|
int | bufSize |
|
char * | buf |
|
char * | tmpBuf |
|
bool | isUserBuffer |
|
int | p = 0 |
|
int | resultCount = -1 |
|
Process * | client |
|
|
static const int | BUFSIZE = 128 |
|
Class that encapsulates Rest API response. This object created indirectly.
void ParseResponse::close |
( |
| ) |
|
free resource including system data buffer and client
NOTE: the customer buffer will NOT be freed, you need to free them by yourself
int ParseResponse::count |
( |
| ) |
|
ParseQuery ONLY: get the count of the objects in query results.
NOTE: if the query resutls exceed 2048 bytes(query result buffer size), it will only return the count of objects in the buffer.
- Returns
- number of objects in the result
bool ParseResponse::getBoolean |
( |
const char * |
key | ) |
|
get the boolean value in the response by key
- Parameters
-
- Returns
- the value
double ParseResponse::getDouble |
( |
const char * |
key | ) |
|
get the double value in the response by key.
- Parameters
-
- Returns
- the value
int ParseResponse::getErrorCode |
( |
| ) |
|
get the "error" field in the response.
- Returns
- error_code when error happens, 0 when there is no error
int ParseResponse::getInt |
( |
const char * |
key | ) |
|
get the integer value in the response by key
- Parameters
-
- Returns
- the value
const char * ParseResponse::getJSONBody |
( |
| ) |
|
get the complete json value of response.
- Returns
- returned JSON
const char * ParseResponse::getString |
( |
const char * |
key | ) |
|
get the string value in the response by key
- Parameters
-
- Returns
- the value
bool ParseResponse::nextObject |
( |
| ) |
|
ParseQuery ONLY: iterate to next object in query result.
it has to be called before any object opreation(getInt/String/Double) including the first object
- Returns
- true if successfully iterate to next object false if there is no more object
void ParseResponse::setBuffer |
( |
char * |
buffer, |
|
|
int |
size |
|
) |
| |
set the customer buffer for writing response data.
- Parameters
-
buffer | - char array buffer |
size | - size of buffer NOTE: if buffer is not set, a default size of 128 will be initialized. |
The documentation for this class was generated from the following files: