From f087968a24574dca3ad1bf55fbd69c444e0119b4 Mon Sep 17 00:00:00 2001 From: hama Date: Wed, 21 Jan 2015 23:57:27 +0100 Subject: [PATCH] Refactoring, license --- base/ReByteBuffer.cpp | 5 +- base/ReByteBuffer.hpp | 8 +- base/ReCString.cpp | 8 +- base/ReCString.hpp | 8 +- base/ReConfigFile.cpp | 7 +- base/ReConfigFile.hpp | 6 +- base/ReDirectory.cpp | 16 +- base/ReDirectory.hpp | 8 +- base/ReException.cpp | 6 +- base/ReException.hpp | 8 +- base/ReHashList.cpp | 8 +- base/ReHashList.hpp | 8 +- base/ReI18N.cpp | 6 +- base/ReI18N.hpp | 7 +- base/ReLogger.cpp | 6 +- base/ReLogger.hpp | 8 +- base/ReProgramArgs.cpp | 6 +- base/ReProgramArgs.hpp | 8 +- base/ReSeqArray.cpp | 6 +- base/ReSeqArray.hpp | 8 +- base/ReStringList.cpp | 6 +- base/ReStringList.hpp | 8 +- base/ReStringUtils.cpp | 46 +----- base/ReStringUtils.hpp | 16 +- base/ReTestUnit.cpp | 19 ++- base/ReTestUnit.hpp | 8 +- base/ReVarArgs.cpp | 6 +- base/ReVarArgs.hpp | 8 +- base/baselocations.hpp | 6 +- base/rebase.hpp | 12 +- base/remath.hpp | 6 +- base/renet.hpp | 6 +- base/restring.hpp | 6 +- cunit/basetest.cpp | 8 +- cunit/cuReByteBuffer.cpp | 5 +- cunit/cuReCString.cpp | 6 +- cunit/cuReDirectory.cpp | 8 + cunit/cuReException.cpp | 8 + cunit/cuReHashList.cpp | 8 + cunit/cuReI18N.cpp | 8 + cunit/cuReLogger.cpp | 8 + cunit/cuReMatcher.cpp | 15 +- cunit/cuReProgramArgs.cpp | 8 + cunit/cuReRandomizer.cpp | 8 + cunit/cuReSeqArray.cpp | 8 + cunit/cuReStringList.cpp | 8 + cunit/cuReStringUtils.cpp | 8 + cunit/cuReTest.cpp | 8 + cunit/cuReTraverser.cpp | 27 ++-- cunit/cuReVarArgs.cpp | 8 + cunit/cuReconfig.cpp | 8 + cunit/testall.cpp | 6 +- math/ReObfuscator.cpp | 6 +- math/ReObfuscator.hpp | 8 +- math/ReRandomizer.cpp | 5 +- math/ReRandomizer.hpp | 7 +- math/remath.hpp | 6 +- os/ReDirTools.cpp | 316 +++++++++++++++++++------------------- os/ReDirTools.hpp | 8 +- os/ReTraverser.cpp | 36 ++--- os/ReTraverser.hpp | 10 +- os/reos.hpp | 6 +- string/ReMatcher.cpp | 6 +- string/ReMatcher.hpp | 22 ++- string/restring.hpp | 6 +- 65 files changed, 547 insertions(+), 370 deletions(-) diff --git a/base/ReByteBuffer.cpp b/base/ReByteBuffer.cpp index 8c72be5..514f2bd 100644 --- a/base/ReByteBuffer.cpp +++ b/base/ReByteBuffer.cpp @@ -1,7 +1,10 @@ /* * ReByteBuffer.cpp * - * Created on: 06.05.2010 + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReByteBuffer.hpp b/base/ReByteBuffer.hpp index e4df448..32545ce 100644 --- a/base/ReByteBuffer.hpp +++ b/base/ReByteBuffer.hpp @@ -1,8 +1,10 @@ /* - * @file ReByteBuffer.hpp + * ReByteBuffer.hpp * - * Created on: 06.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef REBYTEBUFFER_H_ diff --git a/base/ReCString.cpp b/base/ReCString.cpp index 7160bca..1d10205 100644 --- a/base/ReCString.cpp +++ b/base/ReCString.cpp @@ -1,8 +1,10 @@ /* - * ReString.cpp + * ReCString.cpp * - * Created on: 05.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReCString.hpp b/base/ReCString.hpp index b142431..3088ad2 100644 --- a/base/ReCString.hpp +++ b/base/ReCString.hpp @@ -1,8 +1,10 @@ /* - * ReString.h + * ReCString.hpp * - * Created on: 05.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef RESTRING_H_ diff --git a/base/ReConfigFile.cpp b/base/ReConfigFile.cpp index ec56b06..a7969a2 100644 --- a/base/ReConfigFile.cpp +++ b/base/ReConfigFile.cpp @@ -1,7 +1,10 @@ /* - * @file ReConfigFile.cpp + * ReConfigFile.cpp * - * @brief Configuration file handling for *.ini files. + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReConfigFile.hpp b/base/ReConfigFile.hpp index c8ac063..507ac17 100644 --- a/base/ReConfigFile.hpp +++ b/base/ReConfigFile.hpp @@ -1,8 +1,10 @@ /* * ReConfigFile.h * - * Created on: 18.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef RECONFIGFILE_H_ diff --git a/base/ReDirectory.cpp b/base/ReDirectory.cpp index 80adc7c..784f037 100644 --- a/base/ReDirectory.cpp +++ b/base/ReDirectory.cpp @@ -1,8 +1,10 @@ /* - * ReFileUtils.cpp + * ReDirectory.cpp * - * Created on: 16.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" @@ -80,13 +82,13 @@ void ReDirectory::setDir(const char* path){ m_dir = opendir(path); m_valid = m_dir != NULL; if (m_valid){ - if (m_path.at(m_path.length() - 1) != ReStringUtils::pathSeparator()) - m_path.append(ReStringUtils::pathSeparatorStr(), 1); + if (m_path.at(m_path.length() - 1) != OS_SEPARATOR_CHAR) + m_path.append(OS_SEPARATOR, 1); } #elif defined __WIN32__ struct stat info; ReByteBuffer thePath(m_path); - if (m_path.endsWith(ReStringUtils::pathSeparatorStr())) + if (m_path.endsWith(OS_SEPARATOR)) thePath.setLength(thePath.length() - 1); m_valid = stat(thePath.str(), &info) == 0 && S_ISDIR(info.st_mode); #endif @@ -149,7 +151,7 @@ bool ReDirectory::findFirst(const char* pattern, bool isRegExpr){ } #elif defined __WIN32__ ReByteBuffer full(m_path); - full.append(ReStringUtils::pathSeparatorStr(), -1).append(pattern, -1); + full.append(OS_SEPARATOR, -1).append(pattern, -1); m_handle = FindFirstFileA(full.str(), &m_data); rc = m_handle != INVALID_HANDLE_VALUE; #endif diff --git a/base/ReDirectory.hpp b/base/ReDirectory.hpp index 81634b1..f51df7c 100644 --- a/base/ReDirectory.hpp +++ b/base/ReDirectory.hpp @@ -1,8 +1,10 @@ /* - * ReFileUtils.h + * ReDirectory.hpp * - * Created on: 16.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef REFILEFINDER_H_ diff --git a/base/ReException.cpp b/base/ReException.cpp index 4f2da16..e2a2bfb 100644 --- a/base/ReException.cpp +++ b/base/ReException.cpp @@ -1,8 +1,10 @@ /* * ReException.cpp * - * Created on: 07.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReException.hpp b/base/ReException.hpp index 173b8eb..ef4a12a 100644 --- a/base/ReException.hpp +++ b/base/ReException.hpp @@ -1,8 +1,10 @@ /* - * ReException.h + * ReException.hpp * - * Created on: 07.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef REEXCEPTION_H_ diff --git a/base/ReHashList.cpp b/base/ReHashList.cpp index cc0e6b8..d264baf 100644 --- a/base/ReHashList.cpp +++ b/base/ReHashList.cpp @@ -1,8 +1,10 @@ /* - * ReStringList.cpp + * ReHashList.cpp * - * Created on: 18.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReHashList.hpp b/base/ReHashList.hpp index 1def144..3c0a249 100644 --- a/base/ReHashList.hpp +++ b/base/ReHashList.hpp @@ -1,8 +1,10 @@ /* - * ReStringList.h + * ReHashList.hpp * - * Created on: 18.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef REHASHLIST_H_ diff --git a/base/ReI18N.cpp b/base/ReI18N.cpp index 9936342..ac79491 100644 --- a/base/ReI18N.cpp +++ b/base/ReI18N.cpp @@ -1,8 +1,10 @@ /* * ReI18N.cpp * - * Created on: 22.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReI18N.hpp b/base/ReI18N.hpp index 070d00e..81c1038 100644 --- a/base/ReI18N.hpp +++ b/base/ReI18N.hpp @@ -1,7 +1,10 @@ /* - * ReI18N.h + * ReI18N.hpp * - * Created on: 22.05.2010 + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib * Author: wk */ diff --git a/base/ReLogger.cpp b/base/ReLogger.cpp index 37488ef..f222c30 100644 --- a/base/ReLogger.cpp +++ b/base/ReLogger.cpp @@ -1,8 +1,10 @@ /* * ReLogger.cpp * - * Created on: 05.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReLogger.hpp b/base/ReLogger.hpp index 07a3178..8947164 100644 --- a/base/ReLogger.hpp +++ b/base/ReLogger.hpp @@ -1,8 +1,10 @@ /* - * ReLogger.h + * ReLogger.hpp * - * Created on: 05.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef RELOGGER_H_ diff --git a/base/ReProgramArgs.cpp b/base/ReProgramArgs.cpp index 9329dee..537579c 100644 --- a/base/ReProgramArgs.cpp +++ b/base/ReProgramArgs.cpp @@ -1,8 +1,10 @@ /* * ReProgramArgs.cpp * - * Created on: 25.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReProgramArgs.hpp b/base/ReProgramArgs.hpp index dbb1b10..954eec4 100644 --- a/base/ReProgramArgs.hpp +++ b/base/ReProgramArgs.hpp @@ -1,8 +1,10 @@ /* - * ReProgramArgs.h + * ReProgramArgs.hpp * - * Created on: 25.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef REPROGRAMARGS_H_ diff --git a/base/ReSeqArray.cpp b/base/ReSeqArray.cpp index 66fe1ec..36079d1 100644 --- a/base/ReSeqArray.cpp +++ b/base/ReSeqArray.cpp @@ -1,8 +1,10 @@ /* * ReSeqArray.cpp * - * Created on: 19.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReSeqArray.hpp b/base/ReSeqArray.hpp index fa460f5..9507583 100644 --- a/base/ReSeqArray.hpp +++ b/base/ReSeqArray.hpp @@ -1,8 +1,10 @@ /* - * ReSeqArray.h + * ReSeqArray.hpp * - * Created on: 19.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef RESEQLIST_H_ diff --git a/base/ReStringList.cpp b/base/ReStringList.cpp index f0bf879..ab0d5a8 100644 --- a/base/ReStringList.cpp +++ b/base/ReStringList.cpp @@ -1,8 +1,10 @@ /* * ReStringList.cpp * - * Created on: 20.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" diff --git a/base/ReStringList.hpp b/base/ReStringList.hpp index 7f5efa8..08b1d82 100644 --- a/base/ReStringList.hpp +++ b/base/ReStringList.hpp @@ -1,8 +1,10 @@ /* - * ReStringList.h + * ReStringList.hpp * - * Created on: 20.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef RESTRINGLIST_H_ diff --git a/base/ReStringUtils.cpp b/base/ReStringUtils.cpp index 544c022..d24bb94 100644 --- a/base/ReStringUtils.cpp +++ b/base/ReStringUtils.cpp @@ -1,52 +1,16 @@ /* * ReStringUtils.cpp * - * Created on: 16.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" -#if defined __linux__ -char ReStringUtils::slash = '/'; -const char* ReStringUtils::slashStr = "/"; -#elif defined __WIN32__ -char ReStringUtils::slash = '\\'; -const char* ReStringUtils::slashStr = "\\"; -#endif const char ReStringUtils::AUTO_SEPARATOR = '\0'; - -/** @brief Initializes the os specific path separator (char and string). - * - * @return The path separator: '/' under unix and '\\' under windows. - */ -char ReStringUtils::initPathSeparator(){ - slashStr = NULL; - if (getenv("PATH") != NULL){ - if (strchr(getenv("PATH"), '\\') != NULL) - slashStr = "\\"; - else if (strchr(getenv("PATH"), '/') == NULL) - slashStr = "/"; - } - if (slashStr != NULL && getenv("TMP") != NULL){ - if (strchr(getenv("TMP"), '\\') != NULL) - slashStr = "\\"; - else if (strchr(getenv("TMP"), '/') == NULL) - slashStr = "/"; - } - if (slashStr == NULL && getenv("TEMP") != NULL){ - if (strchr(getenv("TEMP"), '\\') != NULL) - slashStr = "\\"; - else if (strchr(getenv("TMP"), '/') == NULL) - slashStr = "/"; - } - if (slashStr == NULL) - slashStr = "/"; - return slashStr[0]; -} - - /** @brief Splits a filename into its parts. * * Example: file:/etc/samba/smb.conf @@ -75,7 +39,7 @@ char ReStringUtils::initPathSeparator(){ */ void ReStringUtils::splitPath(const char* fullname, ReByteBuffer* protocol, ReByteBuffer* path, ReByteBuffer* name, ReByteBuffer* ext){ - const char currentSlash = strchr(fullname, '/') != NULL ? '/' : slash; + const char currentSlash = strchr(fullname, '/') != NULL ? '/' : OS_SEPARATOR_CHAR; const char* start = strchr(fullname, ':'); if (protocol != NULL){ protocol->setLength(0); diff --git a/base/ReStringUtils.hpp b/base/ReStringUtils.hpp index 20b667a..2c42f27 100644 --- a/base/ReStringUtils.hpp +++ b/base/ReStringUtils.hpp @@ -1,8 +1,10 @@ /* - * ReStringUtils.h + * ReStringUtils.hpp * - * Created on: 16.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef RESTRINGUTILS_H_ @@ -17,11 +19,6 @@ public: //@ If used in isInList() the first character of the list will be the separator. static const char AUTO_SEPARATOR; public: - static char initPathSeparator(); - static char pathSeparator() - { return slash; } - static const char* pathSeparatorStr() - { return slashStr; } static void splitPath(const char* fullname, ReByteBuffer* protocol, ReByteBuffer* path, ReByteBuffer* name, ReByteBuffer* ext); static ReByteBuffer& joinPath(ReByteBuffer& result, @@ -31,9 +28,6 @@ public: static int strnicmp(const char* string1, const char* string2, size_t length); static bool isInList(const char* phrase, const char* list, bool ignoreCase = true, char separator = AUTO_SEPARATOR); -private: - static char slash; - static const char* slashStr; }; #endif /* RESTRINGUTILS_H_ */ diff --git a/base/ReTestUnit.cpp b/base/ReTestUnit.cpp index 232a104..af49e6a 100644 --- a/base/ReTestUnit.cpp +++ b/base/ReTestUnit.cpp @@ -1,8 +1,10 @@ /* * ReTestUnit.cpp * - * Created on: 04.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #include "base/rebase.hpp" /** @brief Constructor. @@ -219,10 +221,10 @@ void ReTestUnit::createTestDir(){ strcpy(name, "/tmp/"); } char* ptr = name + strlen(name) - 1; - if (*ptr != ReStringUtils::pathSeparator()) - strcpy(ptr + 1, ReStringUtils::pathSeparatorStr()); + if (*ptr != OS_SEPARATOR_CHAR) + strcpy(ptr + 1, OS_SEPARATOR); strcat(ptr, "retestunit"); - strcat(ptr, ReStringUtils::pathSeparatorStr()); + strcat(ptr, OS_SEPARATOR); struct stat info; #ifdef __WIN32__ #define ALLPERMS 0 @@ -249,12 +251,9 @@ void ReTestUnit::createTestDir(){ * @return a time usable for for runtime measurement */ int ReTestUnit::milliSecSince(int64_t start){ -#if defined __linux__ +#if defined __linux__ || defined __WIN32__ int64_t diff = clock() - start; - return diff * 1000 / CLOCKS_PER_SEC; -#elif defined __WIN32__ - int64_t diff = clock() - start; - return diff * 1000 / CLOCKS_PER_SEC; + return int(diff * 1000 / CLOCKS_PER_SEC); #else # error "timer not defined" #endif diff --git a/base/ReTestUnit.hpp b/base/ReTestUnit.hpp index d902ada..87df8c4 100644 --- a/base/ReTestUnit.hpp +++ b/base/ReTestUnit.hpp @@ -1,8 +1,10 @@ /* - * ReTestUnit.h + * ReTestUnit.hpp * - * Created on: 04.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ #ifndef RETESTUNIT_H_ diff --git a/base/ReVarArgs.cpp b/base/ReVarArgs.cpp index 969da46..77f2474 100644 --- a/base/ReVarArgs.cpp +++ b/base/ReVarArgs.cpp @@ -1,8 +1,10 @@ /* * ReVarArgs.cpp * - * Created on: 05.05.2010 - * Author: wk + * License: Public domain + * Do what you want. + * No warranties and disclaimer of any damages. + * The latest sources: https://github.com/republib */ /** *
Example:
diff --git a/base/ReVarArgs.hpp b/base/ReVarArgs.hpp
index 6239c4c..b20cf3d 100644
--- a/base/ReVarArgs.hpp
+++ b/base/ReVarArgs.hpp
@@ -1,8 +1,10 @@
 /*
- * ReVarArgs.h
+ * ReVarArgs.hpp
  *
- *  Created on: 05.05.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef REVARARGS_H_
diff --git a/base/baselocations.hpp b/base/baselocations.hpp
index 86a839a..da874a0 100644
--- a/base/baselocations.hpp
+++ b/base/baselocations.hpp
@@ -1,8 +1,10 @@
 /*
  * baselocations.hpp
  *
- *  Created on: 19.05.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef BASELOCATIONS_HPP_
diff --git a/base/rebase.hpp b/base/rebase.hpp
index 8ad33c6..6f327bb 100644
--- a/base/rebase.hpp
+++ b/base/rebase.hpp
@@ -1,8 +1,10 @@
 /*
- * stdincludes.hpp
+ * rebase.hpp
  *
- *  Created on: 05.05.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 #ifndef REBASE_HPP_
 #define REBASE_HPP_
@@ -36,11 +38,15 @@ typedef u_int64_t uint64_t;
 #	define _snprintf snprintf
 #	define _memcmp(t,s,n) memcmp(t,s,n)
 #	define _mkdir(path) mkdir(path, ALLPERMS)
+#	define OS_SEPARATOR_CHAR '/'
+#	define OS_SEPARATOR "/"
 #elif defined __WIN32__
 #	include 
 #	include 
 #	define _memcmp(t,s,n) memcmp(t,s,n)
 #	define lstat stat
+#	define OS_SEPARATOR_CHAR '\\'
+#	define OS_SEPARATOR "\\"
 	typedef _int64 int64_t;
     typedef unsigned long long uint64_t;
     typedef unsigned char uint8_t;
diff --git a/base/remath.hpp b/base/remath.hpp
index a7528d5..5ea7c50 100644
--- a/base/remath.hpp
+++ b/base/remath.hpp
@@ -1,8 +1,10 @@
 /*
  * remath.hpp
  *
- *  Created on: 26.11.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef REMATH_HPP_
diff --git a/base/renet.hpp b/base/renet.hpp
index 4be9e2e..a1e33cf 100644
--- a/base/renet.hpp
+++ b/base/renet.hpp
@@ -1,8 +1,10 @@
 /*
  * renet.hpp
  *
- *  Created on: 26.11.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef RENET_HPP_
diff --git a/base/restring.hpp b/base/restring.hpp
index 3cbd7cd..82d9489 100644
--- a/base/restring.hpp
+++ b/base/restring.hpp
@@ -1,8 +1,10 @@
 /*
  * restring.hpp
  *
- *  Created on: 15.11.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef RESTRING_HPP_
diff --git a/cunit/basetest.cpp b/cunit/basetest.cpp
index 2a7d7ed..75d669e 100644
--- a/cunit/basetest.cpp
+++ b/cunit/basetest.cpp
@@ -1,8 +1,10 @@
 /*
- * stdtest.cpp
+ * basetest.cpp
  *
- *  Created on: 05.05.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 #include "base/rebase.hpp"
 #if defined RE_TESTUNIT
diff --git a/cunit/cuReByteBuffer.cpp b/cunit/cuReByteBuffer.cpp
index 41481bd..982d3fd 100644
--- a/cunit/cuReByteBuffer.cpp
+++ b/cunit/cuReByteBuffer.cpp
@@ -1,7 +1,10 @@
 /*
  * cuReByteBuffer.cpp
  *
- *  Created on: 27.11.2010
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 #include "base/rebase.hpp"
 class TestReByteBuffer : public ReTestUnit {
diff --git a/cunit/cuReCString.cpp b/cunit/cuReCString.cpp
index 931a2c4..0f4bb08 100644
--- a/cunit/cuReCString.cpp
+++ b/cunit/cuReCString.cpp
@@ -1,8 +1,10 @@
 /*
  * cuReCString.cpp
  *
- *  Created on: 23.11.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 #include "base/rebase.hpp"
 #include "string/restring.hpp"
diff --git a/cunit/cuReDirectory.cpp b/cunit/cuReDirectory.cpp
index 473e259..87f4df7 100644
--- a/cunit/cuReDirectory.cpp
+++ b/cunit/cuReDirectory.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReDirectory.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReDirectory : public ReTestUnit {
diff --git a/cunit/cuReException.cpp b/cunit/cuReException.cpp
index 0b5e3af..081ceae 100644
--- a/cunit/cuReException.cpp
+++ b/cunit/cuReException.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReException.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReException : public ReTestUnit, public ReVarArgTrigger {
diff --git a/cunit/cuReHashList.cpp b/cunit/cuReHashList.cpp
index fc21a66..6d29295 100644
--- a/cunit/cuReHashList.cpp
+++ b/cunit/cuReHashList.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReHashList.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 #include "math/remath.hpp"
 
diff --git a/cunit/cuReI18N.cpp b/cunit/cuReI18N.cpp
index 6f14ae2..23a5bba 100644
--- a/cunit/cuReI18N.cpp
+++ b/cunit/cuReI18N.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReReI18N.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReI18N : public ReTestUnit {
diff --git a/cunit/cuReLogger.cpp b/cunit/cuReLogger.cpp
index d9c4838..fff80a0 100644
--- a/cunit/cuReLogger.cpp
+++ b/cunit/cuReLogger.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReLogger.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReLogger : public ReTestUnit {
diff --git a/cunit/cuReMatcher.cpp b/cunit/cuReMatcher.cpp
index 36f7f1a..bff5965 100644
--- a/cunit/cuReMatcher.cpp
+++ b/cunit/cuReMatcher.cpp
@@ -1,9 +1,20 @@
 /*
  * cuReMatcher.cpp
  *
- *  Created on: 25.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
+/*
+ * cuReMatcher.hpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
+
 
 #include "base/rebase.hpp"
 #include "string/restring.hpp"
diff --git a/cunit/cuReProgramArgs.cpp b/cunit/cuReProgramArgs.cpp
index 075cc32..327bbe1 100644
--- a/cunit/cuReProgramArgs.cpp
+++ b/cunit/cuReProgramArgs.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReProgramArgs.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReProgramArgs : public ReTestUnit {
diff --git a/cunit/cuReRandomizer.cpp b/cunit/cuReRandomizer.cpp
index 7d2285c..6615e7b 100644
--- a/cunit/cuReRandomizer.cpp
+++ b/cunit/cuReRandomizer.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReRandomizer.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 #include "math/remath.hpp"
 
diff --git a/cunit/cuReSeqArray.cpp b/cunit/cuReSeqArray.cpp
index 6fc45b4..11d8901 100644
--- a/cunit/cuReSeqArray.cpp
+++ b/cunit/cuReSeqArray.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReSeqArray.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReSeqList : public ReTestUnit {
diff --git a/cunit/cuReStringList.cpp b/cunit/cuReStringList.cpp
index 9da0d4d..a3199fc 100644
--- a/cunit/cuReStringList.cpp
+++ b/cunit/cuReStringList.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReReStringList.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReStringList : public ReTestUnit {
diff --git a/cunit/cuReStringUtils.cpp b/cunit/cuReStringUtils.cpp
index 4832454..6a784c1 100644
--- a/cunit/cuReStringUtils.cpp
+++ b/cunit/cuReStringUtils.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReStringUtils.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReStringUtils : public ReTestUnit {
diff --git a/cunit/cuReTest.cpp b/cunit/cuReTest.cpp
index 48688ff..ca3c12a 100644
--- a/cunit/cuReTest.cpp
+++ b/cunit/cuReTest.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReTest.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestTestUnit : public ReTestUnit {
diff --git a/cunit/cuReTraverser.cpp b/cunit/cuReTraverser.cpp
index 3ef6366..4c9c0c2 100644
--- a/cunit/cuReTraverser.cpp
+++ b/cunit/cuReTraverser.cpp
@@ -1,7 +1,10 @@
 /*
  * cuReTraverser.cpp
  *
- *  Created on: 23.12.2014
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #include "base/rebase.hpp"
@@ -13,7 +16,7 @@ class TestReTraverser : public ReTestUnit {
 public:
 	TestReTraverser() : ReTestUnit("ReTraverser", __FILE__){
         m_base = testDir();
-        m_base.append("traverser").append(ReTraverser::m_separatorStr, -1);
+        m_base.append("traverser").append(OS_SEPARATOR, -1);
         _mkdir(m_base.str());
 		run();
 	}
@@ -23,7 +26,7 @@ private:
     void makeDir(const char* relPath){
         ReByteBuffer path(m_base);
         path.append("/").append(relPath);
-        path.replaceAll("/", 1, ReTraverser::m_separatorStr, -1);
+        path.replaceAll("/", 1, OS_SEPARATOR, -1);
         _mkdir(path.str());
         struct stat info;
         if (stat(path.str(), &info) != 0){
@@ -33,7 +36,7 @@ private:
     void makeFile(const char* relPath){
         ReByteBuffer path(m_base);
         path.append("/").append(relPath);
-        path.replaceAll("/", 1, ReTraverser::m_separatorStr, -1);
+        path.replaceAll("/", 1, OS_SEPARATOR, -1);
         createFile(path.str(), relPath);
         struct stat info;
         if (stat(path.str(), &info) != 0){
@@ -153,8 +156,8 @@ private:
         ReByteBuffer path, expected;
         checkT(hash.get(ReByteBuffer(node), path));
         expected.set(parent, -1);
-        if (! expected.endsWith(ReTraverser::m_separatorStr))
-            expected.append(ReTraverser::m_separatorStr);
+        if (! expected.endsWith(OS_SEPARATOR))
+            expected.append(OS_SEPARATOR);
         if (! path.endsWith(expected.str(), -1))
             checkT(false); 
     }
@@ -163,8 +166,8 @@ private:
 		RePatternList patterns;
 		// exclude */cache/*
 		ReByteBuffer buffer(";*;-*");
-		buffer.append(ReTraverser::m_separatorStr).append("cache")
-			.append(ReTraverser::m_separatorStr);
+		buffer.append(OS_SEPARATOR).append("cache")
+			.append(OS_SEPARATOR);
 		patterns.set(buffer.str());
 		traverser.setDirPattern(&patterns);
 		int level = 0;
@@ -196,8 +199,8 @@ private:
         buffer.set(list.strOf(0), list.strLengthOf(0));
         checkT(buffer.startsWith("1\t"));
         expected.set(m_base.str(), m_base.length()).append("dir1", -1)
-            .append(ReTraverser::m_separatorStr);
-        // .append(ReTraverser::m_separatorStr, -1)
+            .append(OS_SEPARATOR);
+        // .append(OS_SEPARATOR, -1)
         checkT(buffer.endsWith(expected.str()));
         
         buffer.setLength(0);
@@ -207,13 +210,13 @@ private:
         buffer.set(list.strOf(0), list.strLengthOf(0));
         checkT(buffer.startsWith("      0.000074 MB       3       4\t"));
         expected.set(m_base.str(), m_base.length()).append("dir1", -1)
-             .append(ReTraverser::m_separatorStr);
+             .append(OS_SEPARATOR);
         checkT(buffer.endsWith(expected.str()));
 
         buffer.set(list.strOf(1), list.strLengthOf(1));
         checkT(buffer.startsWith("      0.000008 MB       1       0\t"));
         expected.set(m_base.str(), m_base.length()).append("dir2", -1)
-             .append(ReTraverser::m_separatorStr);
+             .append(OS_SEPARATOR);
         checkT(buffer.endsWith(expected.str()));
 
         buffer.set(list.strOf(2), list.strLengthOf(2));
diff --git a/cunit/cuReVarArgs.cpp b/cunit/cuReVarArgs.cpp
index e6d0aea..64c1928 100644
--- a/cunit/cuReVarArgs.cpp
+++ b/cunit/cuReVarArgs.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReVarArgs.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReVarArgs : public ReTestUnit, public ReVarArgTrigger {
diff --git a/cunit/cuReconfig.cpp b/cunit/cuReconfig.cpp
index 4ee2885..798e884 100644
--- a/cunit/cuReconfig.cpp
+++ b/cunit/cuReconfig.cpp
@@ -1,3 +1,11 @@
+/*
+ * cuReConfig.cpp
+ *
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
+ */
 #include "base/rebase.hpp"
 
 class TestReConfigFile : public ReTestUnit {
diff --git a/cunit/testall.cpp b/cunit/testall.cpp
index e5fe75d..2d9cb08 100644
--- a/cunit/testall.cpp
+++ b/cunit/testall.cpp
@@ -1,8 +1,10 @@
 /*
  * testall.cpp
  *
- *  Created on: 24.11.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 #include "base/rebase.hpp"
 #include "os/reos.hpp"
diff --git a/math/ReObfuscator.cpp b/math/ReObfuscator.cpp
index bb3b973..7ad39e6 100644
--- a/math/ReObfuscator.cpp
+++ b/math/ReObfuscator.cpp
@@ -1,8 +1,10 @@
 /*
  * ReObfuscator.cpp
  *
- *  Created on: 13.11.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #include "base/rebase.hpp"
diff --git a/math/ReObfuscator.hpp b/math/ReObfuscator.hpp
index 38f5fa9..1740bcc 100644
--- a/math/ReObfuscator.hpp
+++ b/math/ReObfuscator.hpp
@@ -1,8 +1,10 @@
 /*
- * ReObfuscator.h
+ * ReObfuscator.hpp
  *
- *  Created on: 13.11.2010
- *      Author: wk
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef REOBFUSCATOR_H_
diff --git a/math/ReRandomizer.cpp b/math/ReRandomizer.cpp
index f1d4ab9..7ff8cad 100644
--- a/math/ReRandomizer.cpp
+++ b/math/ReRandomizer.cpp
@@ -1,7 +1,10 @@
 /*
  * ReRandomizer.cpp
  *
- *  Created on: 01.11.2010
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 
diff --git a/math/ReRandomizer.hpp b/math/ReRandomizer.hpp
index 63bd3c8..fec9395 100644
--- a/math/ReRandomizer.hpp
+++ b/math/ReRandomizer.hpp
@@ -1,7 +1,10 @@
 /*
- * ReRandomizer.h
+ * ReRandomizer.hpp
  *
- *  Created on: 01.11.2010
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef RANDOMIZER_H_
diff --git a/math/remath.hpp b/math/remath.hpp
index d9233c3..ac6ccd4 100644
--- a/math/remath.hpp
+++ b/math/remath.hpp
@@ -1,8 +1,10 @@
 /*
  * remath.hpp
  *
- *  Created on: 23.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef REMATH_HPP_
diff --git a/os/ReDirTools.cpp b/os/ReDirTools.cpp
index b0d09dc..b088e7c 100644
--- a/os/ReDirTools.cpp
+++ b/os/ReDirTools.cpp
@@ -1,8 +1,10 @@
 /*
- * DirTools.cpp
+ * ReDirTools.cpp
  *
- *  Created on: 30.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #include "base/rebase.hpp"
@@ -117,18 +119,6 @@ ReDirOptions::~ReDirOptions(){
 	close();
 	delete[] m_compoundUsage;
 }
-/**
- * Initializes the compound usage message array.
- *
- * @param size      the size of the array: size = (field1 + field2 + ...) * sizeof(const char*)
- */
-void ReDirOptions::initCompoundUsage(size_t size){
-    delete[] m_compoundUsage;
-    int count = size / sizeof m_compoundUsage[0];
-    m_compoundUsage = new const char*[count];
-    memset(m_compoundUsage, 0, size);
-    m_countCompoundUsage = count;
-}
 /**
  * Adds a usage component to the compound usage message list.
  * @param usage     a string vector containing a part of the usage message
@@ -171,8 +161,6 @@ void ReDirOptions::addStandardFilterOptions(){
             "units: m(inutes) h(hours), d(days). Default: m(inutes)\n"
             "examples: -o25 --older-than=30d -o24h -o2009.3.2/12:00 -o1999.01.01"),
         'o', "older-than", false, NULL);
-ReByteBuffer buffer;
-const char* ptr = m_programArgs.getString("older", buffer);
     m_programArgs.addString("pathpattern", 
         i18n("a list of patterns for the path (without basename)\n"
             "the separator is the first character of the list\n"
@@ -182,7 +170,6 @@ const char* ptr = m_programArgs.getString("older", buffer);
             "and none of the 'not patterns' matches\n"
             "examples: ';*;-*/.git/' ',*/cache/,*/temp/"),
 		'P', "path-pattern", false, NULL);
-ptr = m_programArgs.getString("older", buffer);
     m_programArgs.addString("nodepattern",
         i18n("a list of patterns for the basename (name without path) separated by ';'\n"
             "Each pattern can contain '*' as wildcard\n"
@@ -191,16 +178,13 @@ ptr = m_programArgs.getString("older", buffer);
             "of the 'not patterns' matches\n"
             "examples: '*.cpp;*.hpp;Make*' '*;-*.bak;-*~"),
         'p', "basename-pattern", false, NULL);
-ptr = m_programArgs.getString("older", buffer);
     m_programArgs.addBool("quiet",
         i18n("no additional information like runtime"),
         'q', "quiet", false);
-ptr = m_programArgs.getString("older", buffer);
     m_programArgs.addInt("trace",
         i18n("all  seconds the current path will be traced\n"
             "0: no trace"),
         'T', "trace-interval", 0);
-ptr = m_programArgs.getString("older", buffer);
     m_programArgs.addString("type",
         i18n("the file type\n"
             " is a list of  values:\n"
@@ -209,27 +193,23 @@ ptr = m_programArgs.getString("older", buffer);
             "-sets: S(pecial)=bcspo N(ondir)=Slr\n"
             "examples: -td --type=dr -tNi"), 
         't', "type", false, NULL);
-ptr = m_programArgs.getString("older", buffer);
     m_programArgs.addString("younger",
         i18n("the modification date is younger than \n"
             " is a date (e.g. 2015.02.17) or number followed by an unit\n"
             "units: m(inutes) h(hours), d(days). Default: m(inutes)"),
         'y', "younger-than", false, NULL);
-ptr = m_programArgs.getString("older", buffer);
     m_programArgs.addString("maxsize",
         i18n("the filesize is greater or equal \n"
             " is a number followed by an unit\n"
             "units: b(yte) k(Byte) K(iByte) m(Byte), M(iByte), g(Byte) G(iByte)\n"
             "examples: -Z50m --max-size=1G"),
         'Z', "max-size", false, NULL);
-ptr = m_programArgs.getString("older", buffer);
     m_programArgs.addString("minsize",
         i18n("the filesize is greater or equal \n"
             " is a number followed by an unit\n"
             "units: b(yte) k(Byte) K(iByte) m(Byte), M(iByte), g(Byte) G(iByte)\n"
             "examples: -z50m --min-size=1G"),
         'z', "min-size", false, NULL);
-ptr = m_programArgs.getString("older", buffer);
 }
 
 /**
@@ -429,43 +409,6 @@ ReDirStatus_t::Type_t ReDirOptions::checkType(const char* value){
     return (ReDirStatus_t::Type_t) rc;
 }
 
-/**
- * Sets the standard filter options given by the program arguments.
- *
- * @param filter    OUT: the filter to set
- */
-void ReDirOptions::setFilterFromProgramArgs(ReDirEntryFilter_t& filter){
-    ReByteBuffer buffer;
-    if (m_programArgs.getString("younger", buffer)[0] != '\0')
-        filter.m_maxAge = checkDate(buffer.str());
-    if (m_programArgs.getString("older", buffer)[0] != '\0')
-        filter.m_minAge = checkDate(buffer.str());
-    if (m_programArgs.getString("maxsize", buffer)[0] != '\0')
-        filter.m_maxSize = checkSize(buffer.str());
-    if (m_programArgs.getString("minsize", buffer)[0] != '\0')
-        filter.m_minSize = checkSize(buffer.str());
-    if (m_programArgs.getString("type", buffer)[0] != '\0')
-        filter.m_types = checkType(buffer.str());
-    filter.m_minDepth = m_programArgs.getInt("mindepth");
-    filter.m_maxDepth = m_programArgs.getInt("maxdepth");
-    if (m_programArgs.getString("nodepattern", buffer)[0] != '\0'){
-        checkPatternList(buffer.str());
-        m_nodePatterns.set(buffer.str());
-        filter.m_nodePatterns = &m_nodePatterns;
-    }
-    if (m_programArgs.getString("pathpattern", buffer)[0] != '\0'){
-        checkPatternList(buffer.str());
-        m_pathPatterns.set(buffer.str());
-        filter.m_pathPatterns = &m_pathPatterns;
-    }
-    filter.m_traceInterval = m_programArgs.getInt("trace");
-	if (m_programArgs.getString("output", buffer)[0] != '\0'){
-		if ( (m_output = fopen(buffer.str(), "w")) == NULL){
-			help("cannot open output file", buffer.str());
-			m_output = stdout;
-		}
-	}
-}
 /**
  * Prints a help message, the error message and exits.
  *
@@ -498,6 +441,9 @@ void ReDirOptions::checkStandardFilterOptions(){
     checkPatternList(m_programArgs.getString("pathpattern", buffer));    
 }
 
+/**
+ * Frees the resources.
+ */
 void ReDirOptions::close(){
 	if (m_output != stdout){
 		fclose(m_output);
@@ -505,6 +451,55 @@ void ReDirOptions::close(){
 	}
 }
 
+/**
+ * Initializes the compound usage message array.
+ *
+ * @param size      the size of the array: size = (field1 + field2 + ...) * sizeof(const char*)
+ */
+void ReDirOptions::initCompoundUsage(size_t size){
+    delete[] m_compoundUsage;
+    int count = size / sizeof m_compoundUsage[0];
+    m_compoundUsage = new const char*[count];
+    memset(m_compoundUsage, 0, size);
+    m_countCompoundUsage = count;
+}
+/**
+ * Sets the standard filter options given by the program arguments.
+ *
+ * @param filter    OUT: the filter to set
+ */
+void ReDirOptions::setFilterFromProgramArgs(ReDirEntryFilter_t& filter){
+    ReByteBuffer buffer;
+    if (m_programArgs.getString("younger", buffer)[0] != '\0')
+        filter.m_maxAge = checkDate(buffer.str());
+    if (m_programArgs.getString("older", buffer)[0] != '\0')
+        filter.m_minAge = checkDate(buffer.str());
+    if (m_programArgs.getString("maxsize", buffer)[0] != '\0')
+        filter.m_maxSize = checkSize(buffer.str());
+    if (m_programArgs.getString("minsize", buffer)[0] != '\0')
+        filter.m_minSize = checkSize(buffer.str());
+    if (m_programArgs.getString("type", buffer)[0] != '\0')
+        filter.m_types = checkType(buffer.str());
+    filter.m_minDepth = m_programArgs.getInt("mindepth");
+    filter.m_maxDepth = m_programArgs.getInt("maxdepth");
+    if (m_programArgs.getString("nodepattern", buffer)[0] != '\0'){
+        checkPatternList(buffer.str());
+        m_nodePatterns.set(buffer.str());
+        filter.m_nodePatterns = &m_nodePatterns;
+    }
+    if (m_programArgs.getString("pathpattern", buffer)[0] != '\0'){
+        checkPatternList(buffer.str());
+        m_pathPatterns.set(buffer.str());
+        filter.m_pathPatterns = &m_pathPatterns;
+    }
+    filter.m_traceInterval = m_programArgs.getInt("trace");
+	if (m_programArgs.getString("output", buffer)[0] != '\0'){
+		if ( (m_output = fopen(buffer.str(), "w")) == NULL){
+			help("cannot open output file", buffer.str());
+			m_output = stdout;
+		}
+	}
+}
 /**
  * Constructor.
  */
@@ -540,28 +535,6 @@ ReDirStatisticData& ReDirStatisticData::operator =(const ReDirStatisticData& sou
 	m_path = source.m_path;
 	return *this;
 }
-/**
- * Initializes the data of the instance.
- */
-void ReDirStatisticData::clear(){
-	m_sizes = 0;
-	m_files = 0;
-	m_dirs = 0;
-	m_path.setLength(0);
-}
-
-/**
- * Adds the data from another instance.
- *
- * @param source		the other instance
- * @return			the instance itself
- */
-ReDirStatisticData& ReDirStatisticData::add(const ReDirStatisticData& source){
-	m_sizes += source.m_sizes;
-	m_files += source.m_files;
-	m_dirs += source.m_dirs;
-	return *this;
-}
 
 /**
  * Constructor.
@@ -582,6 +555,7 @@ ReDirStatistic::ReDirStatistic(int deltaList, int deltaBuffer) :
         i18n("trace the current path every  seconds.\n"
             "0: no trace"),
         't', "trace-interval", 60);
+    addStandardFilterOptions();
 }
 /**
  * Destructor.
@@ -590,43 +564,27 @@ ReDirStatistic::~ReDirStatistic(){
 }
 
 /**
- * Build the statistic and print the results.
+ * Adds the data from another instance.
  *
- * @param arc   count of arguments in argv
- * @param argv  the program arguments. 
+ * @param source		the other instance
+ * @return			the instance itself
  */
-void ReDirStatistic::run(int argc, const char* argv[]){
-    time_t start = time(NULL);
-    try {
-        m_programArgs.init(argc, argv);
-        if (m_programArgs.getArgCount() < 1)
-            m_programArgs.help("statistic: missing path", false, stdout);
-        int depth = 1;
-        if (m_programArgs.getArgCount() > 1)
-            depth = atol(m_programArgs.getArg(1));
-        ReDirStatistic statistic;
-        statistic.setTraceInterval(m_programArgs.getInt("trace"));
-        void (*proc) (const ReDirStatisticData& data,
-			    ReDirStatistic& parent, ReByteBuffer& line) = &formatWithSizeFilesAndDirs;
-        if (m_programArgs.getBool("kbyte"))
-            proc = &formatLikeDu;
-        const ReStringList& list = statistic.calculate(m_programArgs.getArg(0), depth, proc);
-        ReByteBuffer buffer;
-        for (size_t ix = 0; ix < list.count(); ix++){
-            buffer.set(list.strOf(ix), list.strLengthOf(ix));
-            fprintf(m_output, "%s\n", buffer.str());
-        }
-        if (! m_programArgs.getBool("quiet")){
-            int duration = int(time(NULL) - start);
-            fprintf(m_output, "Duration: ");
-            if (duration >= 3600)
-                fprintf(m_output, "%d:", duration / 3600);
-            fprintf(m_output, "%02d:%02d\n", duration % 3600 / 60, duration % 60);
-        }
-    } catch (ReOptionException& exc) {
-        m_programArgs.help(exc.getMessage(), false, stdout);
-    }
+ReDirStatisticData& ReDirStatisticData::add(const ReDirStatisticData& source){
+	m_sizes += source.m_sizes;
+	m_files += source.m_files;
+	m_dirs += source.m_dirs;
+	return *this;
+}
+/**
+ * Initializes the data of the instance.
+ */
+void ReDirStatisticData::clear(){
+	m_sizes = 0;
+	m_files = 0;
+	m_dirs = 0;
+	m_path.setLength(0);
 }
+
 /**
  * Calculates the statistic of a directory tree.
  *
@@ -635,7 +593,10 @@ void ReDirStatistic::run(int argc, const char* argv[]){
 const ReStringList& ReDirStatistic::calculate(const char* base, int level,
 			void (*formatter)(const ReDirStatisticData& data, ReDirStatistic& parent,
 				ReByteBuffer& line)){
+   ReDirEntryFilter_t filter;
 	ReTraverser traverser(base);
+   setFilterFromProgramArgs(filter);
+   traverser.setPropertiesFromFilter(&filter);
 	if (level > 1024)
 		level = 1024;
 	else if (level < 0)
@@ -650,10 +611,11 @@ const ReStringList& ReDirStatistic::calculate(const char* base, int level,
 	ReDirStatisticData* current = dataStack[0];
 	current->m_path.set(base, -1);
 	ReByteBuffer line;
-    int traceCount = 0;
+	int traceCount = 0;
+	bool useFilter = filter.m_minSize > 0 || filter.m_maxSize != -1
+				|| filter.m_minAge != 0 || filter.m_maxAge != 0
+				|| m_nodePatterns.count() > 0;
 	while( (entry = traverser.rawNextFile(currentDepth))){
-		//@todo
-		ReByteBuffer dummy(entry->m_path); dummy.append(entry->node());
 		if (currentDepth <= level && ! entry->m_path.equals(current->m_path)){
 			if (currentDepth <= topOfStack){
 				// close the entries of the stack above the new top level:
@@ -688,7 +650,7 @@ const ReStringList& ReDirStatistic::calculate(const char* base, int level,
 		}
 		if (entry->isDirectory()){
 			current->m_dirs++;
-		} else {
+		} else if (! useFilter || filter.match(*entry)){
 			current->m_sizes += entry->fileSize();
 			current->m_files++;
             if (++traceCount % 100 == 0 && m_traceInterval > 0){
@@ -720,6 +682,44 @@ const ReStringList& ReDirStatistic::calculate(const char* base, int level,
 	return m_list;
 }
 
+/**
+ * Build the statistic and print the results.
+ *
+ * @param arc   count of arguments in argv
+ * @param argv  the program arguments.
+ */
+void ReDirStatistic::run(int argc, const char* argv[]){
+    time_t start = time(NULL);
+    try {
+        m_programArgs.init(argc, argv);
+        if (m_programArgs.getArgCount() < 1)
+            m_programArgs.help("statistic: missing path", false, stdout);
+        int depth = 1;
+        if (m_programArgs.getArgCount() > 1)
+            depth = atol(m_programArgs.getArg(1));
+        ReDirStatistic statistic;
+        statistic.setTraceInterval(m_programArgs.getInt("trace"));
+        void (*proc) (const ReDirStatisticData& data,
+			    ReDirStatistic& parent, ReByteBuffer& line) = &formatWithSizeFilesAndDirs;
+        if (m_programArgs.getBool("kbyte"))
+            proc = &formatLikeDu;
+        const ReStringList& list = statistic.calculate(m_programArgs.getArg(0), depth, proc);
+        ReByteBuffer buffer;
+        for (size_t ix = 0; ix < list.count(); ix++){
+            buffer.set(list.strOf(ix), list.strLengthOf(ix));
+            fprintf(m_output, "%s\n", buffer.str());
+        }
+        if (! m_programArgs.getBool("quiet")){
+            int duration = int(time(NULL) - start);
+            fprintf(m_output, "Duration: ");
+            if (duration >= 3600)
+                fprintf(m_output, "%d:", duration / 3600);
+            fprintf(m_output, "%02d:%02d\n", duration % 3600 / 60, duration % 60);
+        }
+    } catch (ReOptionException& exc) {
+        m_programArgs.help(exc.getMessage(), false, stdout);
+    }
+}
 /**
  * Formats a line like the du (disk usage) command.
  *
@@ -758,21 +758,6 @@ void formatWithSizeFilesAndDirs(const ReDirStatisticData& data,
         data.m_sizes / 1E6, data.m_files, data.m_dirs);
 	line.append(buffer, -1).append(data.m_path);
 }
-/**
- * Prints an message how to use the program and exits.
- *
- * @param msg       an error message
- * @param msg2      an addition to the error message or NULL
- */
-void ReDirTools::usage(const char* msg, const char* msg2){
-    printf ("Version: %s\n", m_version);
-    printf ("usage: dirtool  \n");
-    statisticUsage();
-    if (msg != NULL)
-        printf ("+++ %s%s\n", msg, msg2 == NULL ? "" : msg2);
-    exit(1);
-}
-
 /**
  * Prints a vector of lines.
  * 
@@ -792,6 +777,21 @@ void ReDirTools::statisticUsage(){
     statistic.programArgs().help(NULL, false, stdout);
 }
 
+/**
+ * Prints an message how to use the program and exits.
+ *
+ * @param msg       an error message
+ * @param msg2      an addition to the error message or NULL
+ */
+void ReDirTools::usage(const char* msg, const char* msg2){
+    printf ("Version: %s\n", m_version);
+    printf ("usage: dirtool  \n");
+    statisticUsage();
+    if (msg != NULL)
+        printf ("+++ %s%s\n", msg, msg2 == NULL ? "" : msg2);
+    exit(1);
+}
+
 /**
  * Constructor.
  */
@@ -827,8 +827,7 @@ void ReDirList::list(int argc, const char* argv[]){
         for (int ix = 0; noPath || ix < m_programArgs.getArgCount(); ix++){
             ReTraverser traverser(noPath ? "." : m_programArgs.getArg(ix));
             noPath = false;
-            traverser.setMinLevel(filter.m_maxDepth);
-            traverser.setMaxLevel(filter.m_maxDepth);
+			traverser.setPropertiesFromFilter(&filter);
             int level;
             ReDirStatus_t* entry;
             while( (entry = traverser.nextFile(level, &filter)) != NULL){
@@ -977,8 +976,7 @@ void ReDirBatch::createBatch(int argc, const char* argv[]){
 #endif
         for (int ix = 0; ix < m_programArgs.getArgCount(); ix++){
             ReTraverser traverser(m_programArgs.getArg(ix));
-            traverser.setMinLevel(filter.m_maxDepth);
-            traverser.setMaxLevel(filter.m_maxDepth);
+            traverser.setPropertiesFromFilter(&filter);
             int level;
             ReDirStatus_t* entry;
             ReByteBuffer line;
@@ -1029,7 +1027,7 @@ void makeDirWithParents(ReByteBuffer& path, int minWidth){
     struct stat info;
     do {
         path2 = path;
-        int ix = path.indexOf(ReTraverser::m_separatorStr, minWidth);
+        int ix = path.indexOf(OS_SEPARATOR, minWidth);
         path2.setLength(minWidth);
         
     } while(false);
@@ -1162,7 +1160,7 @@ bool ReDirSync::copyFile(const char* source, time_t modified, int64_t size,
  */
 void ReDirSync::synchronize(int argc, const char* argv[]){
     ReDirEntryFilter_t filter;
-    const char* sep = ReTraverser::m_separatorStr;
+    const char* sep = OS_SEPARATOR;
     struct stat info;
     try {
         time_t start = time(NULL);
@@ -1208,8 +1206,7 @@ void ReDirSync::synchronize(int argc, const char* argv[]){
             size_t ixTargetRelative = target.length();
 
             ReTraverser traverser(source.str());
-            traverser.setMinLevel(filter.m_maxDepth);
-            traverser.setMaxLevel(filter.m_maxDepth);
+            traverser.setPropertiesFromFilter(&filter);
             int level;
             ReDirStatus_t* entry;
             ReByteBuffer line;
@@ -1267,17 +1264,6 @@ void ReDirSync::synchronize(int argc, const char* argv[]){
     }
 }
 
-/**
- * Gets the arguments for the "statistic" command and execute this.
- *
- * @param argc      the number of arguments
- * @param argav     the argument vector
- */
-void ReDirTools::list(int argc, const char* argv[]){
-    ReDirList lister;
-    lister.list(argc, argv);
-}
-
 /**
  * Gets the arguments for the "batch" command and execute this.
  *
@@ -1339,9 +1325,9 @@ void ReDirTools::help(int argc, const char* argv[]){
  * @param argc      the number of arguments
  * @param argav     the argument vector
  */
-void ReDirTools::statistic(int argc, const char* argv[]){
-    ReDirStatistic statistic;
-    statistic.run(argc, argv);
+void ReDirTools::list(int argc, const char* argv[]){
+    ReDirList lister;
+    lister.list(argc, argv);
 }
 
 /**
@@ -1376,3 +1362,15 @@ int ReDirTools::main(int argc, char* orgArgv[]){
  	ReLogger::freeGlobalLogger();
     return 0;
 }
+
+/**
+ * Gets the arguments for the "statistic" command and execute this.
+ *
+ * @param argc      the number of arguments
+ * @param argav     the argument vector
+ */
+void ReDirTools::statistic(int argc, const char* argv[]){
+    ReDirStatistic statistic;
+    statistic.run(argc, argv);
+}
+
diff --git a/os/ReDirTools.hpp b/os/ReDirTools.hpp
index 12b571a..f1d5afb 100644
--- a/os/ReDirTools.hpp
+++ b/os/ReDirTools.hpp
@@ -1,8 +1,10 @@
 /*
  * DirTools.hpp
  *
- *  Created on: 30.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef OS_DIRTOOLS_HPP_
@@ -19,11 +21,11 @@ public:
     const char* checkPatternList(const char* value);
     int64_t checkSize(const char* value);
     void checkStandardFilterOptions();
-	void close();
     ReDirStatus_t::Type_t checkType(const char* value);
 	/** Returns the compound usage message.
 	 * @return the compound usage message
 	 */
+	void close();
     const char** compoundUsage() const
     { return m_compoundUsage; }
     void initCompoundUsage(size_t size);
diff --git a/os/ReTraverser.cpp b/os/ReTraverser.cpp
index d87066f..5703154 100644
--- a/os/ReTraverser.cpp
+++ b/os/ReTraverser.cpp
@@ -1,21 +1,15 @@
 /*
  * ReTraverser.cpp
  *
- *  Created on: 23.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #include "base/rebase.hpp"
 #include "os/reos.hpp"
 
-#ifdef __linux__
-const char ReTraverser::m_separator = '/';
-const char* const ReTraverser::m_separatorStr = "/";
-#elif defined __WIN32__
-const char ReTraverser::m_separator = '\\';
-const char* const ReTraverser::m_separatorStr = "\\";
-#endif
-
 /**
  * Constructor.
 */
@@ -339,8 +333,6 @@ bool ReDirEntryFilter_t::match(ReDirStatus_t& entry){
 		if (0 == (entry.type() & m_types))
 			break;
         int64_t size = entry.fileSize();
-        if (strstr(entry.node(), ".exe"))
-            ReByteBuffer breaker;
         if (m_minSize > 0 && size < m_minSize)
 			break;
 		if (m_maxSize >= 0 && size > m_maxSize)
@@ -351,8 +343,6 @@ bool ReDirEntryFilter_t::match(ReDirStatus_t& entry){
 			break;
 		if (m_nodePatterns != NULL && ! m_nodePatterns->match(entry.node()))
 			break;
-		if (m_pathPatterns != NULL && ! m_pathPatterns->match(entry.m_path.str()))
-			break;
 		rc = true;
 	} while(false);
 	return rc;
@@ -390,7 +380,7 @@ ReTraverser::ReTraverser(const char* base) :
 	memset(m_dirs, 0, sizeof m_dirs);
 	m_dirs[0] = new ReDirStatus_t();
 	// remove a preceeding "./". This simplifies the pattern expressions:
-	if (m_base.startsWith(ReByteBuffer(".").append(m_separatorStr, 1).str())){
+	if (m_base.startsWith(ReByteBuffer(".").append(OS_SEPARATOR, 1).str())){
 		m_base.remove(0, 2);
 	}
 }
@@ -523,14 +513,24 @@ bool ReTraverser::initEntry(const ReByteBuffer& parent, const char* node, int le
         current->m_passNo = 1;
         if (level >= 0){
             current->m_path.set(parent.str(), parent.length());
-            if (! parent.endsWith(m_separatorStr))
-                current->m_path.append(m_separatorStr);
+            if (! parent.endsWith(OS_SEPARATOR))
+                current->m_path.append(OS_SEPARATOR);
             if (node != NULL)
-                current->m_path.append(node).append(m_separatorStr);
+                current->m_path.append(node).append(OS_SEPARATOR);
         }
       rc = current->findFirst();
 	}
     return rc;
 }
 
+/**
+ * Sets some properties from a filter.
+ *
+ * @param filter	the filter with the properties to set
+ */
+void ReTraverser::setPropertiesFromFilter(ReDirEntryFilter_t* filter){
+	m_minLevel = filter->m_minDepth;
+	m_maxLevel = filter->m_maxDepth;
+	m_dirPatterns = filter->m_pathPatterns;
+}
 
diff --git a/os/ReTraverser.hpp b/os/ReTraverser.hpp
index 24e161b..68c3424 100644
--- a/os/ReTraverser.hpp
+++ b/os/ReTraverser.hpp
@@ -1,8 +1,10 @@
 /*
  * RpTraverser.hpp
  *
- *  Created on: 23.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef OS_RETRAVERSER_HPP_
@@ -119,6 +121,7 @@ public:
     */
     void setMinLevel(int value)
     { m_minLevel = value; }
+    void setPropertiesFromFilter(ReDirEntryFilter_t* filter);
 protected:
 	bool initEntry(const ReByteBuffer& parent, const char* node, int level);
 	void freeEntry(int level);
@@ -145,9 +148,6 @@ protected:
 	/// a subdirectory will be entered only if this pattern list matches
 	/// if NULL any directory will be entered
 	RePatternList* m_dirPatterns;
-public:
-	static const char m_separator;
-	static const char* const m_separatorStr;
 };
 
 #endif /* OS_RETRAVERSER_HPP_ */
diff --git a/os/reos.hpp b/os/reos.hpp
index 3b513a9..cbdb7b7 100644
--- a/os/reos.hpp
+++ b/os/reos.hpp
@@ -1,8 +1,10 @@
 /*
  * reos.hpp
  *
- *  Created on: 23.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef OS_REOS_HPP_
diff --git a/string/ReMatcher.cpp b/string/ReMatcher.cpp
index 80b37f6..4ebae0d 100644
--- a/string/ReMatcher.cpp
+++ b/string/ReMatcher.cpp
@@ -1,8 +1,10 @@
 /*
  * ReMatcher.cpp
  *
- *  Created on: 25.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #include "base/rebase.hpp"
diff --git a/string/ReMatcher.hpp b/string/ReMatcher.hpp
index 3567e9b..9e7b0e5 100644
--- a/string/ReMatcher.hpp
+++ b/string/ReMatcher.hpp
@@ -1,8 +1,10 @@
 /*
  * ReMatcher.hpp
  *
- *  Created on: 25.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef STRING_REMATCHER_HPP_
@@ -87,15 +89,21 @@ public:
 	RePatternList();
 	~RePatternList();
 public:
+	/** @brief Returns the number of entries in the list.
+	 * @return the count of patterns in the list
+	 */
+   inline int count() const {
+  	 return m_count;
+   }
 	void destroy();
 	bool match(const char* pattern);
+   /** Returns the original pattern string.
+    * @return the string describing the patterns.
+    */
+   const char* patternString() const
+   { return m_patternString.str(); }
 	void set(const char* patterns, bool ignoreCase = false,
 				const char* separator = NULL, const char* notPrefix = "-");
-    /** Returns the original pattern string.
-     * @return the string describing the patterns.
-     */
-    const char* patternString() const
-    { return m_patternString.str(); }
 private:
 	int setOne(int index, const char* pattern, size_t patternLength,
 				bool ignoreCase, const ReByteBuffer& notPrefix);
diff --git a/string/restring.hpp b/string/restring.hpp
index d233d62..59f1988 100644
--- a/string/restring.hpp
+++ b/string/restring.hpp
@@ -1,8 +1,10 @@
 /*
  * restring.hpp
  *
- *  Created on: 25.12.2014
- *      Author: hm
+ * License: Public domain
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * The latest sources: https://github.com/republib
  */
 
 #ifndef STRING_RESTRING_HPP_
-- 
2.39.5