DEADSOFTWARE

Convert typepaths from SHORTCHAR** to TypePath class
[odcread.git] / store.cc
index d7db23be164b68e41a7da87834f50e951aed801f..82e20e67c7c1e0dac7cb4a1358706e811057af19 100644 (file)
--- a/store.cc
+++ b/store.cc
@@ -2,6 +2,24 @@
 
 namespace odc {
 
+template<class T, class A> T join(const A & begin, const A & end, const T &sep) {
+       T result;
+
+       if (begin != end) {
+               A it = begin;
+               result.append(*it);
+               for (++it; it != end; ++it) {
+                       result.append(sep).append(*it);
+               }
+       }
+
+       return result;
+}
+
+std::string TypePath::toString() const {
+       return join(begin(), end(), std::string("->"));
+}
+
 Store::Store(INTEGER id): d_id(id) {}
 
 INTEGER Store::getId() {