diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2009-12-26 03:25:25 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2009-12-26 03:25:25 +0000 |
commit | bd4c1d47aeaf1d4bca76d5713e705b0869d3f2f7 (patch) | |
tree | 475d0385e678c5e7007df571bea9c5cc8b1417bb /sca-cpp/trunk/modules/json/json.hpp | |
parent | f453584ae0a3ec04f1781fc35b7abe5d139c6679 (diff) |
Added missing const qualifiers, macros and util functions to help debugging, and a simple balanced tree implementation for use in lookup tables.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@893938 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/json/json.hpp')
-rw-r--r-- | sca-cpp/trunk/modules/json/json.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sca-cpp/trunk/modules/json/json.hpp b/sca-cpp/trunk/modules/json/json.hpp index 7d9bba564e..6ce4e3a9a1 100644 --- a/sca-cpp/trunk/modules/json/json.hpp +++ b/sca-cpp/trunk/modules/json/json.hpp @@ -332,10 +332,10 @@ const failable<bool, std::string> writeList(const list<value>& l, JSObject* o, c */ template<typename R> class WriteContext { public: - WriteContext(const lambda<R(std::string, R)>& reduce, const R& accum, const JSONContext& cx) : cx(cx), reduce(reduce), accum(accum) { + WriteContext(const lambda<R(const std::string&, const R)>& reduce, const R& accum, const JSONContext& cx) : cx(cx), reduce(reduce), accum(accum) { } const JSONContext& cx; - const lambda<R(std::string, R)> reduce; + const lambda<R(const std::string&, const R)> reduce; R accum; }; @@ -352,7 +352,7 @@ template<typename R> JSBool writeCallback(const jschar *buf, uint32 len, void *d /** * Convert a list of values to a JSON document. */ -template<typename R> const failable<R, std::string> writeJSON(const lambda<R(std::string, R)>& reduce, const R& initial, const list<value>& l, const JSONContext& cx) { +template<typename R> const failable<R, std::string> writeJSON(const lambda<R(const std::string&, const R)>& reduce, const R& initial, const list<value>& l, const JSONContext& cx) { JSObject* o = JS_NewObject(cx, NULL, NULL, NULL); jsval val = OBJECT_TO_JSVAL(o); const failable<bool, std::string> w = writeList(l, o, cx); |