AC_INIT([libACL], [0.3], [arjen@androemda.nl])
AC_CONFIG_SRCDIR([src/date.cpp])
AM_INIT_AUTOMAKE
+AC_LANG(C++)
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile doc/Makefile])
AC_CONFIG_HEADERS([config.h])
hour.cpp utc.cpp \
Integer.cpp \
xml.cpp \
- configuration.cpp
+ configuration.cpp \
+ _version.c
-libACL_la_LDFLAGS = -version-info 0:3:0
+libACL_la_LDFLAGS = -release 0.3.1
include_HEADERS = String.h date.h Integer.h xml.h configuration.h
*/
friend std::ostream& operator<<(std::ostream &, const String &);
+ // Read one line and remove the trailing line feed.
friend std::istream& operator>>(std::istream &, String &);
/*
--- /dev/null
+int ACL_Version()
+{
+ return 3;
+}
AM_CPPFLAGS = -I../src
LDADD = ../src/.libs/libACL.la
-check_PROGRAMS = string_assign string_basics string_compare string_cat string_substring string_regex \
+check_PROGRAMS = string_assign string_basics string_compare string_cat string_modify string_shift string_substring string_regex \
date_assign date_parse date_compare date_arithmetic date_attributes date_check_today \
hour_assign hour_parse hour_compare hour_arithmetic hour_check_now \
utc_assign utc_parse utc_compare utc_arithmetic utc_convert \
string_basics_SOURCES = string_basics.cpp
string_compare_SOURCES = string_compare.cpp
string_cat_SOURCES = string_cat.cpp
+string_modify_SOURCES = string_modify.cpp
+string_shift_SOURCES = string_shift.cpp
string_substring_SOURCES = string_substring.cpp
string_regex_SOURCES = string_regex.cpp
--- /dev/null
+/*******************************************************
+ * Unit test for the String class
+ *
+ * test modification operations
+ ******************************************************
+ *
+ */
+
+#include "String.h"
+#include <assert.h>
+
+int main()
+{
+
+ // Upper and lower case conversion
+
+ String s1 = "Abc-12.3dE";
+
+ String s2 = s1.upper();
+ std::cout << s1 << " converted to upper case is" << s2 << "\n";
+ assert(s2 == "ABC-12.3DE");
+
+ String s3 = s1.lower();
+ std::cout << s1 << " converted to lower case is" << s3 << "\n";
+ assert(s3 == "abc-12.3de");
+ assert(s3.upper() == s2);
+
+ // Escaping special characters
+
+ String s4 = "\a\b\f\n\r\t\v\"'\\\xC0\x02";
+ String s5 = s4.escape();
+ std::cout << "Escaped sequence = " << s5 << "\n";
+ assert (s5.unescape() == s4);
+
+
+ return 0;
+}
+
--- /dev/null
+Abc-12.3dE converted to upper case isABC-12.3DE
+Abc-12.3dE converted to lower case isabc-12.3de
+Escaped sequence = \a\b\f\n\r\t\v\"\'\\\xC0\x02
+PASS string_modify (exit status: 0)
--- /dev/null
+/*******************************************************
+ * Unit test for the String class
+ *
+ * test string shift operations
+ ******************************************************
+ *
+ */
+
+#include "String.h"
+#include <assert.h>
+
+int main()
+{
+
+ String s1 = "abcdefghij";
+
+ String s2 = s1 << 3;
+ std::cout << s1 << " << 3 = " << s2 << "\n";
+ assert(s2 == "defghij");
+
+ String s3 = s1 >> 3;
+ std::cout << s1 << " >> 3 = " << s3 << "\n";
+ assert(s3 == "abcdefg");
+
+ String s4 = "abcdefghij";
+ std::cout << s4 << " <<= 5 : ";
+ s4 <<= 5;
+ std::cout << s4 << "\n";
+ assert(s4 == "fghij");
+
+ String s5 = "abcdefghij";
+ std::cout << s5 << " >>= 5 : ";
+ s5 >>= 5;
+ std::cout << s5 << "\n";
+ assert(s5 == "abcde");
+
+ return 0;
+}
+
--- /dev/null
+abcdefghij << 3 = defghij
+abcdefghij >> 3 = abcdefg
+abcdefghij <<= 5 : fghij
+abcdefghij >>= 5 : abcde
+PASS string_shift (exit status: 0)