diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-30 08:36:32 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-30 08:36:32 +0000 |
commit | ff124040623879bc48a0ba5cf06a841642adef53 (patch) | |
tree | e0bee552780b0852c10744017b7826b08f57d377 /sca-cpp/trunk/modules/atom/atom.hpp | |
parent | cd7dae28b034deebc9c2c2469ed9d8f1f3dab1ed (diff) |
Fixes to the http client, httpd modules and memcached component to get the store and shopping cart test case working end to end.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@885349 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/modules/atom/atom.hpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sca-cpp/trunk/modules/atom/atom.hpp b/sca-cpp/trunk/modules/atom/atom.hpp index ac19b93e38..22489fd1d1 100644 --- a/sca-cpp/trunk/modules/atom/atom.hpp +++ b/sca-cpp/trunk/modules/atom/atom.hpp @@ -38,7 +38,7 @@ namespace atom { /** * Convert a list of elements to a list of values representing an ATOM entry. */ -const list<value> entryValue(const list<value>& e) { +const list<value> entryValues(const list<value>& e) { const list<value> lt = filter<value>(selector(mklist<value>(element, "title")), e); const value t = isNil(lt)? value(std::string("")) : elementValue(car(lt)); const list<value> li = filter<value>(selector(mklist<value>(element, "id")), e); @@ -53,7 +53,7 @@ const list<value> entryValue(const list<value>& e) { const list<value> entriesValues(const list<value>& e) { if (isNil(e)) return e; - return cons<value>(entryValue(car(e)), entriesValues(cdr(e))); + return cons<value>(entryValues(car(e)), entriesValues(cdr(e))); } /** @@ -63,7 +63,15 @@ const failable<list<value>, std::string> readEntry(const list<std::string>& ilis const list<value> e = readXML(ilist); if (isNil(e)) return mkfailure<list<value>, std::string>("Empty entry"); - return entryValue(car(e)); + return entryValues(car(e)); +} + +/** + * Convert a list of values representing an ATOM entry to a value. + */ +const value entryValue(const list<value>& e) { + const list<value> v = elementsToValues(mklist<value>(caddr(e))); + return cons(car(e), mklist<value>(cadr(e), cdr<value>(car(v)))); } /** |