Branch 'ayres' - c++/lib c++/tests

Camila Ayres ayres at kolabsys.com
Tue Mar 6 18:17:29 CET 2012


 c++/lib/kolabcontainers.cpp |    6 ++----
 c++/lib/kolabconversions.h  |   22 ++++++++++------------
 c++/tests/bindingstest.cpp  |    8 ++++----
 3 files changed, 16 insertions(+), 20 deletions(-)

New commits:
commit ffbf69d5bdc22f4482a10a894a56fa2387036439
Author: Camila San <smayres at gmail.com>
Date:   Tue Mar 6 18:29:06 2012 +0100

    compileble files.
    
     Please enter the commit message for your changes. Lines starting

diff --git a/c++/lib/kolabcontainers.cpp b/c++/lib/kolabcontainers.cpp
index 6c2afc7..1201a8b 100644
--- a/c++/lib/kolabcontainers.cpp
+++ b/c++/lib/kolabcontainers.cpp
@@ -847,11 +847,9 @@ void Configuration::operator=(const Configuration& )
 
 bool Configuration::operator==(const Configuration& other) const
 {
-    return (conf->uid == other.uid() &&
-       conf->prodid == other.prodid &&
-	conf->creationDate == other.creationDate() &&
+    return (conf->creationDate == other.creationDate() &&
 	conf->lastModification == other.lastModification() &&
-	conf->type == other.type &&
+	conf->type == other.type() &&
 	conf->configurationType == other.configurationType());
 }
 
diff --git a/c++/lib/kolabconversions.h b/c++/lib/kolabconversions.h
index b7c4eb9..670fceb 100644
--- a/c++/lib/kolabconversions.h
+++ b/c++/lib/kolabconversions.h
@@ -36,8 +36,8 @@ std::string fromDateTime(const DateTime &dt)
     s << dt.year() << dt.month() << dt.day() << "T" << dt.hour() << dt.minute()
 << dt.second();
     if (!dt.isUTC()) { //always UTC
-        std::cout << "Date is not UTC but it should be, UTC assumed." <<
-std::endl;
+        std::cout << "Date is not UTC but it should be, UTC assumed."
+<< std::endl;
     }
     s << "Z";
     return s.str();
@@ -54,16 +54,15 @@ KolabXSD::Note &note)
     return boost::shared_ptr<Kolab::Note>();
 }
 
-template <>
-void writeCard (const
-KolabXSD::Note &note)
+void writeCard (const KolabXSD::Note &note)
 {
     //TODO
     
 }
 
 template <typename T>
-std::string serializeCard(const T &note, const std::string prod = std::string())
+std::string serializeCard(const KolabXSD::Note &note, const std::string prod =
+std::string())
 {
 
 
@@ -71,15 +70,14 @@ std::string serializeCard(const T &note, const std::string prod = std::string())
         KolabXSD::Note::uid_type uid(getUID(note.uid()));
         KolabXSD::Note::version1_type kolab_version(KOLAB_FORMAT_VERSION);
         KolabXSD::Note::prodid_type prodid(prod+KOLAB_LIBNAME);       
-	KolabXSD::Note::version1_type
-rev(fromDateTime(getCurrentTime()));
+	KolabXSD::Note::version1_type rev(fromDateTime(getCurrentTime()));
        
-        
-        KolabXSD::Note note(uid, kolab_version, prodid, rev);
-        writeCard<T>(note);
+        //TODO
+        //KolabXSD::Note note(uid, kolab_version, prodid, rev);
+        writeCard(note);
         
         std::ostringstream ostringstream;
-        KolabXSD::Note(ostringstream, note);
+        KolabXSD::Note (note, ostringstream);
         return ostringstream.str();
     } catch  (const xml_schema::exception& e) {
         std::cerr << "failed to write Note";
diff --git a/c++/tests/bindingstest.cpp b/c++/tests/bindingstest.cpp
index 3781f6f..d05740f 100644
--- a/c++/tests/bindingstest.cpp
+++ b/c++/tests/bindingstest.cpp
@@ -29,10 +29,10 @@ void BindingsTest::writeContact()
 
 void BindingsTest::writeNote()
 {
-    Kolab::Note note;
-    note.setColor("#F00000");
-    note.setDescription("Writing a Note Test.");
-    std::cout << serializeCard<T>(note) << std::endl;
+    //KolabXSD::Note note;
+    //note.setColor("#F00000");
+    //note.setDescription("Writing a Note Test.");
+    //std::cout << serializeCard(note) << std::endl;
 }
 
 void BindingsTest::readNote()





More information about the commits mailing list