Interface for invoking Salesforce.com REST calls over SSL with OAUTH authentication. This interface is designed to simplify the interaction between mbed devices and salesforce.com web services.
Dependencies: HTTPClient-SSL MbedJSONValue
Revision 22:3363752cd523, committed 2014-09-26
- Comitter:
- ansond
- Date:
- Fri Sep 26 04:34:33 2014 +0000
- Parent:
- 21:e5a4471a46fb
- Commit message:
- revamped to use new salesforce interface
Changed in this revision
SalesforceInterface.cpp | Show annotated file Show diff for this revision Revisions of this file |
SalesforceInterface.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/SalesforceInterface.cpp Fri Sep 26 03:42:20 2014 +0000 +++ b/SalesforceInterface.cpp Fri Sep 26 04:34:33 2014 +0000 @@ -847,4 +847,19 @@ int SalesforceInterface::min(int value1,int value2) { if (value1 < value2) return value1; return value2; + } + + // look for a specific key value pair in a json message + bool SalesforceInterface::contains(char *json,char *key,char *value) { + bool has_it = false; + + if (json != NULL && key != NULL && value != NULL) { + // parse the json and look for a specific <key,value> pair... + MbedJSONValue parsed; + parse(parsed,json); + char *answer = (char *)parsed[key].get<std::string>().c_str(); + if (strcmp(answer,value) == 0) has_it = true; + } + + return has_it; } \ No newline at end of file
--- a/SalesforceInterface.h Fri Sep 26 03:42:20 2014 +0000 +++ b/SalesforceInterface.h Fri Sep 26 04:34:33 2014 +0000 @@ -647,6 +647,9 @@ // min() method int min(int value1,int value2); + // look for a specific key value pair in a json message + bool contains(char *json,char *key,char *value); + // initialize void init(HTTPClient *http,Logger *logger,bool logger_internal); };