diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-08 08:18:07 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-03-08 08:18:07 +0000 |
commit | 49b878b1b0f2e52bbd5282c22ac32a68e1e8736c (patch) | |
tree | 1eb26926f9d703c61b329a0f07178090b57cd55d /sca-cpp/trunk/modules/scheme | |
parent | 5b33dc5c5a87fff146951ca0543bf558454c331d (diff) |
Change ATOM and RSS feed representations to use name value pairs instead of just strings, to allow support for all ATOM and RSS attributes and avoid confusion with non-feed string results.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1079292 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/scheme')
-rw-r--r-- | sca-cpp/trunk/modules/scheme/json-value.cpp | 3 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/scheme/primitive.hpp | 16 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/scheme/value-json.cpp | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/scheme/value-xml.cpp | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/scheme/xml-value.cpp | 2 |
5 files changed, 15 insertions, 10 deletions
diff --git a/sca-cpp/trunk/modules/scheme/json-value.cpp b/sca-cpp/trunk/modules/scheme/json-value.cpp index 0ab9c85854..d7ffc2b37b 100644 --- a/sca-cpp/trunk/modules/scheme/json-value.cpp +++ b/sca-cpp/trunk/modules/scheme/json-value.cpp @@ -39,8 +39,7 @@ int jsonValue() { cerr << reason(lv); return 1; } - const value v = elementsToValues(content(lv)); - cout << writeValue(v); + cout << writeValue(content(lv)); return 0; } diff --git a/sca-cpp/trunk/modules/scheme/primitive.hpp b/sca-cpp/trunk/modules/scheme/primitive.hpp index 6f3f71f4cd..899d6f83da 100644 --- a/sca-cpp/trunk/modules/scheme/primitive.hpp +++ b/sca-cpp/trunk/modules/scheme/primitive.hpp @@ -145,26 +145,30 @@ const value uuidProc(unused const list<value>& args) { return mkuuid(); } -const value cadrProc(unused const list<value>& args) { +const value cadrProc(const list<value>& args) { return cadr((list<value> )car(args)); } -const value caddrProc(unused const list<value>& args) { +const value caddrProc(const list<value>& args) { return caddr((list<value> )car(args)); } -const value cadddrProc(unused const list<value>& args) { +const value cadddrProc(const list<value>& args) { return cadddr((list<value> )car(args)); } -const value cddrProc(unused const list<value>& args) { +const value cddrProc(const list<value>& args) { return cddr((list<value> )car(args)); } -const value cdddrProc(unused const list<value>& args) { +const value cdddrProc(const list<value>& args) { return cdddr((list<value> )car(args)); } +const value appendProc(const list<value>& args) { + return append((list<value> )car(args), (list<value>)cadr(args)); +} + const value startProc(unused const list<value>& args) { return lambda<value(const list<value>&)>(); } @@ -222,6 +226,7 @@ const list<value> primitiveProcedureNames() { + "cadddr" + "cddr" + "cdddr" + + "append" + "display" + "log" + "uuid" @@ -247,6 +252,7 @@ const list<value> primitiveProcedureObjects() { + primitiveProcedure(cadddrProc) + primitiveProcedure(cddrProc) + primitiveProcedure(cdddrProc) + + primitiveProcedure(appendProc) + primitiveProcedure(displayProc) + primitiveProcedure(logProc) + primitiveProcedure(uuidProc) diff --git a/sca-cpp/trunk/modules/scheme/value-json.cpp b/sca-cpp/trunk/modules/scheme/value-json.cpp index 40cc8891dd..5045226db9 100644 --- a/sca-cpp/trunk/modules/scheme/value-json.cpp +++ b/sca-cpp/trunk/modules/scheme/value-json.cpp @@ -34,7 +34,7 @@ namespace scheme { int valueJSON() { const js::JSContext cx; - failable<list<string> > s = json::writeJSON(valuesToElements(readValue(cin)), cx); + failable<list<string> > s = json::writeJSON(readValue(cin), cx); if (!hasContent(s)) { cerr << reason(s); return 1; diff --git a/sca-cpp/trunk/modules/scheme/value-xml.cpp b/sca-cpp/trunk/modules/scheme/value-xml.cpp index 1508f7b516..7091d5c8ba 100644 --- a/sca-cpp/trunk/modules/scheme/value-xml.cpp +++ b/sca-cpp/trunk/modules/scheme/value-xml.cpp @@ -33,7 +33,7 @@ namespace tuscany { namespace scheme { int valueXML() { - failable<list<string> > s = writeXML(valuesToElements(readValue(cin))); + failable<list<string> > s = writeXML(readValue(cin)); if (!hasContent(s)) { cerr << reason(s); return 1; diff --git a/sca-cpp/trunk/modules/scheme/xml-value.cpp b/sca-cpp/trunk/modules/scheme/xml-value.cpp index 0b95174e33..d88f754aa5 100644 --- a/sca-cpp/trunk/modules/scheme/xml-value.cpp +++ b/sca-cpp/trunk/modules/scheme/xml-value.cpp @@ -33,7 +33,7 @@ namespace tuscany { namespace scheme { int xmlValue() { - const value v = elementsToValues(readXML(streamList(cin))); + const value v = readXML(streamList(cin)); cout << writeValue(v); return 0; } |