2 commits - kolabformat/xmlobject.cpp kolabformat/xmlobject.h

Christian Mollekopf mollekopf at kolabsys.com
Thu Nov 1 23:39:21 CET 2012


 kolabformat/xmlobject.cpp |   21 +++++++++++++++++++++
 kolabformat/xmlobject.h   |    8 +++-----
 2 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit d6092d72544f0cfff2b42ff2354afb1ed4c42ad3
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Thu Nov 1 23:36:49 2012 +0100

    Added configuration objects.

diff --git a/kolabformat/xmlobject.cpp b/kolabformat/xmlobject.cpp
index fb5dbb2..83b5abe 100644
--- a/kolabformat/xmlobject.cpp
+++ b/kolabformat/xmlobject.cpp
@@ -115,6 +115,7 @@ Journal XMLObject::readJournal(const std::string& s, Version version)
 std::string XMLObject::writeFreebusy(const Freebusy &event, Version version, const std::string& productId)
 {
     if (version != KolabV3) {
+        Critical() << "only v3 implementation available";
         return std::string();
     }
     return Kolab::writeFreebusy(event, productId);
@@ -123,6 +124,7 @@ std::string XMLObject::writeFreebusy(const Freebusy &event, Version version, con
 Freebusy XMLObject::readFreebusy(const std::string& s, Version version)
 {
     if (version != KolabV3) {
+        Critical() << "only v3 implementation available";
         return Freebusy();
     }
     return Kolab::readFreebusy(s, false);
@@ -210,5 +212,24 @@ std::string XMLObject::writeNote(const Note &note, Version version, const std::s
     }
     return Kolab::writeNote(note, productId);
 }
+
+Configuration XMLObject::readConfiguration(const std::string& s, Version version)
+{
+    if (version != KolabV3) {
+        Critical() << "only v3 implementation available";
+        return Configuration();
+    }
+    return Kolab::readConfiguration(s, productId);
+}
+
+std::string XMLObject::writeConfiguration(const Configuration &configuration, Version version, const std::string& productId)
+{
+    if (version != KolabV3) {
+        Critical() << "only v3 implementation available";
+        return std::string();
+    }
+    return Kolab::writeConfiguration(configuration, productId);
+}
+
     
 };
diff --git a/kolabformat/xmlobject.h b/kolabformat/xmlobject.h
index baac1d7..8738a49 100644
--- a/kolabformat/xmlobject.h
+++ b/kolabformat/xmlobject.h
@@ -79,6 +79,9 @@ public:
      */
     Kolab::Note readNote(const std::string& s, Kolab::Version version);
     static std::string writeNote(const Kolab::Note &, Kolab::Version version, const std::string& productId = std::string());
+
+    Kolab::Configuration readConfiguration(const std::string& s, Kolab::Version version);
+    static std::string writeConfiguration(const Kolab::Configuration &, Kolab::Version version, const std::string& productId = std::string());
     
 private:
     std::vector<std::string> mAttachments;


commit 3cc5d4852734727eef18248a2c8ed5656f125811
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Thu Nov 1 13:57:39 2012 +0100

    We don't want configuration and file in this API yet (at least the files would raise the libkolabxml requirements).

diff --git a/kolabformat/xmlobject.h b/kolabformat/xmlobject.h
index 338613d..baac1d7 100644
--- a/kolabformat/xmlobject.h
+++ b/kolabformat/xmlobject.h
@@ -79,12 +79,7 @@ public:
      */
     Kolab::Note readNote(const std::string& s, Kolab::Version version);
     static std::string writeNote(const Kolab::Note &, Kolab::Version version, const std::string& productId = std::string());
-
-//     Kolab::Configuration readConfiguration(const std::string& s, Kolab::Version version);
-//     static std::string writeConfiguration(const Kolab::Configuration &, Kolab::Version version, const std::string& productId = std::string());
-// 
-//     Kolab::File readFile(const std::string& s, Kolab::Version version);
-//     static std::string writeFile(const Kolab::File &, Kolab::Version version, const std::string& productId = std::string());
+    
 private:
     std::vector<std::string> mAttachments;
     std::string mLogoAttachmentName;





More information about the commits mailing list