message(STATUS "NOT building xml library part")
endif(BUILD_XMLLIB)
+option(IMAP_UTF7_SUPPORT "Enable imap modified utf7 support - needs patched libiconv" OFF)
+if (IMAP_UTF7_SUPPORT)
+ message(STATUS "Build imap modified utf7 support")
+else(IMAP_UTF7_SUPPORT)
+ message(STATUS "NOT building imap modified utf7 support")
+endif(IMAP_UTF7_SUPPORT)
+
# Find external packages
include(FindPkgConfig)
endif(BUILD_XMLLIB)
# Find iconv
-pkg_check_modules(ICONV REQUIRED libiconv)
-include_directories($ICONV_INCLUDE_DIRS})
-link_directories(${ICONV_LIBRARY_DIRS})
-
+if (IMAP_UTF7_SUPPORT)
+ pkg_check_modules(ICONV REQUIRED libiconv)
+ include_directories($ICONV_INCLUDE_DIRS})
+ link_directories(${ICONV_LIBRARY_DIRS})
+endif(IMAP_UTF7_SUPPORT)
# pkgconfig output
set(prefix ${CMAKE_INSTALL_PREFIX})
%bcond_with Intra2net
%bcond_with xmllib
+%bcond_with imap_utf7_support
# Detect Intra2net build environment
%if %{with Intra2net}
%define with_xmllib 1
+ %define with_imap_utf7_support 1
%endif
Summary: library with functions common in Intra2net programs
%if %{with xmllib}
CMAKE_OPTS="$CMAKE_OPTS -DBUILD_XMLLIB=ON"
%endif
+%if %{with imap_utf7_support}
+ CMAKE_OPTS="$CMAKE_OPTS -DIMAP_UTF7_SUPPORT=ON"
+%endif
cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" $CMAKE_OPTS ../
test_timefunc.cpp
test_tmpfstream.cpp
)
+if (IMAP_UTF7_SUPPORT)
+ SET(cpp_sources stringfunc_imaputf7.cpp ${cpp_sources})
+endif (IMAP_UTF7_SUPPORT)
add_executable(test_i2ncommon ${cpp_sources})
on this file might be covered by the GNU General Public License.
*/
/***************************************************************************
- * Copyright (C) 2006 by Intra2net AG *
+ * Copyright (C) 2006-2011 by Intra2net AG *
* *
***************************************************************************/
BOOST_CHECK_EQUAL(string("8192.0 PB"), output);
}
-
-
-BOOST_AUTO_TEST_CASE(imaputf7_to_utf8)
-{
- string output = utf7imap_to_utf8("Sp&AOQ-m");
- BOOST_CHECK_EQUAL(string("Späm"), output);
-}
-
-BOOST_AUTO_TEST_CASE(utf8_to_imaputf7)
-{
- string output = utf8_to_utf7imap("Späm");
- BOOST_CHECK_EQUAL(string("Sp&AOQ-m"), output);
-}
-
-/*
-**
-*/
-
BOOST_AUTO_TEST_CASE(TestTrim)
{
std::string s("s1");
--- /dev/null
+/*
+The software in this package is distributed under the GNU General
+Public License version 2 (with a special exception described below).
+
+A copy of GNU General Public License (GPL) is included in this distribution,
+in the file COPYING.GPL.
+
+As a special exception, if other files instantiate templates or use macros
+or inline functions from this file, or you compile this file and link it
+with other works to produce a work based on this file, this file
+does not by itself cause the resulting work to be covered
+by the GNU General Public License.
+
+However the source code for this file must still be made available
+in accordance with section (3) of the GNU General Public License.
+
+This exception does not invalidate any other reasons why a work based
+on this file might be covered by the GNU General Public License.
+*/
+/***************************************************************************
+ * Copyright (C) 2011 by Intra2net AG *
+ * *
+ ***************************************************************************/
+
+#include <string>
+
+#define BOOST_TEST_DYN_LINK
+#include <boost/test/unit_test.hpp>
+
+#include <stringfunc.hxx>
+
+using namespace std;
+using namespace I2n;
+
+BOOST_AUTO_TEST_SUITE(stringfunc_imaputf7)
+
+BOOST_AUTO_TEST_CASE(imaputf7_to_utf8)
+{
+ string output = utf7imap_to_utf8("Sp&AOQ-m");
+ BOOST_CHECK_EQUAL(string("Späm"), output);
+}
+
+BOOST_AUTO_TEST_CASE(utf8_to_imaputf7)
+{
+ string output = utf8_to_utf7imap("Späm");
+ BOOST_CHECK_EQUAL(string("Sp&AOQ-m"), output);
+}
+
+BOOST_AUTO_TEST_SUITE_END()