Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 |
diff -r e5a4471a46fb -r 3363752cd523 SalesforceInterface.cpp
--- 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
diff -r e5a4471a46fb -r 3363752cd523 SalesforceInterface.h
--- 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);
};