From af7689e3e8751d752e68fb63f6d73d97fa8e13cb Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 28 Nov 2018 14:15:49 +0100 Subject: [PATCH] [API break] Move all the tools in the tools directory instead of common. The `common` name is from the time where kiwix was only one repository for all the project (android, desktop, server...). Now we have split the repositories and kiwix-lib is the "common" repo, the "common" directory is somehow nonsense. --- include/entry.h | 1 - include/meson.build | 14 +++++++------- include/opds_dumper.h | 6 +++--- include/reader.h | 4 ++-- include/searcher.h | 4 ++-- include/{common => tools}/base64.h | 0 include/{common => tools}/networkTools.h | 0 include/{common => tools}/otherTools.h | 0 include/{common => tools}/pathTools.h | 0 include/{common => tools}/regexTools.h | 0 include/{common => tools}/stringTools.h | 0 src/android/kiwixreader.cpp | 2 +- src/aria2.cpp | 4 ++-- src/book.cpp | 6 +++--- src/downloader.cpp | 4 ++-- src/library.cpp | 6 +++--- src/libxml_dumper.cpp | 6 +++--- src/meson.build | 12 ++++++------ src/opds_dumper.cpp | 2 +- src/{common => tools}/base64.cpp | 2 +- src/{common => tools}/networkTools.cpp | 2 +- src/{common => tools}/otherTools.cpp | 2 +- src/{common => tools}/pathTools.cpp | 2 +- src/{common => tools}/regexTools.cpp | 2 +- src/{common => tools}/stringTools.cpp | 2 +- src/xmlrpc.h | 2 +- 26 files changed, 42 insertions(+), 43 deletions(-) rename include/{common => tools}/base64.h (100%) rename include/{common => tools}/networkTools.h (100%) rename include/{common => tools}/otherTools.h (100%) rename include/{common => tools}/pathTools.h (100%) rename include/{common => tools}/regexTools.h (100%) rename include/{common => tools}/stringTools.h (100%) rename src/{common => tools}/base64.cpp (99%) rename src/{common => tools}/networkTools.cpp (99%) rename src/{common => tools}/otherTools.cpp (99%) rename src/{common => tools}/pathTools.cpp (99%) rename src/{common => tools}/regexTools.cpp (98%) rename src/{common => tools}/stringTools.cpp (99%) diff --git a/include/entry.h b/include/entry.h index c47d33912..f7d6d182c 100644 --- a/include/entry.h +++ b/include/entry.h @@ -24,7 +24,6 @@ #include #include #include -#include "common.h" using namespace std; diff --git a/include/meson.build b/include/meson.build index 4ba3420cf..75febaf5d 100644 --- a/include/meson.build +++ b/include/meson.build @@ -15,12 +15,12 @@ headers = [ install_headers(headers, subdir:'kiwix') install_headers( - 'common/base64.h', - 'common/networkTools.h', - 'common/otherTools.h', - 'common/pathTools.h', - 'common/regexTools.h', - 'common/stringTools.h', - subdir:'kiwix/common' + 'tools/base64.h', + 'tools/networkTools.h', + 'tools/otherTools.h', + 'tools/pathTools.h', + 'tools/regexTools.h', + 'tools/stringTools.h', + subdir:'kiwix/tools' ) diff --git a/include/opds_dumper.h b/include/opds_dumper.h index c4b9e9095..c6cc60d3d 100644 --- a/include/opds_dumper.h +++ b/include/opds_dumper.h @@ -26,9 +26,9 @@ #include -#include "common/base64.h" -#include "common/pathTools.h" -#include "common/regexTools.h" +#include "tools/base64.h" +#include "tools/pathTools.h" +#include "tools/regexTools.h" #include "library.h" #include "reader.h" diff --git a/include/reader.h b/include/reader.h index 4301ea35c..f9c64e6f7 100644 --- a/include/reader.h +++ b/include/reader.h @@ -31,8 +31,8 @@ #include #include "common.h" #include "entry.h" -#include "common/pathTools.h" -#include "common/stringTools.h" +#include "tools/pathTools.h" +#include "tools/stringTools.h" using namespace std; diff --git a/include/searcher.h b/include/searcher.h index a30b01136..f40ab9624 100644 --- a/include/searcher.h +++ b/include/searcher.h @@ -29,8 +29,8 @@ #include #include #include -#include "common/pathTools.h" -#include "common/stringTools.h" +#include "tools/pathTools.h" +#include "tools/stringTools.h" #include "kiwix_config.h" using namespace std; diff --git a/include/common/base64.h b/include/tools/base64.h similarity index 100% rename from include/common/base64.h rename to include/tools/base64.h diff --git a/include/common/networkTools.h b/include/tools/networkTools.h similarity index 100% rename from include/common/networkTools.h rename to include/tools/networkTools.h diff --git a/include/common/otherTools.h b/include/tools/otherTools.h similarity index 100% rename from include/common/otherTools.h rename to include/tools/otherTools.h diff --git a/include/common/pathTools.h b/include/tools/pathTools.h similarity index 100% rename from include/common/pathTools.h rename to include/tools/pathTools.h diff --git a/include/common/regexTools.h b/include/tools/regexTools.h similarity index 100% rename from include/common/regexTools.h rename to include/tools/regexTools.h diff --git a/include/common/stringTools.h b/include/tools/stringTools.h similarity index 100% rename from include/common/stringTools.h rename to include/tools/stringTools.h diff --git a/src/android/kiwixreader.cpp b/src/android/kiwixreader.cpp index bc58cd87e..91f409db7 100644 --- a/src/android/kiwixreader.cpp +++ b/src/android/kiwixreader.cpp @@ -24,7 +24,7 @@ #include #include "org_kiwix_kiwixlib_JNIKiwixReader.h" -#include "common/base64.h" +#include "tools/base64.h" #include "reader.h" #include "utils.h" diff --git a/src/aria2.cpp b/src/aria2.cpp index 0048ebd0f..06a3b9611 100644 --- a/src/aria2.cpp +++ b/src/aria2.cpp @@ -5,8 +5,8 @@ #include #include #include -#include -#include +#include +#include #include // For AriaError #ifdef _WIN32 diff --git a/src/book.cpp b/src/book.cpp index 0eafff34c..43bfaaff9 100644 --- a/src/book.cpp +++ b/src/book.cpp @@ -20,9 +20,9 @@ #include "book.h" #include "reader.h" -#include "common/base64.h" -#include "common/regexTools.h" -#include "common/networkTools.h" +#include "tools/base64.h" +#include "tools/regexTools.h" +#include "tools/networkTools.h" #include diff --git a/src/downloader.cpp b/src/downloader.cpp index 778ad3fb8..e962aabef 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -18,7 +18,7 @@ */ #include "downloader.h" -#include "common/pathTools.h" +#include "tools/pathTools.h" #include #include @@ -28,7 +28,7 @@ #include "aria2.h" #include "xmlrpc.h" -#include "common/otherTools.h" +#include "tools/otherTools.h" #include namespace kiwix diff --git a/src/library.cpp b/src/library.cpp index c4e9a9f5b..ac8adb8fb 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -21,9 +21,9 @@ #include "book.h" #include "libxml_dumper.h" -#include "common/base64.h" -#include "common/regexTools.h" -#include "common/pathTools.h" +#include "tools/base64.h" +#include "tools/regexTools.h" +#include "tools/pathTools.h" #include #include diff --git a/src/libxml_dumper.cpp b/src/libxml_dumper.cpp index 84092decd..18b3f1bc9 100644 --- a/src/libxml_dumper.cpp +++ b/src/libxml_dumper.cpp @@ -20,9 +20,9 @@ #include "libxml_dumper.h" #include "book.h" -#include -#include -#include +#include +#include +#include namespace kiwix { diff --git a/src/meson.build b/src/meson.build index e7dba4715..17fdff9b1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -11,12 +11,12 @@ kiwix_sources = [ 'searcher.cpp', 'subprocess.cpp', 'aria2.cpp', - 'common/base64.cpp', - 'common/pathTools.cpp', - 'common/regexTools.cpp', - 'common/stringTools.cpp', - 'common/networkTools.cpp', - 'common/otherTools.cpp', + 'tools/base64.cpp', + 'tools/pathTools.cpp', + 'tools/regexTools.cpp', + 'tools/stringTools.cpp', + 'tools/networkTools.cpp', + 'tools/otherTools.cpp', ] kiwix_sources += lib_resources diff --git a/src/opds_dumper.cpp b/src/opds_dumper.cpp index 2105dc42b..6d35b94d2 100644 --- a/src/opds_dumper.cpp +++ b/src/opds_dumper.cpp @@ -20,7 +20,7 @@ #include "opds_dumper.h" #include "book.h" -#include +#include namespace kiwix { diff --git a/src/common/base64.cpp b/src/tools/base64.cpp similarity index 99% rename from src/common/base64.cpp rename to src/tools/base64.cpp index c2f7538d6..48cdaef3c 100644 --- a/src/common/base64.cpp +++ b/src/tools/base64.cpp @@ -24,7 +24,7 @@ René Nyffenegger rene.nyffenegger@adp-gmbh.ch */ -#include +#include #include static const std::string base64_chars = diff --git a/src/common/networkTools.cpp b/src/tools/networkTools.cpp similarity index 99% rename from src/common/networkTools.cpp rename to src/tools/networkTools.cpp index d71f1c50b..3c69bad16 100644 --- a/src/common/networkTools.cpp +++ b/src/tools/networkTools.cpp @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -#include +#include #ifdef _WIN32 #include diff --git a/src/common/otherTools.cpp b/src/tools/otherTools.cpp similarity index 99% rename from src/common/otherTools.cpp rename to src/tools/otherTools.cpp index 52d2c2d25..c9ed7f034 100644 --- a/src/common/otherTools.cpp +++ b/src/tools/otherTools.cpp @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -#include +#include #include static std::map codeisomapping { diff --git a/src/common/pathTools.cpp b/src/tools/pathTools.cpp similarity index 99% rename from src/common/pathTools.cpp rename to src/tools/pathTools.cpp index 198dd3272..f85daff0e 100644 --- a/src/common/pathTools.cpp +++ b/src/tools/pathTools.cpp @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -#include +#include #ifdef __APPLE__ #include diff --git a/src/common/regexTools.cpp b/src/tools/regexTools.cpp similarity index 98% rename from src/common/regexTools.cpp rename to src/tools/regexTools.cpp index bdaaa6f3d..912be6cd4 100644 --- a/src/common/regexTools.cpp +++ b/src/tools/regexTools.cpp @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -#include +#include std::map regexCache; diff --git a/src/common/stringTools.cpp b/src/tools/stringTools.cpp similarity index 99% rename from src/common/stringTools.cpp rename to src/tools/stringTools.cpp index ebd4bca49..91d5d0249 100644 --- a/src/common/stringTools.cpp +++ b/src/tools/stringTools.cpp @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -#include +#include #include #include diff --git a/src/xmlrpc.h b/src/xmlrpc.h index 8e6c6d306..f770bbc34 100644 --- a/src/xmlrpc.h +++ b/src/xmlrpc.h @@ -3,7 +3,7 @@ #ifndef KIWIX_XMLRPC_H_ #define KIWIX_XMLRPC_H_ -#include +#include namespace kiwix {