Hello community,
here is the log from the commit of package libkolabxml for openSUSE:Factory checked in at 2013-03-01 07:25:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libkolabxml (Old)
and /work/SRC/openSUSE:Factory/.libkolabxml.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libkolabxml", Maintainer is ""
Changes:
--------
--- /work/SRC/openSUSE:Factory/libkolabxml/libkolabxml.changes 2013-01-17 13:18:20.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libkolabxml.new/libkolabxml.changes 2013-03-01 07:25:13.000000000 +0100
@@ -1,0 +2,7 @@
+Wed Feb 27 08:45:25 UTC 2013 - aj@ajaissle.de
+
+- New upstream version 0.8.3
+ * adds capabilities to read/write a new XML format
+- Update fix_php5_bindings.diff
+
+-------------------------------------------------------------------
Old:
----
libkolabxml-0.8.1.tar.gz
New:
----
libkolabxml-0.8.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libkolabxml.spec ++++++
--- /var/tmp/diff_new_pack.mwMkTy/_old 2013-03-01 07:25:14.000000000 +0100
+++ /var/tmp/diff_new_pack.mwMkTy/_new 2013-03-01 07:25:14.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package libkolabxml
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: libkolabxml
-Version: 0.8.1
+Version: 0.8.3
Release: 0
%define soname 0
Summary: Kolab XML Format Schema Definitions Library
++++++ fix_php5_bindings.diff ++++++
--- /var/tmp/diff_new_pack.mwMkTy/_old 2013-03-01 07:25:14.000000000 +0100
+++ /var/tmp/diff_new_pack.mwMkTy/_new 2013-03-01 07:25:14.000000000 +0100
@@ -1,22 +1,22 @@
---- src/php/CMakeLists.txt 2012-08-15 16:50:12.000000000 +0200
-+++ src/php/CMakeLists.txt 2012-12-24 01:04:29.812585496 +0100
-@@ -10,9 +10,8 @@
+--- src/php/CMakeLists.txt.orig 2013-02-26 12:31:37.000000000 +0100
++++ src/php/CMakeLists.txt 2013-02-27 10:46:32.858763766 +0100
+@@ -10,8 +10,8 @@ add_custom_command(OUTPUT ${CMAKE_CURREN
VERBATIM
)
-SET_SOURCE_FILES_PROPERTIES(${KOLAB_SWIG_PHP_SOURCE_FILE} PROPERTIES GENERATED 1)
-ADD_CUSTOM_TARGET(generate_php_bindings ALL DEPENDS ${KOLAB_SWIG_PHP_SOURCE_FILE})
--
+set_source_files_properties(${KOLAB_SWIG_PHP_SOURCE_FILE} PROPERTIES GENERATED 1)
+add_custom_target(generate_php_bindings ALL DEPENDS ${KOLAB_SWIG_PHP_SOURCE_FILE})
+
#Compile PHP Bindings
- # Since there is no php library we can't compile with -Wl,--no-undefined
-@@ -20,25 +19,54 @@
+@@ -19,35 +19,57 @@ ADD_CUSTOM_TARGET(generate_php_bindings
+ if (APPLE)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" )
endif()
-
--find_package(PHP4 5.3 REQUIRED)
++set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable -Wno-unused-label -Wno-maybe-uninitialized -Wno-unused-function" )
++
+# Try to find PHP5
+find_path(PHP_INCLUDE_DIR NAMES main/php.h PATH_SUFFIXES php php5)
+find_program(PHP_EXECUTABLE NAMES php)
@@ -44,27 +44,7 @@
+ if(_PHP_VERSION_ID_MATCH)
+ string(REGEX REPLACE "#define PHP_VERSION_ID[ ]*([0-9]*)\n" "\\1" PHP_VERSION_ID ${_PHP_VERSION_ID_MATCH})
+ endif()
-
--if (PHP4_FOUND)
-- include_directories(${PHP4_INCLUDE_PATH})
-- add_library(phpbindings SHARED ${KOLAB_SWIG_PHP_SOURCE_FILE})
-- target_link_libraries(phpbindings kolabxml)
-- SET_TARGET_PROPERTIES(phpbindings PROPERTIES OUTPUT_NAME "kolabformat")
-- SET_TARGET_PROPERTIES(phpbindings PROPERTIES PREFIX "")
--
-- configure_file(test.php ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
--
-- set(PHP_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/phpbindings" CACHE STRING "Install directory for php bindings.")
--
-- install(TARGETS phpbindings LIBRARY DESTINATION ${PHP_INSTALL_DIR})
--
-- install( FILES
-- ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
-- DESTINATION ${PHP_INSTALL_DIR}
-- )
--else(PHP4_FOUND)
-- message(WARNING "not building php bindings because php was not found")
--endif (PHP4_FOUND)
++
+ # Include the needed PHP5 subdirs
+ set(PHP_INCLUDE_DIRS ${PHP_INCLUDE_DIR} ${PHP_INCLUDE_DIR}/main ${PHP_INCLUDE_DIR}/TSRM ${PHP_INCLUDE_DIR}/Zend )
+endif()
@@ -88,3 +68,35 @@
+else()
+ message(WARNING "not building php bindings because php was not found")
+endif()
+
+-# Debian (Wheezy) won't be able to find PHP using find_package. In packaging libkolabxml
+-# for it, we define the include path and executable during the build.
+-if (NOT PHP4_INCLUDE_PATH OR NOT PHP4_EXECUTABLE)
+- find_package(PHP4 5.3 REQUIRED)
+-endif (NOT PHP4_INCLUDE_PATH OR NOT PHP4_EXECUTABLE)
+-
+-if (PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))
+- include_directories(${PHP4_INCLUDE_PATH})
+-
+- # In an additional twist on Debian (Wheezy) - the PHP headers are fubar. php.h is in main/,
+- # TSRM/TSRM.h includes instead of "tsrm_config.h", and we require
+- # Zend/zend.h (included, of course, as "zend.h" without -I/usr/include/php5/Zend)
+- include_directories("${PHP4_INCLUDE_PATH}/Zend" "${PHP4_INCLUDE_PATH}/TSRM" "${PHP4_INCLUDE_PATH}/main")
+- add_library(phpbindings SHARED ${KOLAB_SWIG_PHP_SOURCE_FILE})
+- target_link_libraries(phpbindings kolabxml)
+- SET_TARGET_PROPERTIES(phpbindings PROPERTIES OUTPUT_NAME "kolabformat")
+- SET_TARGET_PROPERTIES(phpbindings PROPERTIES PREFIX "")
+-
+- configure_file(test.php ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+-
+- set(PHP_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/phpbindings" CACHE STRING "Install directory for php bindings.")
+-
+- install(TARGETS phpbindings LIBRARY DESTINATION ${PHP_INSTALL_DIR})
+-
+- install( FILES
+- ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
+- DESTINATION ${PHP_INSTALL_DIR}
+- )
+-else(PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))
+- message(WARNING "not building php bindings because php was not found")
+-endif (PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))
++++++ libkolabxml-0.8.1.tar.gz -> libkolabxml-0.8.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/CMakeLists.txt new/libkolabxml-0.8.3/CMakeLists.txt
--- old/libkolabxml-0.8.1/CMakeLists.txt 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/CMakeLists.txt 2013-02-26 12:31:37.000000000 +0100
@@ -8,6 +8,7 @@
cmake_minimum_required(VERSION 2.6)
option( BUILD_TESTS "Build the tests" TRUE )
+option( BUILD_UTILS "Build optional utils" FALSE )
option( DIST_ONLY "Build dist targets only (does not require a compiler)" FALSE )
option( PYTHON_BINDINGS "Build bindings for python" FALSE )
option( PHP_BINDINGS "Build bindings for php" FALSE )
@@ -42,7 +43,7 @@
set (Libkolabxml_VERSION_MAJOR 0)
set (Libkolabxml_VERSION_MINOR 8)
# Enable the full x.y.z version only for release versions
-set (Libkolabxml_VERSION_PATCH 1)
+set (Libkolabxml_VERSION_PATCH 3)
set (Libkolabxml_VERSION "${Libkolabxml_VERSION_MAJOR}.${Libkolabxml_VERSION_MINOR}.${Libkolabxml_VERSION_PATCH}" )
# set (Libkolabxml_VERSION "${Libkolabxml_VERSION_MAJOR}.${Libkolabxml_VERSION_MINOR}" )
@@ -135,7 +136,7 @@
# --generate-inline --extern-xml-schema xml-schema.xsd
# --cxx-suffix .cpp --hxx-suffix .h
add_custom_command(OUTPUT ${SCHEMA_SOURCEFILES}
- COMMAND ${XSDCXX} cxx-tree --generate-polymorphic --generate-serialization --namespace-map http://kolab.org=KolabXSD --root-element icalendar --root-element vcards --root-element note --root-element configuration --output-dir ${CMAKE_BINARY_DIR}/bindings ${SCHEMAS}
+ COMMAND ${XSDCXX} cxx-tree --generate-polymorphic --generate-serialization --namespace-map http://kolab.org=KolabXSD --root-element icalendar --root-element vcards --root-element note --root-element configuration --root-element file --output-dir ${CMAKE_BINARY_DIR}/bindings ${SCHEMAS}
COMMENT "Generating XSD bindings"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${SCHEMAS}
@@ -179,6 +180,10 @@
add_subdirectory(src)
+if (BUILD_UTILS)
+ add_subdirectory(utils)
+endif()
+
if (BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/schemas/kolabformat.xsd new/libkolabxml-0.8.3/schemas/kolabformat.xsd
--- old/libkolabxml-0.8.1/schemas/kolabformat.xsd 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/schemas/kolabformat.xsd 2013-02-26 12:31:37.000000000 +0100
@@ -75,6 +75,26 @@
+
+
+
+
+ xs:sequence
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/CMakeLists.txt new/libkolabxml-0.8.3/src/CMakeLists.txt
--- old/libkolabxml-0.8.1/src/CMakeLists.txt 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/CMakeLists.txt 2013-02-26 12:31:37.000000000 +0100
@@ -15,6 +15,7 @@
containers/kolabcontact.cpp
containers/kolabconfiguration.cpp
containers/kolabfreebusy.cpp
+ containers/kolabfile.cpp
utils.cpp base64.cpp uriencode.cpp
../compiled/XMLParserWrapper.cpp
../compiled/grammar-input-stream.cxx
@@ -54,6 +55,7 @@
containers/kolabcontainers.h
containers/kolabconfiguration.h
containers/kolabfreebusy.h
+ containers/kolabfile.h
global_definitions.h
DESTINATION ${INCLUDE_INSTALL_DIR})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/containers/kolabevent.cpp new/libkolabxml-0.8.3/src/containers/kolabevent.cpp
--- old/libkolabxml-0.8.1/src/containers/kolabevent.cpp 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/containers/kolabevent.cpp 2013-02-26 12:31:37.000000000 +0100
@@ -300,15 +300,15 @@
return d->customProperties;
}
-// void Event::setExceptions(const std::vector< Event > &exceptions)
-// {
-// d->exceptions = exceptions;
-// }
-//
-// std::vector< Event > Event::exceptions() const
-// {
-// return d->exceptions;
-// }
+void Event::setExceptions(const std::vector< Event > &exceptions)
+{
+ d->exceptions = exceptions;
+}
+
+std::vector< Event > Event::exceptions() const
+{
+ return d->exceptions;
+}
void Event::setAlarms(const std::vector< Alarm > &alarms)
{
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/containers/kolabevent.h new/libkolabxml-0.8.3/src/containers/kolabevent.h
--- old/libkolabxml-0.8.1/src/containers/kolabevent.h 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/containers/kolabevent.h 2013-02-26 12:31:37.000000000 +0100
@@ -105,9 +105,9 @@
void setCustomProperties(const std::vector<CustomProperty> &);
std::vector<CustomProperty> customProperties() const;
-/* TODO what is this? Exceptions it is
+
void setExceptions(const std::vector<Event> &);
- std::vector<Event> exceptions() const;*/
+ std::vector<Event> exceptions() const;
void setAlarms(const std::vector<Alarm> &);
std::vector<Alarm> alarms() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/containers/kolabfile.cpp new/libkolabxml-0.8.3/src/containers/kolabfile.cpp
--- old/libkolabxml-0.8.1/src/containers/kolabfile.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/libkolabxml-0.8.3/src/containers/kolabfile.cpp 2013-02-26 12:31:37.000000000 +0100
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2012 Christian Mollekopf
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ */
+
+#include "kolabfile.h"
+
+namespace Kolab {
+
+struct File::Private
+{
+ Private()
+ : classification(ClassPublic){}
+
+ std::string uid;
+ cDateTime created;
+ cDateTime lastModified;
+ std::vector< std::string > categories;
+ Classification classification;
+
+ std::string note;
+
+ Attachment attachment;
+ std::vector<CustomProperty> customProperties;
+};
+
+File::File()
+: d(new File::Private())
+{
+}
+
+File::File(const File &other)
+: d(new File::Private())
+{
+ *d = *other.d;
+}
+
+File::~File()
+{
+}
+
+void File::operator=(const Kolab::File &other)
+{
+ *d = *other.d;
+}
+
+bool File::operator==(const Kolab::File& other) const
+{
+ return ( d->uid == other.uid() &&
+ d->created == other.created() &&
+ d->lastModified == other.lastModified() &&
+ d->categories == other.categories() &&
+ d->classification == other.classification() &&
+ d->note == other.note() &&
+ d->attachment == other.file() &&
+ d->customProperties == other.customProperties());
+}
+
+bool File::isValid() const
+{
+ return !d->uid.empty();
+}
+
+void File::setUid(const std::string &uid)
+{
+ d->uid = uid;
+}
+
+std::string File::uid() const
+{
+ return d->uid;
+}
+
+void File::setCreated(const Kolab::cDateTime &created)
+{
+ d->created = created;
+}
+
+cDateTime File::created() const
+{
+ return d->created;
+}
+
+void File::setLastModified(const Kolab::cDateTime &lastMod)
+{
+ d->lastModified = lastMod;
+}
+
+cDateTime File::lastModified() const
+{
+ return d->lastModified;
+}
+
+void File::setClassification(Classification class_)
+{
+ d->classification = class_;
+}
+
+Classification File::classification() const
+{
+ return d->classification;
+}
+
+void File::setCategories(const std::vector< std::string > &categories)
+{
+ d->categories = categories;
+}
+
+void File::addCategory(const std::string &cat)
+{
+ d->categories.push_back(cat);
+}
+
+std::vector< std::string > File::categories() const
+{
+ return d->categories;
+}
+
+void File::setNote(const std::string ¬e)
+{
+ d->note = note;
+}
+
+std::string File::note() const
+{
+ return d->note;
+}
+
+void File::setFile(const Attachment &attach)
+{
+ d->attachment = attach;
+}
+
+Attachment File::file() const
+{
+ return d->attachment;
+}
+
+void File::setCustomProperties(const std::vector< CustomProperty > &prop)
+{
+ d->customProperties = prop;
+}
+
+std::vector< CustomProperty > File::customProperties() const
+{
+ return d->customProperties;
+}
+
+} //File
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/containers/kolabfile.h new/libkolabxml-0.8.3/src/containers/kolabfile.h
--- old/libkolabxml-0.8.1/src/containers/kolabfile.h 1970-01-01 01:00:00.000000000 +0100
+++ new/libkolabxml-0.8.3/src/containers/kolabfile.h 2013-02-26 12:31:37.000000000 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 Christian Mollekopf
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ */
+
+#ifndef KOLABFILE_H
+#define KOLABFILE_H
+
+#include <string>
+#include <vector>
+#include
+#include "kolabcontainers.h"
+namespace Kolab {
+
+ class File {
+ public:
+ File();
+ ~File();
+ File(const File &);
+ void operator=(const File &);
+ bool operator==(const File &) const;
+
+ bool isValid() const;
+
+ void setUid(const std::string &);
+ std::string uid() const;
+
+ void setCreated(const cDateTime &);
+ cDateTime created() const;
+
+ void setLastModified(const cDateTime &);
+ cDateTime lastModified() const;
+
+ void setClassification(Classification);
+ Classification classification() const;
+
+ void setCategories(const std::vectorstd::string &);
+ void addCategory(const std::string &);
+ std::vectorstd::string categories() const;
+
+ void setNote(const std::string &);
+ std::string note() const;
+
+ void setFile(const Attachment &);
+ Attachment file() const;
+
+ void setCustomProperties(const std::vector<CustomProperty> &);
+ std::vector<CustomProperty> customProperties() const;
+ private:
+ struct Private;
+ boost::scoped_ptr<Private> d;
+ };
+
+}
+
+#endif
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/containers/kolabtodo.cpp new/libkolabxml-0.8.3/src/containers/kolabtodo.cpp
--- old/libkolabxml-0.8.1/src/containers/kolabtodo.cpp 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/containers/kolabtodo.cpp 2013-02-26 12:31:37.000000000 +0100
@@ -29,6 +29,7 @@
cDateTime due;
int percentComplete;
+ std::vector< Todo > exceptions;
};
Todo::Todo()
@@ -314,6 +315,16 @@
return d->customProperties;
}
+void Todo::setExceptions(const std::vector< Todo > &exceptions)
+{
+ d->exceptions = exceptions;
+}
+
+std::vector< Todo > Todo::exceptions() const
+{
+ return d->exceptions;
+}
+
void Todo::setAlarms(const std::vector< Alarm > &alarms)
{
d->alarms = alarms;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/containers/kolabtodo.h new/libkolabxml-0.8.3/src/containers/kolabtodo.h
--- old/libkolabxml-0.8.1/src/containers/kolabtodo.h 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/containers/kolabtodo.h 2013-02-26 12:31:37.000000000 +0100
@@ -108,6 +108,9 @@
void setCustomProperties(const std::vector<CustomProperty> &);
std::vector<CustomProperty> customProperties() const;
+ void setExceptions(const std::vector<Todo> &);
+ std::vector<Todo> exceptions() const;
+
void setAlarms(const std::vector<Alarm> &);
std::vector<Alarm> alarms() const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/csharp/CMakeLists.txt new/libkolabxml-0.8.3/src/csharp/CMakeLists.txt
--- old/libkolabxml-0.8.1/src/csharp/CMakeLists.txt 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/csharp/CMakeLists.txt 2013-02-26 12:31:37.000000000 +0100
@@ -31,6 +31,7 @@
${CMAKE_CURRENT_BINARY_DIR}/Duration.cs
${CMAKE_CURRENT_BINARY_DIR}/ErrorSeverity.cs
${CMAKE_CURRENT_BINARY_DIR}/Event.cs
+ ${CMAKE_CURRENT_BINARY_DIR}/File.cs
${CMAKE_CURRENT_BINARY_DIR}/Geo.cs
${CMAKE_CURRENT_BINARY_DIR}/Journal.cs
${CMAKE_CURRENT_BINARY_DIR}/Key.cs
@@ -44,6 +45,8 @@
${CMAKE_CURRENT_BINARY_DIR}/Role.cs
${CMAKE_CURRENT_BINARY_DIR}/Status.cs
${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_Kolab__Freebusy.cs
+ ${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_std__vectorT_Kolab__Event_t.cs
+ ${CMAKE_CURRENT_BINARY_DIR}/SWIGTYPE_p_std__vectorT_Kolab__Todo_t.cs
${CMAKE_CURRENT_BINARY_DIR}/Telephone.cs
${CMAKE_CURRENT_BINARY_DIR}/Todo.cs
${CMAKE_CURRENT_BINARY_DIR}/Url.cs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/kolabconversions.h new/libkolabxml-0.8.3/src/kolabconversions.h
--- old/libkolabxml-0.8.1/src/kolabconversions.h 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/kolabconversions.h 2013-02-26 12:31:37.000000000 +0100
@@ -33,6 +33,7 @@
#include "kolabnote.h"
#include "shared_conversions.h"
#include "kolabconfiguration.h"
+#include "kolabfile.h"
#include "base64.h"
namespace Kolab {
@@ -269,6 +270,79 @@
return std::string();
}
+template <>
+std::string serializeObject Kolab::File (const Kolab::File &file, const std::string prod)
+{
+ clearErrors();
+ try {
+ const std::string &uid = getUID(file.uid());
+ setCreatedUid(uid);
+
+ KolabXSD::File::creation_date_type created(0,0,0,0,0,0);
+ if (file.created().isValid()) {
+ created = fromDateTime(file.created());
+ } else {
+ created = fromDateTime(timestamp());
+ }
+ KolabXSD::File::last_modification_date_type lastModificationDate(0,0,0,0,0,0);
+ if (file.lastModified().isValid()) {
+ lastModificationDate = fromDateTime(file.lastModified());
+ } else {
+// WARNING("missing last_modification_date, fallback to current timestamp");
+ lastModificationDate = fromDateTime(timestamp());
+ }
+ if (file.file().label().empty()) {
+ ERROR("missing filename");
+ }
+
+ KolabXSD::File n(uid, getProductId(prod), created, lastModificationDate, fromAttachment(file.file()));
+
+ if (!file.categories().empty()) {
+ KolabXSD::File::categories_sequence categories;
+ const std::vectorstd::string &l = file.categories();
+ BOOST_FOREACH(const std::string &c, l) {
+ categories.push_back(c);
+ }
+ n.categories(categories);
+ }
+ switch (file.classification()) {
+ case Kolab::ClassPublic:
+ n.classification(KolabXSD::File::classification_type::PUBLIC);
+ break;
+ case Kolab::ClassPrivate:
+ n.classification(KolabXSD::File::classification_type::PRIVATE);
+ break;
+ case Kolab::ClassConfidential:
+ n.classification(KolabXSD::File::classification_type::CONFIDENTIAL);
+ break;
+ default:
+ ERROR("unknown classification");
+ }
+
+ n.note(file.note());
+
+ if (!file.customProperties().empty()) {
+ const std::vectorKolab::CustomProperty &l = file.customProperties();
+ BOOST_FOREACH(const Kolab::CustomProperty &a, l) {
+ n.x_custom().push_back(KolabXSD::CustomType(a.identifier, a.value));
+ }
+ }
+
+ xml_schema::namespace_infomap map;
+ map[""].name = KOLAB_NAMESPACE;
+
+ std::ostringstream ostringstream;
+ KolabXSD::file(ostringstream, n, map);
+ return ostringstream.str();
+ } catch (const xml_schema::exception& e) {
+ std::cerr << e << std::endl;
+ } catch (...) {
+ CRITICAL("Unhandled exception");
+ }
+ CRITICAL("Failed to write file!");
+ return std::string();
+}
+
template <typename T>
boost::shared_ptr<T> deserializeObject(const std::string& s, bool isUrl);
@@ -428,6 +502,87 @@
CRITICAL("Failed to read configuration!");
return boost::shared_ptrKolab::Configuration();
}
+
+template <>
+boost::shared_ptrKolab::File deserializeObject Kolab::File (const std::string& s, bool isUrl)
+{
+ clearErrors();
+ try {
+ std::auto_ptrKolabXSD::File file;
+ if (isUrl) {
+ xsd::cxx::xml::dom::auto_ptr doc = XMLParserWrapper::inst().parseFile(s);
+ if (doc.get()) {
+ file = KolabXSD::file(doc);
+ }
+ } else {
+ xsd::cxx::xml::dom::auto_ptr doc = XMLParserWrapper::inst().parseString(s);
+ if (doc.get()) {
+ file = KolabXSD::file(doc);
+ }
+ }
+
+ if (!file.get()) {
+ CRITICAL("failed to parse file!");
+ return boost::shared_ptrKolab::File();
+ }
+
+ boost::shared_ptrKolab::File n = boost::shared_ptrKolab::File(new Kolab::File);
+ n->setUid(file->uid());
+ n->setCreated(*toDate(file->creation_date()));
+ n->setLastModified(*toDate(file->last_modification_date()));
+ std::vectorstd::string categories;
+ std::copy(file->categories().begin(), file->categories().end(), std::back_inserter(categories));
+ n->setCategories(categories);
+ if (file->classification()) {
+ switch (*file->classification()) {
+ case KolabXSD::File::classification_type::PUBLIC:
+ n->setClassification(Kolab::ClassPublic);
+ break;
+ case KolabXSD::File::classification_type::PRIVATE:
+ n->setClassification(Kolab::ClassPrivate);
+ break;
+ case KolabXSD::File::classification_type::CONFIDENTIAL:
+ n->setClassification(Kolab::ClassConfidential);
+ break;
+ default:
+ ERROR("unknown classification");
+ }
+ }
+
+ const Kolab::Attachment &attachment = toAttachment(file->file());
+ if (attachment.label().empty()) {
+ ERROR("Missing filename");
+ }
+ if (!attachment.isValid()) {
+ ERROR("invalid attachment");
+ }
+ n->setFile(attachment);
+
+ if (file->note()) {
+ n->setNote(*file->note());
+ }
+
+ setProductId( file->prodid() );
+ // setFormatVersion( vcards->vcard().version().text() );
+ // global_xCardVersion = vcalendar.properties().version().text();
+ setKolabVersion( file->version() );
+
+ if (!file->x_custom().empty()) {
+ std::vectorKolab::CustomProperty customProperties;
+ BOOST_FOREACH(const KolabXSD::CustomType &p, file->x_custom()) {
+ customProperties.push_back(CustomProperty(p.identifier(), p.value()));
+ }
+ n->setCustomProperties(customProperties);
+ }
+ return n;
+ } catch (const xml_schema::exception& e) {
+ std::cerr << e << std::endl;
+ } catch (...) {
+ CRITICAL("Unhandled exception");
+ }
+ CRITICAL("Failed to read file!");
+ return boost::shared_ptrKolab::File();
+}
}//Namespace
} //Namespace
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/kolabformat.cpp new/libkolabxml-0.8.3/src/kolabformat.cpp
--- old/libkolabxml-0.8.1/src/kolabformat.cpp 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/kolabformat.cpp 2013-02-26 12:31:37.000000000 +0100
@@ -169,6 +169,20 @@
return Kolab::KolabObjects::serializeObjectKolab::Note(note, productId);
}
+File readFile(const std::string& s, bool isUrl)
+{
+ boost::shared_ptr Kolab::File ptr = Kolab::KolabObjects::deserializeObjectKolab::File(s, isUrl);
+ if (!ptr.get()) {
+ return Kolab::File();
+ }
+ return *ptr;
+}
+
+std::string writeFile(const File &file, const std::string& productId)
+{
+ return Kolab::KolabObjects::serializeObjectKolab::File(file, productId);
+}
+
Configuration readConfiguration(const std::string& s, bool isUrl)
{
boost::shared_ptr Kolab::Configuration ptr = Kolab::KolabObjects::deserializeObjectKolab::Configuration(s, isUrl);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/kolabformat.h new/libkolabxml-0.8.3/src/kolabformat.h
--- old/libkolabxml-0.8.1/src/kolabformat.h 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/kolabformat.h 2013-02-26 12:31:37.000000000 +0100
@@ -27,6 +27,7 @@
#include "kolabnote.h"
#include "kolabconfiguration.h"
#include "kolabfreebusy.h"
+#include "kolabfile.h"
#include "global_definitions.h"
namespace Kolab {
@@ -122,6 +123,9 @@
Kolab::Configuration readConfiguration(const std::string& s, bool isUrl);
std::string writeConfiguration(const Kolab::Configuration &, const std::string& productId = std::string());
+Kolab::File readFile(const std::string& s, bool isUrl);
+std::string writeFile(const Kolab::File &, const std::string& productId = std::string());
+
}
#endif // KOLABFORMAT_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/kolabformat.i new/libkolabxml-0.8.3/src/kolabformat.i
--- old/libkolabxml-0.8.1/src/kolabformat.i 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/kolabformat.i 2013-02-26 12:31:37.000000000 +0100
@@ -14,6 +14,7 @@
#include "containers/kolabcontact.h"
#include "containers/kolabnote.h"
#include "containers/kolabconfiguration.h"
+ #include "containers/kolabfile.h"
%}
%include "std_string.i"
@@ -37,8 +38,13 @@
%template(vectorurl) vectorKolab::Url;
%template(vectorkey) vectorKolab::Key;
%template(vectorcategorycolor) vectorKolab::CategoryColor;
+/* %template(vectorevent) vectorKolab::Event;*/
+/* %template(vectorevent2) vector< vectorKolab::Event >;*/
};
+%rename(readKolabFile) Kolab::readFile;
+%rename(writeKolabFile) Kolab::writeFile;
+
%include "global_definitions.h"
%include "kolabformat.h"
%include "containers/kolabcontainers.h"
@@ -48,3 +54,4 @@
%include "containers/kolabcontact.h"
%include "containers/kolabnote.h"
%include "containers/kolabconfiguration.h"
+%include "containers/kolabfile.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/php/CMakeLists.txt new/libkolabxml-0.8.3/src/php/CMakeLists.txt
--- old/libkolabxml-0.8.1/src/php/CMakeLists.txt 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/php/CMakeLists.txt 2013-02-26 12:31:37.000000000 +0100
@@ -20,10 +20,19 @@
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" )
endif()
-find_package(PHP4 5.3 REQUIRED)
+# Debian (Wheezy) won't be able to find PHP using find_package. In packaging libkolabxml
+# for it, we define the include path and executable during the build.
+if (NOT PHP4_INCLUDE_PATH OR NOT PHP4_EXECUTABLE)
+ find_package(PHP4 5.3 REQUIRED)
+endif (NOT PHP4_INCLUDE_PATH OR NOT PHP4_EXECUTABLE)
-if (PHP4_FOUND)
+if (PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))
include_directories(${PHP4_INCLUDE_PATH})
+
+ # In an additional twist on Debian (Wheezy) - the PHP headers are fubar. php.h is in main/,
+ # TSRM/TSRM.h includes instead of "tsrm_config.h", and we require
+ # Zend/zend.h (included, of course, as "zend.h" without -I/usr/include/php5/Zend)
+ include_directories("${PHP4_INCLUDE_PATH}/Zend" "${PHP4_INCLUDE_PATH}/TSRM" "${PHP4_INCLUDE_PATH}/main")
add_library(phpbindings SHARED ${KOLAB_SWIG_PHP_SOURCE_FILE})
target_link_libraries(phpbindings kolabxml)
SET_TARGET_PROPERTIES(phpbindings PROPERTIES OUTPUT_NAME "kolabformat")
@@ -39,6 +48,6 @@
${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
DESTINATION ${PHP_INSTALL_DIR}
)
-else(PHP4_FOUND)
+else(PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))
message(WARNING "not building php bindings because php was not found")
-endif (PHP4_FOUND)
+endif (PHP4_FOUND OR (PHP4_INCLUDE_PATH AND PHP4_EXECUTABLE))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/src/xcalconversions.h new/libkolabxml-0.8.3/src/xcalconversions.h
--- old/libkolabxml-0.8.1/src/xcalconversions.h 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/src/xcalconversions.h 2013-02-26 12:31:37.000000000 +0100
@@ -1527,6 +1527,26 @@
{
return components.vevent().end();
}
+
+ static IncidencePtr resolveExceptions(const std::vector<IncidencePtr> &list)
+ {
+ IncidencePtr incidence = *list.begin();
+ std::vector<IncidenceType> exceptions;
+ for (std::vector < IncidencePtr >::const_iterator it = list.begin()+1; it != list.end(); it++) {
+ exceptions.push_back(**it);
+ }
+ incidence->setExceptions(exceptions);
+ return incidence;
+ }
+
+ static void addExceptions(icalendar_2_0::VcalendarType::components_type &components, const Kolab::Event &event, KolabType::properties_type props)
+ {
+ BOOST_FOREACH(const Kolab::Event &exception, event.exceptions()) {
+ KolabType ex(props);
+ writeIncidence(ex, exception);
+ addIncidence(components, ex);
+ }
+ }
};
@@ -1603,6 +1623,26 @@
return components.vtodo().end();
}
+ static IncidencePtr resolveExceptions(const std::vector<IncidencePtr> &list)
+ {
+ IncidencePtr incidence = *list.begin();
+ std::vector<IncidenceType> exceptions;
+ for (std::vector < IncidencePtr >::const_iterator it = list.begin()+1; it != list.end(); it++) {
+ exceptions.push_back(**it);
+ }
+ incidence->setExceptions(exceptions);
+ return incidence;
+ }
+
+ static void addExceptions(icalendar_2_0::VcalendarType::components_type &components, const Kolab::Todo &event, KolabType::properties_type props)
+ {
+ BOOST_FOREACH(const Kolab::Todo &exception, event.exceptions()) {
+ KolabType ex(props);
+ writeIncidence(ex, exception);
+ addIncidence(components, ex);
+ }
+ }
+
};
template < > struct IncidenceTrait Kolab::Journal
@@ -1638,6 +1678,15 @@
return components.vjournal().end();
}
+ static IncidencePtr resolveExceptions(const std::vector<IncidencePtr> &list)
+ {
+ return *list.begin();
+ }
+
+ static void addExceptions(icalendar_2_0::VcalendarType::components_type &, const Kolab::Journal &, KolabType::properties_type)
+ {
+ }
+
};
template < > struct IncidenceTrait Kolab::Freebusy
@@ -1785,6 +1834,15 @@
{
return components.vfreebusy().end();
}
+
+ static IncidencePtr resolveExceptions(const std::vector<IncidencePtr> &list)
+ {
+ return *list.begin();
+ }
+
+ static void addExceptions(icalendar_2_0::VcalendarType::components_type &, const Kolab::Freebusy &, KolabType::properties_type)
+ {
+ }
};
@@ -1825,6 +1883,8 @@
VcalendarType::components_type components;
T::addIncidence(components, inc);
+
+ T::addExceptions(components, incidence, eventProps);
VcalendarType::properties_type::prodid_type prodid(getProductId(productid));
VcalendarType::properties_type::version_type version(XCAL_VERSION);
@@ -1893,17 +1953,11 @@
global_xCalVersion = vcalendar.properties().version().text();
setKolabVersion( vcalendar.properties().x_kolab_version().text() );
-
- //TODO resolve events, exceptions can be identified based on the recurrence-id attribute
-// foreach (KCalCore::Event * event, events) {
-// if (!event->hasRecurrenceId()) {
-// return event;
-// }
-// }
- if (incidences.size() != 1) {
- WARNING("wrong number of incidences: "+ incidences.size());
+ if (incidences.empty()) {
+ CRITICAL("no incidence in object");
+ return IncidencePtr();
}
- return *incidences.begin();
+ return T::resolveExceptions(incidences);
} catch (const xml_schema::exception& e) {
std::cerr << e << std::endl;
} catch (...) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/tests/bindingstest.cpp new/libkolabxml-0.8.3/tests/bindingstest.cpp
--- old/libkolabxml-0.8.1/tests/bindingstest.cpp 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/tests/bindingstest.cpp 2013-02-26 12:31:37.000000000 +0100
@@ -116,6 +116,35 @@
QCOMPARE(re.attachments(), note.attachments());
}
+void BindingsTest::fileCompletness()
+{
+ Kolab::File file;
+ file.setUid("UID");
+ file.setCreated(Kolab::cDateTime(2006,1,6,12,0,0,true)); //UTC
+ file.setLastModified(Kolab::cDateTime(2006,1,6,12,0,0,true)); //UTC
+ file.setClassification(Kolab::ClassConfidential);
+ file.addCategory("Category");
+ file.setNote("summary");
+ Kolab::Attachment attachment;
+ attachment.setData("data", "mimetype");
+ attachment.setLabel("label");
+ file.setFile(attachment);
+
+ const std::string &result = Kolab::writeFile(file);
+ QCOMPARE(Kolab::error(), Kolab::NoError);
+// std::cout << result << std::endl;
+
+ const Kolab::File &re = Kolab::readFile(result, false);
+ QCOMPARE(Kolab::error(), Kolab::NoError);
+ QCOMPARE(re.uid(), file.uid());
+ QCOMPARE(re.created(), file.created());
+ QCOMPARE(re.lastModified(), file.lastModified());
+ QCOMPARE(re.classification(), file.classification());
+ QCOMPARE(re.categories(), file.categories());
+ QCOMPARE(re.note(), file.note());
+ QCOMPARE(re.file(), file.file());
+}
+
// void BindingsTest::eventCompletness_data()
template <typename T>
@@ -310,6 +339,37 @@
QCOMPARE(ev.duration(), e.duration());
}
+void BindingsTest::eventExceptions()
+{
+ Kolab::Event ev;
+ ev.setUid("uid1");
+ ev.setStart(Kolab::cDateTime("Europe/Zurich", 2006,1,8,12,0,0));
+ std::vectorKolab::Event exceptions;
+ Kolab::Event ex1;
+ ex1.setStart(Kolab::cDateTime("Europe/Zurich", 2006,1,8,12,0,0));
+ ex1.setUid("uid1");
+ ex1.setRecurrenceID(Kolab::cDateTime("Europe/Zurich", 2006,1,8,12,0,0), true);
+ exceptions.push_back(ex1);
+ Kolab::Event ex2;
+ ex2.setStart(Kolab::cDateTime("Europe/Zurich", 2006,1,8,12,0,0));
+ ex2.setUid("uid1");
+ ex2.setRecurrenceID(Kolab::cDateTime("Europe/Zurich", 2007,1,8,12,0,0), false);
+ exceptions.push_back(ex2);
+ ev.setExceptions(exceptions);
+
+ const std::string result = Kolab::writeEvent(ev);
+ QVERIFY(Kolab::error() == Kolab::NoError);
+// std::cout << result << endl;
+ const Kolab::Event e = Kolab::readEvent(result, false);
+ QVERIFY(Kolab::error() == Kolab::NoError);
+ QCOMPARE(e.exceptions().size(), std::size_t(2));
+ QCOMPARE(ev.exceptions().at(0).uid(), e.exceptions().at(0).uid());
+ QCOMPARE(ev.exceptions().at(0).recurrenceID(), e.exceptions().at(0).recurrenceID());
+ QCOMPARE(ev.exceptions().at(1).uid(), e.exceptions().at(1).uid());
+ QCOMPARE(ev.exceptions().at(1).recurrenceID(), e.exceptions().at(1).recurrenceID());
+
+}
+
void BindingsTest::todoCompletness()
{
Kolab::Todo ev;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/tests/bindingstest.h new/libkolabxml-0.8.3/tests/bindingstest.h
--- old/libkolabxml-0.8.1/tests/bindingstest.h 2012-08-15 16:50:12.000000000 +0200
+++ new/libkolabxml-0.8.3/tests/bindingstest.h 2013-02-26 12:31:37.000000000 +0100
@@ -25,8 +25,10 @@
void categorycolorConfigurationCompletness();
void dictionaryConfigurationCompletness();
void noteCompletness();
+ void fileCompletness();
void eventCompletness();
void eventDuration();
+ void eventExceptions();
void todoCompletness();
void dueDateDateOnly();
void journalCompletness();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/utils/CMakeLists.txt new/libkolabxml-0.8.3/utils/CMakeLists.txt
--- old/libkolabxml-0.8.1/utils/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/libkolabxml-0.8.3/utils/CMakeLists.txt 2013-02-26 12:31:37.000000000 +0100
@@ -0,0 +1,5 @@
+
+find_package(Boost REQUIRED COMPONENTS program_options)
+
+add_executable(kolabformatchecker kolabformatchecker.cpp)
+target_link_libraries(kolabformatchecker kolabxml ${Boost_LIBRARIES})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolabxml-0.8.1/utils/kolabformatchecker.cpp new/libkolabxml-0.8.3/utils/kolabformatchecker.cpp
--- old/libkolabxml-0.8.1/utils/kolabformatchecker.cpp 1970-01-01 01:00:00.000000000 +0100
+++ new/libkolabxml-0.8.3/utils/kolabformatchecker.cpp 2013-02-26 12:31:37.000000000 +0100
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2011 Christian Mollekopf
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+*/
+
+#include
+#include <iostream>
+#include <string>
+#include <vector>
+#include "src/kolabformat.h"
+
+namespace po = boost::program_options;
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+ // Declare the supported options.
+ po::options_description desc("Allowed options");
+ desc.add_options()
+ ("help", "produce help message")
+ ("contact", "parse contact")
+ ("distlist", "parse distlist")
+ ("event", "parse event")
+ ("todo", "parse todo")
+ ("journal", "parse journal")
+ ("freebusy", "parse freebusy")
+ ("note", "parse note")
+ ("configuration", "parse configuration")
+ ("file", "parse file")
+ ("input-file", po::valuestd::string >(), "input files of given type")
+ ;
+
+ po::positional_options_description p;
+ p.add("input-file", -1);
+
+ po::variables_map vm;
+ po::store(po::command_line_parser(argc, argv).
+ options(desc).positional(p).run(), vm);
+ po::notify(vm);
+
+ if (vm.count("help")) {
+ cout << desc << "\n";
+ return 1;
+ }
+
+ vector<string> inputFiles;
+ if (vm.count("input-file")) {
+ inputFiles = vm["input-file"].as< vector<string> >();
+ } else {
+ cout << "Specify input-file";
+ return -1;
+ }
+
+ for(vector<string>::const_iterator it = inputFiles.begin();
+ it != inputFiles.end(); it++){
+
+ if (vm.count("contact")) {
+ Kolab::readContact(*it, true);
+ } else if (vm.count("distlist")) {
+ Kolab::readDistlist(*it, true);
+ } else if (vm.count("event")) {
+ Kolab::readEvent(*it, true);
+ } else if (vm.count("todo")) {
+ Kolab::readTodo(*it, true);
+ } else if (vm.count("journal")) {
+ Kolab::readJournal(*it, true);
+ } else if (vm.count("freebusy")) {
+ Kolab::readFreebusy(*it, true);
+ } else if (vm.count("note")) {
+ Kolab::readNote(*it, true);
+ } else if (vm.count("configuration")) {
+ Kolab::readConfiguration(*it, true);
+ } else if (vm.count("file")) {
+ Kolab::readFile(*it, true);
+ } else {
+ cout << "Specify type";
+ return -1;
+ }
+ if (Kolab::error()) {
+ cout << "Error: " << Kolab::errorMessage() << endl;
+ return -1;
+ } else {
+ cout << "Parsed message without error." << endl;
+ }
+ }
+ return 0;
+}
\ No newline at end of file
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org