summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/json
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-11 08:29:17 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-01-11 08:29:17 +0000
commit8015f0d53da53876b65fdcdc712f1dc92835a9b1 (patch)
tree4cffc808317d16435c19289bd2a14d88a357f088 /sca-cpp/trunk/modules/json
parent11c57b87a39a30904cdf24ef81c770e8f17096a1 (diff)
Minor fixes to server and python evaluator to get python store working. Some changes to python and scheme store test cases to simplify them a bit and make them consistent. Enabled a few more server test combinations.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@897785 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/json')
-rw-r--r--sca-cpp/trunk/modules/json/json.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/sca-cpp/trunk/modules/json/json.hpp b/sca-cpp/trunk/modules/json/json.hpp
index e2f036541a..fc5e512d5e 100644
--- a/sca-cpp/trunk/modules/json/json.hpp
+++ b/sca-cpp/trunk/modules/json/json.hpp
@@ -381,6 +381,18 @@ const failable<list<string> > jsonResult(const value& id, const value& val, JSON
return writeJSON(valuesToElements(mklist<value>(mklist<value>("id", id), mklist<value>("result", val))), cx);
}
+/**
+ * Return a portable function name from a JSON-RPC function name.
+ * Strip the "system." and "Service." prefixes added by some JSON-RPC clients.
+ */
+const string funcName(const string& f) {
+ if (length(f) > 7 && find(f, "system.", 0) == 0)
+ return c_str(f) + 7;
+ if (length(f) > 8 && find(f, "Service.", 0) == 0)
+ return c_str(f) + 8;
+ return f;
+}
+
}
}