From 283bc34244d24be02e90b767a82826a4ca8da186 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 19 Mar 2021 10:06:06 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro --- src/helpers/sub2qt.cpp | 2 +- src/helpers/sub2qt.h | 2 +- src/ksvnwidgets/depthselector.cpp | 2 +- src/ksvnwidgets/depthselector.h | 2 +- src/ksvnwidgets/logmsg_impl.h | 2 +- src/ksvnwidgets/revertform_impl.h | 2 +- src/svnfrontend/blamedisplay_impl.cpp | 2 +- src/svnfrontend/blamedisplay_impl.h | 2 +- src/svnfrontend/cacheentry.h | 6 +- src/svnfrontend/ccontextlistener.h | 4 +- src/svnfrontend/commandexec.cpp | 6 +- src/svnfrontend/filelistviewitem.cpp | 8 +- src/svnfrontend/filelistviewitem.h | 2 +- src/svnfrontend/fillcachethread.cpp | 6 +- src/svnfrontend/fillcachethread.h | 6 +- src/svnfrontend/frontendtypes.h | 2 +- src/svnfrontend/fronthelpers/checkoutinfo_impl.cpp | 2 +- src/svnfrontend/fronthelpers/checkoutinfo_impl.h | 4 +- src/svnfrontend/fronthelpers/propertylist.h | 2 +- src/svnfrontend/fronthelpers/rangeinput_impl.h | 2 +- src/svnfrontend/fronthelpers/revisionbuttonimpl.h | 2 +- src/svnfrontend/graphtree/elogentry.h | 2 +- src/svnfrontend/graphtree/revgraphview.cpp | 2 +- src/svnfrontend/graphtree/revgraphview.h | 2 +- src/svnfrontend/graphtree/revisiontree.cpp | 8 +- src/svnfrontend/graphtree/revisiontree.h | 6 +- src/svnfrontend/graphtree/revtreewidget.h | 2 +- src/svnfrontend/importdir_logmsg.cpp | 2 +- src/svnfrontend/itemdisplay.cpp | 2 +- src/svnfrontend/itemdisplay.h | 2 +- src/svnfrontend/mergedlg_impl.cpp | 2 +- src/svnfrontend/modifiedthread.cpp | 2 +- src/svnfrontend/modifiedthread.h | 6 +- src/svnfrontend/propertiesdlg.cpp | 2 +- src/svnfrontend/propertiesdlg.h | 4 +- src/svnfrontend/svnactions.cpp | 22 +- src/svnfrontend/svnactions.h | 10 +- src/svnfrontend/svnitem.cpp | 6 +- src/svnfrontend/svnitem.h | 4 +- src/svnfrontend/svnlogdlgimp.cpp | 2 +- src/svnfrontend/svnlogdlgimp.h | 6 +- src/svnfrontend/tdesvnfilelist.cpp | 10 +- src/svnfrontend/tdesvnfilelist.h | 4 +- src/svnfrontend/threadcontextlistenerdata.h | 2 +- src/svnqt/CMakeLists.txt | 82 +- src/svnqt/LICENSE_SVN | 2 +- src/svnqt/annotate_line.h | 144 ++++ src/svnqt/annotate_line.hpp | 144 ---- src/svnqt/apr.cpp | 2 +- src/svnqt/apr.h | 64 ++ src/svnqt/apr.hpp | 64 -- src/svnqt/cache/DatabaseException.cpp | 2 +- src/svnqt/cache/DatabaseException.h | 35 + src/svnqt/cache/DatabaseException.hpp | 35 - src/svnqt/cache/LogCache.cpp | 6 +- src/svnqt/cache/LogCache.h | 42 + src/svnqt/cache/LogCache.hpp | 42 - src/svnqt/cache/ReposLog.cpp | 16 +- src/svnqt/cache/ReposLog.h | 70 ++ src/svnqt/cache/ReposLog.hpp | 70 -- src/svnqt/cache/test/sqlite.cpp | 12 +- src/svnqt/check.h | 45 ++ src/svnqt/check.hpp | 45 -- src/svnqt/client.cpp | 6 +- src/svnqt/client.h | 873 ++++++++++++++++++++ src/svnqt/client.hpp | 873 -------------------- src/svnqt/client_annotate.cpp | 4 +- src/svnqt/client_cat.cpp | 14 +- src/svnqt/client_diff.cpp | 14 +- src/svnqt/client_impl.cpp | 4 +- src/svnqt/client_impl.h | 895 +++++++++++++++++++++ src/svnqt/client_impl.hpp | 895 --------------------- src/svnqt/client_lock.cpp | 10 +- src/svnqt/client_ls.cpp | 10 +- src/svnqt/client_merge.cpp | 14 +- src/svnqt/client_modify.cpp | 14 +- src/svnqt/client_property.cpp | 14 +- src/svnqt/client_status.cpp | 22 +- src/svnqt/commititem.cpp | 2 +- src/svnqt/commititem.h | 97 +++ src/svnqt/commititem.hpp | 97 --- src/svnqt/conflictdescription.cpp | 4 +- src/svnqt/conflictdescription.h | 96 +++ src/svnqt/conflictdescription.hpp | 96 --- src/svnqt/conflictresult.cpp | 4 +- src/svnqt/conflictresult.h | 78 ++ src/svnqt/conflictresult.hpp | 78 -- src/svnqt/context.cpp | 8 +- src/svnqt/context.h | 171 ++++ src/svnqt/context.hpp | 171 ---- src/svnqt/context_listener.h | 266 ++++++ src/svnqt/context_listener.hpp | 266 ------ src/svnqt/contextdata.cpp | 8 +- src/svnqt/contextdata.h | 338 ++++++++ src/svnqt/contextdata.hpp | 338 -------- src/svnqt/datetime.cpp | 2 +- src/svnqt/datetime.h | 161 ++++ src/svnqt/datetime.hpp | 161 ---- src/svnqt/diff_data.cpp | 6 +- src/svnqt/diff_data.h | 71 ++ src/svnqt/diff_data.hpp | 71 -- src/svnqt/diffoptions.cpp | 6 +- src/svnqt/diffoptions.h | 79 ++ src/svnqt/diffoptions.hpp | 79 -- src/svnqt/dirent.cpp | 6 +- src/svnqt/dirent.h | 126 +++ src/svnqt/dirent.hpp | 126 --- src/svnqt/entry.cpp | 2 +- src/svnqt/entry.h | 240 ++++++ src/svnqt/entry.hpp | 240 ------ src/svnqt/exception.cpp | 4 +- src/svnqt/exception.h | 133 +++ src/svnqt/exception.hpp | 133 --- src/svnqt/helper.h | 98 +++ src/svnqt/helper.hpp | 98 --- src/svnqt/info_entry.cpp | 6 +- src/svnqt/info_entry.h | 118 +++ src/svnqt/info_entry.hpp | 118 --- src/svnqt/lock_entry.cpp | 4 +- src/svnqt/lock_entry.h | 84 ++ src/svnqt/lock_entry.hpp | 84 -- src/svnqt/log_entry.cpp | 4 +- src/svnqt/log_entry.h | 120 +++ src/svnqt/log_entry.hpp | 120 --- src/svnqt/path.cpp | 12 +- src/svnqt/path.h | 195 +++++ src/svnqt/path.hpp | 195 ----- src/svnqt/pool.cpp | 2 +- src/svnqt/pool.h | 86 ++ src/svnqt/pool.hpp | 86 -- src/svnqt/repository.cpp | 4 +- src/svnqt/repository.h | 119 +++ src/svnqt/repository.hpp | 119 --- src/svnqt/repositorydata.cpp | 10 +- src/svnqt/repositorydata.h | 73 ++ src/svnqt/repositorydata.hpp | 73 -- src/svnqt/repositorylistener.cpp | 2 +- src/svnqt/repositorylistener.h | 56 ++ src/svnqt/repositorylistener.hpp | 56 -- src/svnqt/revision.cpp | 4 +- src/svnqt/revision.h | 213 +++++ src/svnqt/revision.hpp | 213 ----- src/svnqt/shared_pointer.h | 193 +++++ src/svnqt/shared_pointer.hpp | 193 ----- src/svnqt/smart_pointer.h | 146 ++++ src/svnqt/smart_pointer.hpp | 146 ---- src/svnqt/status.cpp | 8 +- src/svnqt/status.h | 182 +++++ src/svnqt/status.hpp | 182 ----- src/svnqt/stringarray.cpp | 4 +- src/svnqt/stringarray.h | 68 ++ src/svnqt/stringarray.hpp | 68 -- src/svnqt/svnfilestream.cpp | 2 +- src/svnqt/svnfilestream.h | 69 ++ src/svnqt/svnfilestream.hpp | 69 -- src/svnqt/svnqt_defines.h.in | 43 + src/svnqt/svnqt_defines.hpp.in | 43 - src/svnqt/svnqttypes.h | 100 +++ src/svnqt/svnqttypes.hpp | 100 --- src/svnqt/svnstream.cpp | 6 +- src/svnqt/svnstream.h | 163 ++++ src/svnqt/svnstream.hpp | 163 ---- src/svnqt/targets.cpp | 8 +- src/svnqt/targets.h | 159 ++++ src/svnqt/targets.hpp | 159 ---- src/svnqt/testmain.cpp | 8 +- src/svnqt/tests/ckpath.cpp | 2 +- src/svnqt/tests/crepo.cpp | 8 +- src/svnqt/tests/lsdir.cpp | 6 +- src/svnqt/tests/testlistener.h | 2 +- src/svnqt/url.cpp | 4 +- src/svnqt/url.h | 86 ++ src/svnqt/url.hpp | 86 -- src/svnqt/version_check.cpp | 2 +- src/svnqt/version_check.h | 43 + src/svnqt/version_check.hpp | 43 - src/svnqt/wc.cpp | 8 +- src/svnqt/wc.h | 91 +++ src/svnqt/wc.hpp | 91 --- src/tdeiosvn/tdeiobytestream.h | 2 +- src/tdeiosvn/tdeiolistener.h | 2 +- src/tdeiosvn/tdeiosvn.cpp | 12 +- src/tdesvn_events.h | 2 +- src/tdesvn_part.cpp | 4 +- src/tdesvnd/tdesvnd_dcop.cpp | 10 +- src/tdesvnview.cpp | 8 +- src/tdesvnview.h | 2 +- 187 files changed, 6847 insertions(+), 6847 deletions(-) create mode 100644 src/svnqt/annotate_line.h delete mode 100644 src/svnqt/annotate_line.hpp create mode 100644 src/svnqt/apr.h delete mode 100644 src/svnqt/apr.hpp create mode 100644 src/svnqt/cache/DatabaseException.h delete mode 100644 src/svnqt/cache/DatabaseException.hpp create mode 100644 src/svnqt/cache/LogCache.h delete mode 100644 src/svnqt/cache/LogCache.hpp create mode 100644 src/svnqt/cache/ReposLog.h delete mode 100644 src/svnqt/cache/ReposLog.hpp create mode 100644 src/svnqt/check.h delete mode 100644 src/svnqt/check.hpp create mode 100644 src/svnqt/client.h delete mode 100644 src/svnqt/client.hpp create mode 100644 src/svnqt/client_impl.h delete mode 100644 src/svnqt/client_impl.hpp create mode 100644 src/svnqt/commititem.h delete mode 100644 src/svnqt/commititem.hpp create mode 100644 src/svnqt/conflictdescription.h delete mode 100644 src/svnqt/conflictdescription.hpp create mode 100644 src/svnqt/conflictresult.h delete mode 100644 src/svnqt/conflictresult.hpp create mode 100644 src/svnqt/context.h delete mode 100644 src/svnqt/context.hpp create mode 100644 src/svnqt/context_listener.h delete mode 100644 src/svnqt/context_listener.hpp create mode 100644 src/svnqt/contextdata.h delete mode 100644 src/svnqt/contextdata.hpp create mode 100644 src/svnqt/datetime.h delete mode 100644 src/svnqt/datetime.hpp create mode 100644 src/svnqt/diff_data.h delete mode 100644 src/svnqt/diff_data.hpp create mode 100644 src/svnqt/diffoptions.h delete mode 100644 src/svnqt/diffoptions.hpp create mode 100644 src/svnqt/dirent.h delete mode 100644 src/svnqt/dirent.hpp create mode 100644 src/svnqt/entry.h delete mode 100644 src/svnqt/entry.hpp create mode 100644 src/svnqt/exception.h delete mode 100644 src/svnqt/exception.hpp create mode 100644 src/svnqt/helper.h delete mode 100644 src/svnqt/helper.hpp create mode 100644 src/svnqt/info_entry.h delete mode 100644 src/svnqt/info_entry.hpp create mode 100644 src/svnqt/lock_entry.h delete mode 100644 src/svnqt/lock_entry.hpp create mode 100644 src/svnqt/log_entry.h delete mode 100644 src/svnqt/log_entry.hpp create mode 100644 src/svnqt/path.h delete mode 100644 src/svnqt/path.hpp create mode 100644 src/svnqt/pool.h delete mode 100644 src/svnqt/pool.hpp create mode 100644 src/svnqt/repository.h delete mode 100644 src/svnqt/repository.hpp create mode 100644 src/svnqt/repositorydata.h delete mode 100644 src/svnqt/repositorydata.hpp create mode 100644 src/svnqt/repositorylistener.h delete mode 100644 src/svnqt/repositorylistener.hpp create mode 100644 src/svnqt/revision.h delete mode 100644 src/svnqt/revision.hpp create mode 100644 src/svnqt/shared_pointer.h delete mode 100644 src/svnqt/shared_pointer.hpp create mode 100644 src/svnqt/smart_pointer.h delete mode 100644 src/svnqt/smart_pointer.hpp create mode 100644 src/svnqt/status.h delete mode 100644 src/svnqt/status.hpp create mode 100644 src/svnqt/stringarray.h delete mode 100644 src/svnqt/stringarray.hpp create mode 100644 src/svnqt/svnfilestream.h delete mode 100644 src/svnqt/svnfilestream.hpp create mode 100644 src/svnqt/svnqt_defines.h.in delete mode 100644 src/svnqt/svnqt_defines.hpp.in create mode 100644 src/svnqt/svnqttypes.h delete mode 100644 src/svnqt/svnqttypes.hpp create mode 100644 src/svnqt/svnstream.h delete mode 100644 src/svnqt/svnstream.hpp create mode 100644 src/svnqt/targets.h delete mode 100644 src/svnqt/targets.hpp create mode 100644 src/svnqt/url.h delete mode 100644 src/svnqt/url.hpp create mode 100644 src/svnqt/version_check.h delete mode 100644 src/svnqt/version_check.hpp create mode 100644 src/svnqt/wc.h delete mode 100644 src/svnqt/wc.hpp diff --git a/src/helpers/sub2qt.cpp b/src/helpers/sub2qt.cpp index 35cf248..d14e64c 100644 --- a/src/helpers/sub2qt.cpp +++ b/src/helpers/sub2qt.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include "sub2qt.h" -#include "datetime.hpp" +#include "datetime.h" #include "tdeglobal.h" #include "tdelocale.h" #include diff --git a/src/helpers/sub2qt.h b/src/helpers/sub2qt.h index bc158df..6b1520f 100644 --- a/src/helpers/sub2qt.h +++ b/src/helpers/sub2qt.h @@ -20,7 +20,7 @@ #ifndef HELPERSSUB2TQT_H #define HELPERSSUB2TQT_H -#include "datetime.hpp" +#include "datetime.h" #include #include #include diff --git a/src/ksvnwidgets/depthselector.cpp b/src/ksvnwidgets/depthselector.cpp index 6840ec9..78c1a7d 100644 --- a/src/ksvnwidgets/depthselector.cpp +++ b/src/ksvnwidgets/depthselector.cpp @@ -18,7 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "depthselector.h" -#include "version_check.hpp" +#include "version_check.h" #include diff --git a/src/ksvnwidgets/depthselector.h b/src/ksvnwidgets/depthselector.h index ce44d29..eccb7f6 100644 --- a/src/ksvnwidgets/depthselector.h +++ b/src/ksvnwidgets/depthselector.h @@ -22,7 +22,7 @@ #include "depthform.h" -#include "svnqttypes.hpp" +#include "svnqttypes.h" class TQCheckBox; diff --git a/src/ksvnwidgets/logmsg_impl.h b/src/ksvnwidgets/logmsg_impl.h index 233c651..a746211 100644 --- a/src/ksvnwidgets/logmsg_impl.h +++ b/src/ksvnwidgets/logmsg_impl.h @@ -21,7 +21,7 @@ #define LOGMSG_IMPL_H #include "logmessage.h" -#include "commititem.hpp" +#include "commititem.h" #include #include diff --git a/src/ksvnwidgets/revertform_impl.h b/src/ksvnwidgets/revertform_impl.h index 7c40faf..64ea429 100644 --- a/src/ksvnwidgets/revertform_impl.h +++ b/src/ksvnwidgets/revertform_impl.h @@ -21,7 +21,7 @@ #define _REVERT_FORM_IMPL_H #include "revertform.h" -#include "svnqttypes.hpp" +#include "svnqttypes.h" class TQStringList; diff --git a/src/svnfrontend/blamedisplay_impl.cpp b/src/svnfrontend/blamedisplay_impl.cpp index 0acc9bc..1cadddf 100644 --- a/src/svnfrontend/blamedisplay_impl.cpp +++ b/src/svnfrontend/blamedisplay_impl.cpp @@ -20,7 +20,7 @@ #include "blamedisplay_impl.h" #include "simple_logcb.h" #include "tdesvnsettings.h" -#include "log_entry.hpp" +#include "log_entry.h" #include "cursorstack.h" #include "widgetblockstack.h" #include "encodingselector_impl.h" diff --git a/src/svnfrontend/blamedisplay_impl.h b/src/svnfrontend/blamedisplay_impl.h index e248b35..22757b9 100644 --- a/src/svnfrontend/blamedisplay_impl.h +++ b/src/svnfrontend/blamedisplay_impl.h @@ -21,7 +21,7 @@ #define BLAMEDISPLAY_IMPL_H #include "blamedisplay.h" -#include "client.hpp" +#include "client.h" class BlameDisplayData; class SimpleLogCb; diff --git a/src/svnfrontend/cacheentry.h b/src/svnfrontend/cacheentry.h index fd9ae64..d2a7787 100644 --- a/src/svnfrontend/cacheentry.h +++ b/src/svnfrontend/cacheentry.h @@ -20,9 +20,9 @@ #ifndef HELPERSCACHEENTRY_H #define HELPERSCACHEENTRY_H -#include "svnqttypes.hpp" -#include "shared_pointer.hpp" -#include "status.hpp" +#include "svnqttypes.h" +#include "shared_pointer.h" +#include "status.h" // std::map 'cause TQMap isn't usable #include diff --git a/src/svnfrontend/ccontextlistener.h b/src/svnfrontend/ccontextlistener.h index a280782..18eb99e 100644 --- a/src/svnfrontend/ccontextlistener.h +++ b/src/svnfrontend/ccontextlistener.h @@ -20,8 +20,8 @@ #ifndef CCONTEXTLISTENER_H #define CCONTEXTLISTENER_H -#include "context_listener.hpp" -#include "smart_pointer.hpp" +#include "context_listener.h" +#include "smart_pointer.h" #include #include diff --git a/src/svnfrontend/commandexec.cpp b/src/svnfrontend/commandexec.cpp index 953f33a..ce7d45d 100644 --- a/src/svnfrontend/commandexec.cpp +++ b/src/svnfrontend/commandexec.cpp @@ -21,9 +21,9 @@ #include "tdesvnsettings.h" #include "svnactions.h" #include "dummydisplay.h" -#include "targets.hpp" -#include "url.hpp" -#include "dirent.hpp" +#include "targets.h" +#include "url.h" +#include "dirent.h" #include "sub2qt.h" #include "ktranslateurl.h" #include "sshagent.h" diff --git a/src/svnfrontend/filelistviewitem.cpp b/src/svnfrontend/filelistviewitem.cpp index 615ea4c..0eee5bc 100644 --- a/src/svnfrontend/filelistviewitem.cpp +++ b/src/svnfrontend/filelistviewitem.cpp @@ -21,10 +21,10 @@ #include "tdesvnfilelist.h" #include "tdesvnsettings.h" #include "helpers/sub2qt.h" -#include "status.hpp" -#include "revision.hpp" -#include "exception.hpp" -#include "url.hpp" +#include "status.h" +#include "revision.h" +#include "exception.h" +#include "url.h" #include "widgetblockstack.h" #include diff --git a/src/svnfrontend/filelistviewitem.h b/src/svnfrontend/filelistviewitem.h index 6886511..4f130c9 100644 --- a/src/svnfrontend/filelistviewitem.h +++ b/src/svnfrontend/filelistviewitem.h @@ -24,7 +24,7 @@ #include #include #include -#include "svnqttypes.hpp" +#include "svnqttypes.h" class TQPainter; class KFileItem; diff --git a/src/svnfrontend/fillcachethread.cpp b/src/svnfrontend/fillcachethread.cpp index f7619fe..2fd3881 100644 --- a/src/svnfrontend/fillcachethread.cpp +++ b/src/svnfrontend/fillcachethread.cpp @@ -20,9 +20,9 @@ #include "fillcachethread.h" #include "tcontextlistener.h" -#include "LogCache.hpp" -#include "ReposLog.hpp" -#include "DatabaseException.hpp" +#include "LogCache.h" +#include "ReposLog.h" +#include "DatabaseException.h" #include "tdesvn_events.h" #include diff --git a/src/svnfrontend/fillcachethread.h b/src/svnfrontend/fillcachethread.h index 1b20e73..735726e 100644 --- a/src/svnfrontend/fillcachethread.h +++ b/src/svnfrontend/fillcachethread.h @@ -20,9 +20,9 @@ #ifndef _FILLCACHE_THREAD_H #define _FILLCACHE_THREAD_H -#include "client.hpp" -#include "revision.hpp" -#include "status.hpp" +#include "client.h" +#include "revision.h" +#include "status.h" #include "ccontextlistener.h" #include "eventnumbers.h" #include "frontendtypes.h" diff --git a/src/svnfrontend/frontendtypes.h b/src/svnfrontend/frontendtypes.h index 0f45ecf..a34f460 100644 --- a/src/svnfrontend/frontendtypes.h +++ b/src/svnfrontend/frontendtypes.h @@ -1,7 +1,7 @@ #ifndef _FRONTEND_TYPES_H #define _FRONTEND_TYPES_H -#include "svnqt/shared_pointer.hpp" +#include "svnqt/shared_pointer.h" class ThreadContextListener; diff --git a/src/svnfrontend/fronthelpers/checkoutinfo_impl.cpp b/src/svnfrontend/fronthelpers/checkoutinfo_impl.cpp index 3dad68d..9a06738 100644 --- a/src/svnfrontend/fronthelpers/checkoutinfo_impl.cpp +++ b/src/svnfrontend/fronthelpers/checkoutinfo_impl.cpp @@ -20,7 +20,7 @@ #include "checkoutinfo_impl.h" #include "rangeinput_impl.h" #include "depthselector.h" -#include "url.hpp" +#include "url.h" #include "ktranslateurl.h" #include #include diff --git a/src/svnfrontend/fronthelpers/checkoutinfo_impl.h b/src/svnfrontend/fronthelpers/checkoutinfo_impl.h index eb567f4..bbcd8bb 100644 --- a/src/svnfrontend/fronthelpers/checkoutinfo_impl.h +++ b/src/svnfrontend/fronthelpers/checkoutinfo_impl.h @@ -21,8 +21,8 @@ #define CHECKOUTINFO_IMPL_H #include "checkoutinfo.h" -#include "revision.hpp" -#include "svnqttypes.hpp" +#include "revision.h" +#include "svnqttypes.h" #include "kurl.h" class CheckoutInfo_impl: public CheckoutInfo { diff --git a/src/svnfrontend/fronthelpers/propertylist.h b/src/svnfrontend/fronthelpers/propertylist.h index 71c72e0..1d2eea2 100644 --- a/src/svnfrontend/fronthelpers/propertylist.h +++ b/src/svnfrontend/fronthelpers/propertylist.h @@ -21,7 +21,7 @@ #define PROPERTYLIST_H #include -#include "svnqttypes.hpp" +#include "svnqttypes.h" /** @author diff --git a/src/svnfrontend/fronthelpers/rangeinput_impl.h b/src/svnfrontend/fronthelpers/rangeinput_impl.h index aaa27a4..ea98ee0 100644 --- a/src/svnfrontend/fronthelpers/rangeinput_impl.h +++ b/src/svnfrontend/fronthelpers/rangeinput_impl.h @@ -21,7 +21,7 @@ #define RANGEINPUT_IMPL_H #include "rangeinput.h" -#include "revision.hpp" +#include "revision.h" #include class Rangeinput_impl: public RangeInputDlg { diff --git a/src/svnfrontend/fronthelpers/revisionbuttonimpl.h b/src/svnfrontend/fronthelpers/revisionbuttonimpl.h index bec5124..924f7df 100644 --- a/src/svnfrontend/fronthelpers/revisionbuttonimpl.h +++ b/src/svnfrontend/fronthelpers/revisionbuttonimpl.h @@ -21,7 +21,7 @@ #define REVISIONBUTTONIMPL_H #include "revisionbutton.h" -#include "svnqt/revision.hpp" +#include "svnqt/revision.h" class RevisionButtonImpl: public RevisionButton { Q_OBJECT diff --git a/src/svnfrontend/graphtree/elogentry.h b/src/svnfrontend/graphtree/elogentry.h index 3bcbabc..d9490b6 100644 --- a/src/svnfrontend/graphtree/elogentry.h +++ b/src/svnfrontend/graphtree/elogentry.h @@ -20,7 +20,7 @@ #ifndef ELOGENTRY_H #define ELOGENTRY_H -#include +#include /** @author Rajko Albrecht diff --git a/src/svnfrontend/graphtree/revgraphview.cpp b/src/svnfrontend/graphtree/revgraphview.cpp index 416b6e9..a897e94 100644 --- a/src/svnfrontend/graphtree/revgraphview.cpp +++ b/src/svnfrontend/graphtree/revgraphview.cpp @@ -23,7 +23,7 @@ #include "graphtree_defines.h" #include "tdesvnsettings.h" #include "stopdlg.h" -#include "client.hpp" +#include "client.h" #include #include diff --git a/src/svnfrontend/graphtree/revgraphview.h b/src/svnfrontend/graphtree/revgraphview.h index d8d1972..aae7ab9 100644 --- a/src/svnfrontend/graphtree/revgraphview.h +++ b/src/svnfrontend/graphtree/revgraphview.h @@ -20,7 +20,7 @@ #ifndef REVGRAPHVIEW_H #define REVGRAPHVIEW_H -#include +#include #include diff --git a/src/svnfrontend/graphtree/revisiontree.cpp b/src/svnfrontend/graphtree/revisiontree.cpp index be11aa2..c37818f 100644 --- a/src/svnfrontend/graphtree/revisiontree.cpp +++ b/src/svnfrontend/graphtree/revisiontree.cpp @@ -19,10 +19,10 @@ ***************************************************************************/ #include "revisiontree.h" #include "stopdlg.h" -#include "log_entry.hpp" -#include "LogCache.hpp" -#include "ReposLog.hpp" -#include "url.hpp" +#include "log_entry.h" +#include "LogCache.h" +#include "ReposLog.h" +#include "url.h" #include "sub2qt.h" #include "revtreewidget.h" #include "revgraphview.h" diff --git a/src/svnfrontend/graphtree/revisiontree.h b/src/svnfrontend/graphtree/revisiontree.h index 199929d..211e3d4 100644 --- a/src/svnfrontend/graphtree/revisiontree.h +++ b/src/svnfrontend/graphtree/revisiontree.h @@ -20,9 +20,9 @@ #ifndef REVISIONTREE_H #define REVISIONTREE_H -#include "log_entry.hpp" -#include "revision.hpp" -#include "client.hpp" +#include "log_entry.h" +#include "revision.h" +#include "client.h" #include #include diff --git a/src/svnfrontend/graphtree/revtreewidget.h b/src/svnfrontend/graphtree/revtreewidget.h index 40a1b10..35cfc52 100644 --- a/src/svnfrontend/graphtree/revtreewidget.h +++ b/src/svnfrontend/graphtree/revtreewidget.h @@ -20,7 +20,7 @@ #ifndef REVTREEWIDGET_H #define REVTREEWIDGET_H -#include +#include #include #include diff --git a/src/svnfrontend/importdir_logmsg.cpp b/src/svnfrontend/importdir_logmsg.cpp index 8dfd03e..ecf8e47 100644 --- a/src/svnfrontend/importdir_logmsg.cpp +++ b/src/svnfrontend/importdir_logmsg.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include "importdir_logmsg.h" -#include "version_check.hpp" +#include "version_check.h" #include diff --git a/src/svnfrontend/itemdisplay.cpp b/src/svnfrontend/itemdisplay.cpp index 1d60730..0e47316 100644 --- a/src/svnfrontend/itemdisplay.cpp +++ b/src/svnfrontend/itemdisplay.cpp @@ -21,7 +21,7 @@ #include "itemdisplay.h" #include "svnitem.h" #include "tdesvnsettings.h" -#include "status.hpp" +#include "status.h" ItemDisplay::ItemDisplay() diff --git a/src/svnfrontend/itemdisplay.h b/src/svnfrontend/itemdisplay.h index 2c3ffbc..7bb2fa0 100644 --- a/src/svnfrontend/itemdisplay.h +++ b/src/svnfrontend/itemdisplay.h @@ -21,7 +21,7 @@ #ifndef __ITEMDISPLAY_H #define __ITEMDISPLAY_H -#include "svnqttypes.hpp" +#include "svnqttypes.h" #include #include #include diff --git a/src/svnfrontend/mergedlg_impl.cpp b/src/svnfrontend/mergedlg_impl.cpp index c8efc54..b046043 100644 --- a/src/svnfrontend/mergedlg_impl.cpp +++ b/src/svnfrontend/mergedlg_impl.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include "mergedlg_impl.h" #include "rangeinput_impl.h" -#include "svnqt/url.hpp" +#include "svnqt/url.h" #include "ktranslateurl.h" #include "tdesvnsettings.h" diff --git a/src/svnfrontend/modifiedthread.cpp b/src/svnfrontend/modifiedthread.cpp index 8cef421..dedf0e6 100644 --- a/src/svnfrontend/modifiedthread.cpp +++ b/src/svnfrontend/modifiedthread.cpp @@ -21,7 +21,7 @@ #include "modifiedthread.h" #include "tcontextlistener.h" -#include "svnqttypes.hpp" +#include "svnqttypes.h" #include #include diff --git a/src/svnfrontend/modifiedthread.h b/src/svnfrontend/modifiedthread.h index 93beb33..af6d7dd 100644 --- a/src/svnfrontend/modifiedthread.h +++ b/src/svnfrontend/modifiedthread.h @@ -20,9 +20,9 @@ #ifndef _MODIFIED_THREAD_H #define _MODIFIED_THREAD_H -#include "client.hpp" -#include "revision.hpp" -#include "status.hpp" +#include "client.h" +#include "revision.h" +#include "status.h" #include "ccontextlistener.h" #include "eventnumbers.h" #include "frontendtypes.h" diff --git a/src/svnfrontend/propertiesdlg.cpp b/src/svnfrontend/propertiesdlg.cpp index b4f8b7e..f29686e 100644 --- a/src/svnfrontend/propertiesdlg.cpp +++ b/src/svnfrontend/propertiesdlg.cpp @@ -23,7 +23,7 @@ #include "propertiesdlg.h" #include "editproperty_impl.h" #include "svnitem.h" -#include "client.hpp" +#include "client.h" #include #include diff --git a/src/svnfrontend/propertiesdlg.h b/src/svnfrontend/propertiesdlg.h index b67288d..54a3efd 100644 --- a/src/svnfrontend/propertiesdlg.h +++ b/src/svnfrontend/propertiesdlg.h @@ -26,8 +26,8 @@ #include #include -#include "svnqttypes.hpp" -#include "revision.hpp" +#include "svnqttypes.h" +#include "revision.h" class TQVBoxLayout; class TQHBoxLayout; diff --git a/src/svnfrontend/svnactions.cpp b/src/svnfrontend/svnactions.cpp index 9171a00..d1604c2 100644 --- a/src/svnfrontend/svnactions.cpp +++ b/src/svnfrontend/svnactions.cpp @@ -37,17 +37,17 @@ #include "revisiontree.h" #include "tdesvnsettings.h" #include "tdesvn_events.h" -#include "client.hpp" -#include "annotate_line.hpp" -#include "context_listener.hpp" -#include "dirent.hpp" -#include "targets.hpp" -#include "url.hpp" -#include "wc.hpp" -#include "svnqt_defines.hpp" -#include "LogCache.hpp" -#include "ReposLog.hpp" -#include "url.hpp" +#include "client.h" +#include "annotate_line.h" +#include "context_listener.h" +#include "dirent.h" +#include "targets.h" +#include "url.h" +#include "wc.h" +#include "svnqt_defines.h" +#include "LogCache.h" +#include "ReposLog.h" +#include "url.h" #include "helpers/sub2qt.h" #include "fronthelpers/cursorstack.h" diff --git a/src/svnfrontend/svnactions.h b/src/svnfrontend/svnactions.h index 4342ea5..e47b4a7 100644 --- a/src/svnfrontend/svnactions.h +++ b/src/svnfrontend/svnactions.h @@ -20,11 +20,11 @@ #ifndef SVNACTIONS_H #define SVNACTIONS_H -#include "client.hpp" -#include "revision.hpp" -#include "smart_pointer.hpp" -#include "shared_pointer.hpp" -#include "svnqttypes.hpp" +#include "client.h" +#include "revision.h" +#include "smart_pointer.h" +#include "shared_pointer.h" +#include "svnqttypes.h" #include "simple_logcb.h" diff --git a/src/svnfrontend/svnitem.cpp b/src/svnfrontend/svnitem.cpp index 0e70cbf..bfe5b8b 100644 --- a/src/svnfrontend/svnitem.cpp +++ b/src/svnfrontend/svnitem.cpp @@ -22,9 +22,9 @@ #include "svnactions.h" #include "tdesvn_part.h" #include "tdesvnsettings.h" -#include "status.hpp" -#include "smart_pointer.hpp" -#include "url.hpp" +#include "status.h" +#include "smart_pointer.h" +#include "url.h" #include "sub2qt.h" #include "ktranslateurl.h" diff --git a/src/svnfrontend/svnitem.h b/src/svnfrontend/svnitem.h index 76c2533..73b7c9a 100644 --- a/src/svnfrontend/svnitem.h +++ b/src/svnfrontend/svnitem.h @@ -21,8 +21,8 @@ #ifndef __SVN_ITEM_H #define __SVN_ITEM_H -#include "smart_pointer.hpp" -#include "svnqttypes.hpp" +#include "smart_pointer.h" +#include "svnqttypes.h" #include #include #include diff --git a/src/svnfrontend/svnlogdlgimp.cpp b/src/svnfrontend/svnlogdlgimp.cpp index 5f8b69a..5e25480 100644 --- a/src/svnfrontend/svnlogdlgimp.cpp +++ b/src/svnfrontend/svnlogdlgimp.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include "svnlogdlgimp.h" #include "tdesvnsettings.h" -#include "log_entry.hpp" +#include "log_entry.h" #include "sub2qt.h" #include "svnactions.h" #include "revisionbuttonimpl.h" diff --git a/src/svnfrontend/svnlogdlgimp.h b/src/svnfrontend/svnlogdlgimp.h index 64b57c9..752d04e 100644 --- a/src/svnfrontend/svnlogdlgimp.h +++ b/src/svnfrontend/svnlogdlgimp.h @@ -22,9 +22,9 @@ #include "svnlogdlg.h" #include "simple_logcb.h" -#include "log_entry.hpp" -#include "client.hpp" -#include "shared_pointer.hpp" +#include "log_entry.h" +#include "client.h" +#include "shared_pointer.h" #include #include diff --git a/src/svnfrontend/tdesvnfilelist.cpp b/src/svnfrontend/tdesvnfilelist.cpp index 21e23dc..8334905 100644 --- a/src/svnfrontend/tdesvnfilelist.cpp +++ b/src/svnfrontend/tdesvnfilelist.cpp @@ -31,11 +31,11 @@ #include "checkoutinfo_impl.h" #include "stopdlg.h" #include "tdesvnsettings.h" -#include "revision.hpp" -#include "dirent.hpp" -#include "client.hpp" -#include "status.hpp" -#include "url.hpp" +#include "revision.h" +#include "dirent.h" +#include "client.h" +#include "status.h" +#include "url.h" #include "sshagent.h" #include "sub2qt.h" #include "cursorstack.h" diff --git a/src/svnfrontend/tdesvnfilelist.h b/src/svnfrontend/tdesvnfilelist.h index 2337b20..babd1cf 100644 --- a/src/svnfrontend/tdesvnfilelist.h +++ b/src/svnfrontend/tdesvnfilelist.h @@ -22,8 +22,8 @@ #include "itemdisplay.h" #include "filelistviewitem.h" -#include "status.hpp" -#include "client.hpp" +#include "status.h" +#include "client.h" #include #include diff --git a/src/svnfrontend/threadcontextlistenerdata.h b/src/svnfrontend/threadcontextlistenerdata.h index 285817c..e8d50f6 100644 --- a/src/svnfrontend/threadcontextlistenerdata.h +++ b/src/svnfrontend/threadcontextlistenerdata.h @@ -20,7 +20,7 @@ #ifndef THREADCONTEXTLISTENERDATA_H #define THREADCONTEXTLISTENERDATA_H -#include "context_listener.hpp" +#include "context_listener.h" #include #include diff --git a/src/svnqt/CMakeLists.txt b/src/svnqt/CMakeLists.txt index 73d61cf..0e51db0 100644 --- a/src/svnqt/CMakeLists.txt +++ b/src/svnqt/CMakeLists.txt @@ -41,53 +41,53 @@ SET(SOURCES client_merge.cpp cache/LogCache.cpp cache/ReposLog.cpp - cache/DatabaseException.hpp + cache/DatabaseException.h cache/DatabaseException.cpp ) SET(CACHEINST_HEADERS - cache/LogCache.hpp - cache/ReposLog.hpp - cache/DatabaseException.hpp + cache/LogCache.h + cache/ReposLog.h + cache/DatabaseException.h ) SET(INST_HEADERS - annotate_line.hpp - apr.hpp - check.hpp - client.hpp - commititem.hpp - context.hpp - context_listener.hpp - datetime.hpp - dirent.hpp - entry.hpp - exception.hpp - info_entry.hpp - lock_entry.hpp - log_entry.hpp - path.hpp - pool.hpp - repository.hpp - repositorylistener.hpp - revision.hpp - smart_pointer.hpp - shared_pointer.hpp - status.hpp - svnfilestream.hpp - svnstream.hpp - svnqttypes.hpp - targets.hpp - url.hpp - version_check.hpp - wc.hpp - stringarray.hpp - diffoptions.hpp - conflictdescription.hpp - conflictresult.hpp + annotate_line.h + apr.h + check.h + client.h + commititem.h + context.h + context_listener.h + datetime.h + dirent.h + entry.h + exception.h + info_entry.h + lock_entry.h + log_entry.h + path.h + pool.h + repository.h + repositorylistener.h + revision.h + smart_pointer.h + shared_pointer.h + status.h + svnfilestream.h + svnstream.h + svnqttypes.h + targets.h + url.h + version_check.h + wc.h + stringarray.h + diffoptions.h + conflictdescription.h + conflictresult.h ) -FILE(GLOB svnhdr RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.hpp") +FILE(GLOB svnhdr RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h") SET(svnhdr ${svnhdr} ${CACHE_INST_HEADERS}) @@ -106,12 +106,12 @@ IF (HAVE_GCC_VISIBILITY) ENDIF (HAVE_GCC_VISIBILITY) CONFIGURE_FILE( - "${CMAKE_CURRENT_SOURCE_DIR}/svnqt_defines.hpp.in" - "${CMAKE_CURRENT_BINARY_DIR}/svnqt_defines.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/svnqt_defines.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/svnqt_defines.h" IMMEDIATE @ONLY) -SET(INST_HEADERS ${INST_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/svnqt_defines.hpp) +SET(INST_HEADERS ${INST_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/svnqt_defines.h) INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) ADD_LIBRARY(${svnqt-name} SHARED ${SOURCES} ${svnhdr}) diff --git a/src/svnqt/LICENSE_SVN b/src/svnqt/LICENSE_SVN index 61d889a..687c45d 100644 --- a/src/svnqt/LICENSE_SVN +++ b/src/svnqt/LICENSE_SVN @@ -1,4 +1,4 @@ -A small section of code in client_impl.hpp and client_impl.cpp was taken and modified +A small section of code in client_impl.h and client_impl.cpp was taken and modified from the source code of subversion 1.8.10, which is released under the following license. --------------------------------------------------------------------------------- diff --git a/src/svnqt/annotate_line.h b/src/svnqt/annotate_line.h new file mode 100644 index 0000000..4bd2c01 --- /dev/null +++ b/src/svnqt/annotate_line.h @@ -0,0 +1,144 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ +#ifndef _SVNCPP_ANNOTATE_LINE_HPP_ +#define _SVNCPP_ANNOTATE_LINE_HPP_ + +#include "svnqt/svnqt_defines.h" + +#include +#include + +namespace svn +{ + /** + * This class holds the data for one line in an annotation + */ + class AnnotateLine + { + public: + AnnotateLine (TQLONG line_no, + TQLONG revision, + const char *author, + const char *date, + const char *line) + : m_line_no (line_no), m_revision (revision), + m_date( (date&&strlen(date))?TQDateTime::fromString(TQString::FROMUTF8(date),Qt::ISODate):TQDateTime()), + m_line(line?line:""),m_author(author?author:""), + m_merge_revision(-1), + m_merge_date(TQDateTime()), + m_merge_author(""),m_merge_path("") + + { + } + + AnnotateLine (TQLONG line_no, + TQLONG revision, + const char *author, + const char *date, + const char *line, + TQLONG merge_revision, + const char *merge_author, + const char *merge_date, + const char *merge_path + ) + : m_line_no (line_no), m_revision (revision), + m_date( (date&&strlen(date))?TQDateTime::fromString(TQString::FROMUTF8(date),Qt::ISODate):TQDateTime()), + m_line(line?line:""),m_author(author?author:""), + m_merge_revision(merge_revision), + m_merge_date( (merge_date&&strlen(merge_date))?TQDateTime::fromString(TQString::FROMUTF8(merge_date),Qt::ISODate):TQDateTime()), + m_merge_author(merge_author?merge_author:""),m_merge_path(merge_path?merge_path:"") + { + } + + AnnotateLine ( const AnnotateLine &other) + : m_line_no (other.m_line_no), m_revision (other.m_revision), m_date (other.m_date), + m_line (other.m_line), m_author (other.m_author) + { + } + AnnotateLine() + : m_line_no(0),m_revision(-1),m_date(), + m_line(), m_author() + { + } + + /** + * destructor + */ + virtual ~AnnotateLine () + { + } + + TQLONG + lineNumber () const + { + return m_line_no; + } + TQLONG + revision () const + { + return m_revision; + } + + + const TQByteArray & + author () const + { + return m_author; + } + + + const TQDateTime & + date () const + { + return m_date; + } + + + const TQByteArray & + line () const + { + return m_line; + } + + protected: + TQLONG m_line_no; + TQLONG m_revision; + TQDateTime m_date; + TQCString m_line; + TQCString m_author; + + TQLONG m_merge_revision; + TQDateTime m_merge_date; + TQCString m_merge_author; + TQCString m_merge_path; + }; +} + +#endif diff --git a/src/svnqt/annotate_line.hpp b/src/svnqt/annotate_line.hpp deleted file mode 100644 index c63c502..0000000 --- a/src/svnqt/annotate_line.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ -#ifndef _SVNCPP_ANNOTATE_LINE_HPP_ -#define _SVNCPP_ANNOTATE_LINE_HPP_ - -#include "svnqt/svnqt_defines.hpp" - -#include -#include - -namespace svn -{ - /** - * This class holds the data for one line in an annotation - */ - class AnnotateLine - { - public: - AnnotateLine (TQLONG line_no, - TQLONG revision, - const char *author, - const char *date, - const char *line) - : m_line_no (line_no), m_revision (revision), - m_date( (date&&strlen(date))?TQDateTime::fromString(TQString::FROMUTF8(date),Qt::ISODate):TQDateTime()), - m_line(line?line:""),m_author(author?author:""), - m_merge_revision(-1), - m_merge_date(TQDateTime()), - m_merge_author(""),m_merge_path("") - - { - } - - AnnotateLine (TQLONG line_no, - TQLONG revision, - const char *author, - const char *date, - const char *line, - TQLONG merge_revision, - const char *merge_author, - const char *merge_date, - const char *merge_path - ) - : m_line_no (line_no), m_revision (revision), - m_date( (date&&strlen(date))?TQDateTime::fromString(TQString::FROMUTF8(date),Qt::ISODate):TQDateTime()), - m_line(line?line:""),m_author(author?author:""), - m_merge_revision(merge_revision), - m_merge_date( (merge_date&&strlen(merge_date))?TQDateTime::fromString(TQString::FROMUTF8(merge_date),Qt::ISODate):TQDateTime()), - m_merge_author(merge_author?merge_author:""),m_merge_path(merge_path?merge_path:"") - { - } - - AnnotateLine ( const AnnotateLine &other) - : m_line_no (other.m_line_no), m_revision (other.m_revision), m_date (other.m_date), - m_line (other.m_line), m_author (other.m_author) - { - } - AnnotateLine() - : m_line_no(0),m_revision(-1),m_date(), - m_line(), m_author() - { - } - - /** - * destructor - */ - virtual ~AnnotateLine () - { - } - - TQLONG - lineNumber () const - { - return m_line_no; - } - TQLONG - revision () const - { - return m_revision; - } - - - const TQByteArray & - author () const - { - return m_author; - } - - - const TQDateTime & - date () const - { - return m_date; - } - - - const TQByteArray & - line () const - { - return m_line; - } - - protected: - TQLONG m_line_no; - TQLONG m_revision; - TQDateTime m_date; - TQCString m_line; - TQCString m_author; - - TQLONG m_merge_revision; - TQDateTime m_merge_date; - TQCString m_merge_author; - TQCString m_merge_path; - }; -} - -#endif diff --git a/src/svnqt/apr.cpp b/src/svnqt/apr.cpp index 97bb3b8..bb42d59 100644 --- a/src/svnqt/apr.cpp +++ b/src/svnqt/apr.cpp @@ -32,7 +32,7 @@ #include "apr_general.h" // svncpp -#include "apr.hpp" +#include "apr.h" /** diff --git a/src/svnqt/apr.h b/src/svnqt/apr.h new file mode 100644 index 0000000..05afb10 --- /dev/null +++ b/src/svnqt/apr.h @@ -0,0 +1,64 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_APR_H_ +#define _SVNCPP_APR_H_ + +namespace svn +{ + + /** + * APR class. Include this class in your application for apr + * support. + */ + class Apr + { + public: + /** + * Default constructor. Initializes APR + */ + Apr (); + + /** + * Destructor. Terminates APR + */ + ~Apr (); + + private: + /** Disallow copy constructor */ + Apr (const Apr &); + + /** Disallow assignment operator */ + Apr & + operator = (const Apr &); + }; +} + +#endif diff --git a/src/svnqt/apr.hpp b/src/svnqt/apr.hpp deleted file mode 100644 index 05afb10..0000000 --- a/src/svnqt/apr.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_APR_H_ -#define _SVNCPP_APR_H_ - -namespace svn -{ - - /** - * APR class. Include this class in your application for apr - * support. - */ - class Apr - { - public: - /** - * Default constructor. Initializes APR - */ - Apr (); - - /** - * Destructor. Terminates APR - */ - ~Apr (); - - private: - /** Disallow copy constructor */ - Apr (const Apr &); - - /** Disallow assignment operator */ - Apr & - operator = (const Apr &); - }; -} - -#endif diff --git a/src/svnqt/cache/DatabaseException.cpp b/src/svnqt/cache/DatabaseException.cpp index 199a5f9..7ca796a 100644 --- a/src/svnqt/cache/DatabaseException.cpp +++ b/src/svnqt/cache/DatabaseException.cpp @@ -1,4 +1,4 @@ -#include "DatabaseException.hpp" +#include "DatabaseException.h" /*! \fn svn::cache::DatabaseException::DatabaseException(const TQString&msg,int aNumber)throw() diff --git a/src/svnqt/cache/DatabaseException.h b/src/svnqt/cache/DatabaseException.h new file mode 100644 index 0000000..c089beb --- /dev/null +++ b/src/svnqt/cache/DatabaseException.h @@ -0,0 +1,35 @@ +#ifndef _DATABASE_EXCEPTION_HPP +#define _DATABASE_EXCEPTION_HPP + +#include "svnqt/exception.h" + +namespace svn +{ +namespace cache +{ + +class SVNTQT_EXPORT DatabaseException:public svn::Exception +{ + private: + DatabaseException()throw(); + int m_number; + + public: + DatabaseException(const TQString&msg)throw() + : Exception(msg),m_number(-1) + {} + + DatabaseException(const DatabaseException&src)throw() + : Exception(src.msg()),m_number(src.number()) + {} + DatabaseException(const TQString&msg,int aNumber)throw(); + virtual ~DatabaseException()throw(){} + int number() const + { + return m_number; + } +}; + +} +} +#endif diff --git a/src/svnqt/cache/DatabaseException.hpp b/src/svnqt/cache/DatabaseException.hpp deleted file mode 100644 index 9e67cb9..0000000 --- a/src/svnqt/cache/DatabaseException.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _DATABASE_EXCEPTION_HPP -#define _DATABASE_EXCEPTION_HPP - -#include "svnqt/exception.hpp" - -namespace svn -{ -namespace cache -{ - -class SVNTQT_EXPORT DatabaseException:public svn::Exception -{ - private: - DatabaseException()throw(); - int m_number; - - public: - DatabaseException(const TQString&msg)throw() - : Exception(msg),m_number(-1) - {} - - DatabaseException(const DatabaseException&src)throw() - : Exception(src.msg()),m_number(src.number()) - {} - DatabaseException(const TQString&msg,int aNumber)throw(); - virtual ~DatabaseException()throw(){} - int number() const - { - return m_number; - } -}; - -} -} -#endif diff --git a/src/svnqt/cache/LogCache.cpp b/src/svnqt/cache/LogCache.cpp index a3cb590..f6b7b3b 100644 --- a/src/svnqt/cache/LogCache.cpp +++ b/src/svnqt/cache/LogCache.cpp @@ -1,4 +1,4 @@ -#include "LogCache.hpp" +#include "LogCache.h" #include #include @@ -6,8 +6,8 @@ #include #include -#include "svnqt/path.hpp" -#include "svnqt/cache/DatabaseException.hpp" +#include "svnqt/path.h" +#include "svnqt/cache/DatabaseException.h" #ifndef NO_SQLITE3 #define SQLTYPE "TQSQLITE3" diff --git a/src/svnqt/cache/LogCache.h b/src/svnqt/cache/LogCache.h new file mode 100644 index 0000000..5e43b40 --- /dev/null +++ b/src/svnqt/cache/LogCache.h @@ -0,0 +1,42 @@ +#ifndef _LOG_CACHE_HPP +#define _LOG_CACHE_HPP + +#include +#include +#include + +#include "svnqt/svnqt_defines.h" +#include "svnqt/shared_pointer.h" + +namespace svn { + namespace cache { + + class LogCacheData; + + class SVNTQT_EXPORT LogCache + { + private: + svn::SharedPointer m_CacheData; + + protected: + LogCache(); + static LogCache* mSelf; + TQString m_BasePath; + static TQString s_CACHE_FOLDER; + void setupCachePath(); + void setupMainDb(); + + public: + ///! should used for testing only! + LogCache(const TQString&aBasePath); + virtual ~LogCache(); + static LogCache* self(); + TQDataBase reposDb(const TQString&aRepository); + TQStringList cachedRepositories()const; + + bool valid()const; + }; + } +} + +#endif diff --git a/src/svnqt/cache/LogCache.hpp b/src/svnqt/cache/LogCache.hpp deleted file mode 100644 index eaaf37a..0000000 --- a/src/svnqt/cache/LogCache.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _LOG_CACHE_HPP -#define _LOG_CACHE_HPP - -#include -#include -#include - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/shared_pointer.hpp" - -namespace svn { - namespace cache { - - class LogCacheData; - - class SVNTQT_EXPORT LogCache - { - private: - svn::SharedPointer m_CacheData; - - protected: - LogCache(); - static LogCache* mSelf; - TQString m_BasePath; - static TQString s_CACHE_FOLDER; - void setupCachePath(); - void setupMainDb(); - - public: - ///! should used for testing only! - LogCache(const TQString&aBasePath); - virtual ~LogCache(); - static LogCache* self(); - TQDataBase reposDb(const TQString&aRepository); - TQStringList cachedRepositories()const; - - bool valid()const; - }; - } -} - -#endif diff --git a/src/svnqt/cache/ReposLog.cpp b/src/svnqt/cache/ReposLog.cpp index d8cd609..81b022b 100644 --- a/src/svnqt/cache/ReposLog.cpp +++ b/src/svnqt/cache/ReposLog.cpp @@ -1,11 +1,11 @@ -#include "ReposLog.hpp" - -#include "LogCache.hpp" -#include "svnqt/info_entry.hpp" -#include "svnqt/svnqttypes.hpp" -#include "svnqt/client.hpp" -#include "svnqt/context_listener.hpp" -#include "svnqt/cache/DatabaseException.hpp" +#include "ReposLog.h" + +#include "LogCache.h" +#include "svnqt/info_entry.h" +#include "svnqt/svnqttypes.h" +#include "svnqt/client.h" +#include "svnqt/context_listener.h" +#include "svnqt/cache/DatabaseException.h" #include diff --git a/src/svnqt/cache/ReposLog.h b/src/svnqt/cache/ReposLog.h new file mode 100644 index 0000000..4d01fae --- /dev/null +++ b/src/svnqt/cache/ReposLog.h @@ -0,0 +1,70 @@ +#ifndef _REPOS_LOG_HPP +#define _REPOS_LOG_HPP + +#include "svnqt/svnqt_defines.h" +#include "svnqt/svnqttypes.h" +#include "svnqt/revision.h" + +#include +#include + +namespace svn +{ + +class Client; + +namespace cache +{ + +class SVNTQT_EXPORT ReposLog +{ +protected: + svn::Client*m_Client; + mutable TQDataBase m_Database; + TQString m_ReposRoot; + svn::Revision m_latestHead; + //! internal insert. + bool _insertLogEntry(const svn::LogEntry&); + bool checkFill(svn::Revision&_start,svn::Revision&_end,bool checkHead); + +public: + ReposLog(svn::Client*aClient,const TQString&aRepository=TQString()); + + TQString ReposRoot() const + { + return m_ReposRoot; + } + + TQDataBase Database() const + { + return m_Database; + } + //! search for latest head revision on network for assigned repository + svn::Revision latestHeadRev(); + //! return lates revision in cache + svn::Revision latestCachedRev(); + //! simple retrieves logentries + /*! + * This method acts on network, too for checking if there are new entries on server. + * + * @param target where to store the result + * @param start revision to start for search + * @param end revision to end for search + * @param noNetwork if yes, no check on network for newer revisions will made + * @return true if entries found and no error, if no entries found false + * @exception svn::DatabaseException in case of errors + */ + bool simpleLog(LogEntriesMap&target,const svn::Revision&start,const svn::Revision&end,bool noNetwork=false); + svn::Revision date2numberRev(const svn::Revision&,bool noNetwork=false); + bool fillCache(const svn::Revision&end); + bool insertLogEntry(const svn::LogEntry&); + bool log(const svn::Path&,const svn::Revision&start, const svn::Revision&end,const svn::Revision&peg,svn::LogEntriesMap&target, bool strictNodeHistory,int limit); + bool itemExists(const svn::Revision&,const svn::Path&); + + bool isValid()const; +}; + +} +} + +#endif diff --git a/src/svnqt/cache/ReposLog.hpp b/src/svnqt/cache/ReposLog.hpp deleted file mode 100644 index 1d28037..0000000 --- a/src/svnqt/cache/ReposLog.hpp +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef _REPOS_LOG_HPP -#define _REPOS_LOG_HPP - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/svnqttypes.hpp" -#include "svnqt/revision.hpp" - -#include -#include - -namespace svn -{ - -class Client; - -namespace cache -{ - -class SVNTQT_EXPORT ReposLog -{ -protected: - svn::Client*m_Client; - mutable TQDataBase m_Database; - TQString m_ReposRoot; - svn::Revision m_latestHead; - //! internal insert. - bool _insertLogEntry(const svn::LogEntry&); - bool checkFill(svn::Revision&_start,svn::Revision&_end,bool checkHead); - -public: - ReposLog(svn::Client*aClient,const TQString&aRepository=TQString()); - - TQString ReposRoot() const - { - return m_ReposRoot; - } - - TQDataBase Database() const - { - return m_Database; - } - //! search for latest head revision on network for assigned repository - svn::Revision latestHeadRev(); - //! return lates revision in cache - svn::Revision latestCachedRev(); - //! simple retrieves logentries - /*! - * This method acts on network, too for checking if there are new entries on server. - * - * @param target where to store the result - * @param start revision to start for search - * @param end revision to end for search - * @param noNetwork if yes, no check on network for newer revisions will made - * @return true if entries found and no error, if no entries found false - * @exception svn::DatabaseException in case of errors - */ - bool simpleLog(LogEntriesMap&target,const svn::Revision&start,const svn::Revision&end,bool noNetwork=false); - svn::Revision date2numberRev(const svn::Revision&,bool noNetwork=false); - bool fillCache(const svn::Revision&end); - bool insertLogEntry(const svn::LogEntry&); - bool log(const svn::Path&,const svn::Revision&start, const svn::Revision&end,const svn::Revision&peg,svn::LogEntriesMap&target, bool strictNodeHistory,int limit); - bool itemExists(const svn::Revision&,const svn::Path&); - - bool isValid()const; -}; - -} -} - -#endif diff --git a/src/svnqt/cache/test/sqlite.cpp b/src/svnqt/cache/test/sqlite.cpp index 07b5148..78cfc30 100644 --- a/src/svnqt/cache/test/sqlite.cpp +++ b/src/svnqt/cache/test/sqlite.cpp @@ -5,14 +5,14 @@ #include #include -#include "svnqt/client.hpp" -#include "svnqt/svnqttypes.hpp" -#include "svnqt/log_entry.hpp" +#include "svnqt/client.h" +#include "svnqt/svnqttypes.h" +#include "svnqt/log_entry.h" -#include "svnqt/cache/LogCache.hpp" -#include "svnqt/cache/ReposLog.hpp" +#include "svnqt/cache/LogCache.h" +#include "svnqt/cache/ReposLog.h" #include "svnqt/cache/test/testconfig.h" -#include "svnqt/cache/DatabaseException.hpp" +#include "svnqt/cache/DatabaseException.h" #if [[[TQT_VERSION IS DEPRECATED]]] < 0x040000 #else diff --git a/src/svnqt/check.h b/src/svnqt/check.h new file mode 100644 index 0000000..7921e7e --- /dev/null +++ b/src/svnqt/check.h @@ -0,0 +1,45 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_CHECK_HPP_ +#define _SVNCPP_CHECK_HPP_ + +// subversion api +#include "svn_version.h" + +/** + * Check if the current version of the subversion + * API is at least major.minor + */ +#define CHECK_SVN_VERSION (major,minor) \ + (SVN_VER_MAJOR > (major) || \ + (SVN_VER_MAJOR == (major) && SVN_VER_MINOR > (minor)) + +#endif diff --git a/src/svnqt/check.hpp b/src/svnqt/check.hpp deleted file mode 100644 index 7921e7e..0000000 --- a/src/svnqt/check.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_CHECK_HPP_ -#define _SVNCPP_CHECK_HPP_ - -// subversion api -#include "svn_version.h" - -/** - * Check if the current version of the subversion - * API is at least major.minor - */ -#define CHECK_SVN_VERSION (major,minor) \ - (SVN_VER_MAJOR > (major) || \ - (SVN_VER_MAJOR == (major) && SVN_VER_MINOR > (minor)) - -#endif diff --git a/src/svnqt/client.cpp b/src/svnqt/client.cpp index 73b4b60..9df6cb4 100644 --- a/src/svnqt/client.cpp +++ b/src/svnqt/client.cpp @@ -32,9 +32,9 @@ #endif // svncpp -#include "svnqt/client.hpp" -#include "svnqt/client_impl.hpp" -#include "svnqt/svnqt_defines.hpp" +#include "svnqt/client.h" +#include "svnqt/client_impl.h" +#include "svnqt/svnqt_defines.h" #include "svn_opt.h" diff --git a/src/svnqt/client.h b/src/svnqt/client.h new file mode 100644 index 0000000..cea1d5b --- /dev/null +++ b/src/svnqt/client.h @@ -0,0 +1,873 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_CLIENT_H_ +#define _SVNCPP_CLIENT_H_ + +// Ignore MSVC 6 compiler warning: debug symbol truncated +#if defined (_MSC_VER) && _MSC_VER <= 1200 +#pragma warning (disable: 4786) +#endif + +// Ignore MSVC 7, 2005 & 2008 compiler warning: C++ exception specification +#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1550 +#pragma warning (disable: 4290) +#endif + +#include "svnqt/svnqt_defines.h" +#include "svnqt/svnqttypes.h" +#include "svnqt/svnstream.h" + +// qt +#include + +#include +#include +#include +#include + +// svnqt +#include "svnqt/context.h" +#include "svnqt/exception.h" +#include "svnqt/path.h" +#include "svnqt/entry.h" +#include "svnqt/revision.h" +#include "svnqt/log_entry.h" +#include "svnqt/info_entry.h" +#include "svnqt/annotate_line.h" +#include "svnqt/stringarray.h" +#include "svnqt/diffoptions.h" +#include "svnqt/conflictresult.h" + +class TQStringList; + +namespace svn +{ + /** Subversion client API. + * + * Never use an object of this as global static! This will make problems with subversion + * initialize. + */ + class SVNTQT_EXPORT Client + { + public: + + /** + * Initializes the primary memory pool. + */ + Client(); + + virtual ~Client (); + + + /** + * @return returns the Client context + */ + virtual const ContextP + getContext () const = 0; + + /** + * sets the client context + * you have to make sure the old context + * is de-allocated + * + * @param context new context to use + */ + virtual void + setContext (ContextP context) = 0; + + /** + * get a real instance. Result must cleaned with delete. + * \param context The context to use + * \param subtype the wanted implementation - this moment only 0 allowed. + * \return an instance of client or 0L if error. + */ + static Client*getobject(ContextP context,int subtype=0); + + /** + * Enumerates all files/dirs at a given path. + * + * Throws an exception if an error occurs + * + * @param path Path to explore. + * @param descend Recurse into subdirectories if existant. + * @param get_all Return all entries, not just the interesting ones. + * @param update Query the repository for updates. + * @param no_ignore Disregard default and svn:ignore property ignores. + * @param hide_externals don't recurse into external definitions + * @param revision list specific revision when browsing remote, on working copies parameter will ignored + * @param detailed_remote if on remote listing detailed item info should get if possible + * that may slow so should configureable in frontends! + * @return vector with Status entries. + */ + virtual StatusEntries + status (const Path& path, + Depth depth=DepthImmediates, + bool get_all = true, + bool update = false, + bool no_ignore = false, + const Revision revision = svn::Revision::HEAD, + bool detailed_remote = false, + bool hide_externals = false, + const StringArray & changelists=StringArray() ) throw (ClientException) = 0; + + /** + * Returns the status of a single file in the path. + * + * Throws an exception if an error occurs + * + * @param path File to gather status. + * @param update if check against repository if new updates are there (for WC only) + * @param revision list specific revision when browsing remote, on working copies parameter will ignored + * @return a Status with Statis.isVersioned = FALSE + */ + virtual StatusPtr + singleStatus (const Path& path,bool update=false,const Revision revision = svn::Revision::HEAD) throw (ClientException)=0; + + /** + * Executes a revision checkout. + * @param moduleName name of the module to checkout. + * @param destPath destination directory for checkout. + * @param revision the revision number to checkout. If the number is -1 + * then it will checkout the latest revision. + * @param peg Revision to look up + * @param recurse whether you want it to checkout files recursively. + * @param ignore_externals if true don't process externals definitions. + * @exception ClientException + */ + virtual svn_revnum_t + checkout (const Path& moduleName, const Path & destPath, + const Revision & revision, + const Revision & peg = Revision::UNDEFINED, + svn::Depth depth=DepthInfinity, + bool ignore_externals=false, + bool overwrite=false + ) throw (ClientException) = 0; + + /** + * relocate wc @a from to @a to + * @exception ClientException + */ + virtual void + relocate (const Path & path, const TQString &from_url, + const TQString &to_url, bool recurse) throw (ClientException)=0; + + /** + * Sets a single file for deletion. + * @exception ClientException + */ + virtual svn::Revision + remove (const Path & path, bool force, + bool keep_local = true, + const PropertiesMap&revProps = PropertiesMap()) throw (ClientException)=0; + + /** + * Sets files for deletion. + * + * @param targets targets to delete + * @param force force if files are locally modified + * @exception ClientException + */ + virtual svn::Revision + remove (const Targets & targets, + bool force, + bool keep_local=true, + const PropertiesMap&revProps=PropertiesMap()) throw (ClientException) = 0; + + /** + * Reverts a couple of files to a pristiner state. + * @exception ClientException + */ + virtual void + revert (const Targets & targets, + Depth depth, + const StringArray&changelist=StringArray() + ) throw (ClientException)=0; + + + /** + * Adds a file to the repository. + * @param path the path to add + * @param depth if @a path is a folder add items recursive depending on value if it. + * @param force if true, do not error on already-versioned items. + * @param no_ignore if false don't add files or directories that match ignore patterns. When build against svn 1.2 always false + * @param add_parents if true, go up to the next versioned folder and add all between path and this folder. + * @exception ClientException + */ + virtual void + add (const Path & path, svn::Depth depth,bool force=false, bool no_ignore=false, bool add_parents = true) throw (ClientException)=0; + + /** + * Updates the file or directory. + * @param path targets. + * @param revision the revision number to checkout. + * Revision::HEAD will checkout the + * latest revision. + * @param depth Depthness for operation + * @param ignore_externals ignore externals + * @param allow_unversioned will operation not fail if there are unversioned items in tree with same name. + * @exception ClientException + */ + virtual Revisions + update (const Targets & path, const Revision & revision, + Depth depth,bool ignore_externals,bool allow_unversioned, + bool sticky_depth) throw (ClientException) = 0; + + /** + * Retrieves the contents for a specific @a revision of + * a @a path at @a peg_revision + * + * @param path path of file or directory + * @param peg_revision revision to base the URL + * @param revision revision to retrieve + * @return contents of the file + */ + virtual TQByteArray + cat (const Path & path, + const Revision & revision, + const Revision & peg_revision=svn_opt_revision_unspecified) throw (ClientException)=0; + /** + * Retrieves the contents for a specific @a revision of + * a @a path at @a peg_revision + * + * @param buffer Stream to store content direct + * @param path path of file or directory + * @param peg_revision revision to base the URL + * @param revision revision to retrieve + * @exception ClientException + */ + virtual void + cat(svn::stream::SvnStream&buffer, + const Path & path, + const Revision & revision, + const Revision & peg_revision) throw (ClientException)=0; + /** + * Retrieves the contents for a specific @a revision of + * a @a path at @a peg_revision + * + * @param path path of file or directory + * @param target new (local) name + * @param peg_revision revision to base the URL + * @param revision revision to retrieve + * @param peg_revision Revision to look at + */ + virtual void + get (const Path & path, + const TQString & target, + const Revision & revision, + const Revision & peg_revision=svn_opt_revision_unspecified) throw (ClientException)=0; + + /** + * Retrieves the contents for a specific @a revision of + * a @a path and stores the result in @a target + * + * @param target the container where to store the result + * @param path path of file or directory + * @param revisionStart revision to retrieve + * @param revisionEnd revision to retrieve + * @param peg indicates in which revision path is valid + */ + virtual void + annotate (AnnotatedFile&target, + const Path & path, + const Revision & revisionStart, + const Revision & revisionEnd, + const Revision & peg = Revision::UNDEFINED, + const DiffOptions&diffoptions = DiffOptions(), + bool ignore_mimetypes = false, + bool include_merged_revisions = false + ) throw (ClientException)=0; + + /** + * Commits changes to the repository. This usually requires + * authentication, see Auth. + * @return Returns revision transferred or svn::Revision::UNDEFINED if the revision number is invalid. + * @param targets files to commit. + * @param message log message. + * @param depth whether the operation should be done recursively. + * @param keep_locks if false unlock items in paths + * @param changelist + * @param keep_changelist + * @exception ClientException + */ + virtual svn::Revision + commit (const Targets & targets, + const TQString& message, + svn::Depth depth,bool keep_locks=true, + const svn::StringArray&contents=svn::StringArray(), + const PropertiesMap&revProps=PropertiesMap(), + bool keep_changelist=false + ) throw (ClientException)=0; + + /** + * Copies a versioned file with the history preserved. + * @exception ClientException + */ + virtual svn::Revision + copy (const Path & srcPath, + const Revision & srcRevision, + const Path & destPath) throw (ClientException)=0; + /** + * Copies a versioned file with the history preserved. + * @since subversion 1.5 api + * @see svn_client_copy4 + * @exception ClientException + */ + virtual svn::Revision + copy (const Targets & srcPath, + const Revision & srcRevision, + const Revision & pegRevision, + const Path & destPath, + bool asChild=false,bool makeParent=false,const PropertiesMap&revProps=PropertiesMap()) throw (ClientException)=0; + + /** + * Moves or renames a file. + * @exception ClientException + */ + virtual svn::Revision + move (const Path & srcPath, + const Path & destPath, + bool force) throw (ClientException)=0; + /** + * Moves or renames a file. + * @exception ClientException + */ + virtual svn::Revision + move (const Targets & srcPath, + const Path & destPath, + bool force,bool asChild,bool makeParent,const PropertiesMap&revProps=PropertiesMap()) throw (ClientException)=0; + + /** + * Creates a directory directly in a repository or creates a + * directory on disk and schedules it for addition. If path + * is a URL then authentication is usually required, see Auth and + * the callback asks for a logmessage. With subversion 1.4 the target + * must not exist (\sa svn_client_move4) + * + * @param path + * @param message log message. if it is TQString() asks when working on repository + * @param makeParent create parent folders if not existant (only when build with svn 1.5 or above) + * @exception ClientException + */ + virtual svn::Revision + mkdir (const Path & path, + const TQString& message, + bool makeParent=true, + const PropertiesMap&revProps=PropertiesMap() + ) throw (ClientException)=0; + /** + * Creates a directory directly in a repository or creates a + * directory on disk and schedules it for addition. If path + * is a URL then authentication is usually required, see Auth and + * the callback asks for a logmessage. + * + * @param targets encoded pathes to create + * @param message log message. if it is TQString() asks when working on repository + * @param makeParent create parent folders if not existant (only when build with svn 1.5 or above) + * @exception ClientException + */ + virtual svn::Revision + mkdir (const Targets & targets, + const TQString& message, + bool makeParent=true, + const PropertiesMap&revProps=PropertiesMap() + ) throw (ClientException)=0; + + /** + * Recursively cleans up a local directory, finishing any + * incomplete operations, removing lockfiles, etc. + * @param path a local directory. + * @exception ClientException + */ + virtual void + cleanup (const Path & path) throw (ClientException)=0; + + /** + * Removes the 'conflicted' state on a file. + * @exception ClientException + */ + virtual void resolve (const Path & path,Depth depth,const ConflictResult&resolution=ConflictResult()) throw (ClientException)=0; + + /** + * Exports the contents of either a subversion repository into a + * 'clean' directory (meaning a directory with no administrative + * directories). + * @exception ClientException + * @param srcPath source path + * @param destPath a destination path that must not already exist. + * @param revision revision to use for the export + * @param peg the revision where the path is first looked up when exporting from a repository. + * @param overwrite overwrite existing files + * @param native_eol Either "LF", "CR" or "CRLF" or NULL. + * @param ignore_externals don't process externals definitions as part of this operation. + * @param recurse if true, export recursively.
+ Otherwise, export just the directory represented by from and its immediate non-directory children. + */ + virtual svn_revnum_t + doExport (const Path & srcPath, + const Path & destPath, + const Revision & revision, + const Revision & peg = Revision::UNDEFINED, + bool overwrite=false, + const TQString&native_eol=TQString(), + bool ignore_externals = false, + svn::Depth depth=svn::DepthInfinity + ) throw (ClientException)=0; + + /** + * Update local copy to mirror a new url. This excapsulates the + * svn_client_switch() client method. + * @exception ClientException + */ + virtual svn_revnum_t + doSwitch ( + const Path & path, const TQString& url, + const Revision & revision, + Depth depth, + const Revision & peg=Revision::UNDEFINED, + bool sticky_depth = true, + bool ignore_externals=false, + bool allow_unversioned=false + ) throw (ClientException)=0; + + /** + * Import file or directory PATH into repository directory URL at + * head. This usually requires authentication, see Auth. + * @param path path to import + * @param url + * @param message log message. + * @param depth kind of recurse operation + * @param no_ignore if false, don't add items matching global ignore pattern (@since subversion 1.3) + * @param no_unknown_nodetype if true ignore files type not known like pipes or device files (@since subversion 1.5) + * @exception ClientException + */ + virtual svn::Revision + import (const Path & path, const TQString& url, + const TQString& message, + svn::Depth depth, + bool no_ignore,bool no_unknown_nodetype, + const PropertiesMap&revProps=PropertiesMap()) throw (ClientException)=0; + + /** + * Merge changes from two paths into a new local path. + * @exception ClientException + */ + virtual void + merge (const Path & path1, const Revision & revision1, + const Path & path2, const Revision & revision2, + const Path & localPath, bool force, + Depth depth, + bool notice_ancestry=false, + bool dry_run=false, + bool record_only=false, + const StringArray&merge_options=StringArray() + ) throw (ClientException)=0; + + virtual void + merge_peg(const Path&src, + const RevisionRanges&ranges, + const Revision&peg, + const Path&targetWc, + Depth depth, + bool notice_ancestry=false, + bool dry_run=false, + bool force=false, + bool record_only=false, + const StringArray&merge_options=StringArray() + ) throw (ClientException)=0; + + virtual void + merge_peg(const Path&src, + const RevisionRange&range, + const Revision&peg, + const Path&targetWc, + Depth depth, + bool notice_ancestry=false, + bool dry_run=false, + bool force=false, + const StringArray&merge_options=StringArray() + ) throw (ClientException)=0; + + /** + * Retrieve information for the given path + * remote or local. + * + * @param path path for info + * @param rec recursive (if dir) + * @param rev for which revision + * @param peg_revision peg revision + * @return InfoEntries + */ + virtual InfoEntries + info (const Path &path, + Depth depth, + const Revision & rev, + const Revision & peg_revision=svn_opt_revision_unspecified, + const StringArray&changelists=StringArray() + ) throw (ClientException)=0; + + /** + * Retrieve log information for the given path + * Loads the log messages result set. The first + * entry is the youngest revision. + * + * You can use the constants Revision::START and + * Revision::HEAD + * + * @param path + * @param revisionStart + * @param revisionEnd + * @param discoverChangedPaths + * @param strictNodeHistory + * @param limit the maximum log entries count. + * @return a vector with log entries + */ + virtual LogEntriesPtr + log (const Path& path, + const Revision & revisionStart, + const Revision & revisionEnd, + const Revision & revisionPeg, + bool discoverChangedPaths=false, + bool strictNodeHistory=true,int limit = 0, + bool include_merged_revisions = false, + const StringArray&revprops=StringArray() + ) throw (ClientException)=0; + + /** + * Retrieve log information for the given path + * Loads the log messages result set. Result will stored + * in a map where the key is the revision number + * + * You can use the constants Revision::START and + * Revision::HEAD + * + * @param path Path to make a log for + * @param revisionStart + * @param revisionEnd + * @param target the logmap where to store the entries + * @param discoverChangedPaths + * @param strictNodeHistory + * @param limit (ignored when subversion 1.1 API) + * @return true if success + */ + virtual bool + log (const Path& path, const Revision & revisionStart, + const Revision & revisionEnd, + LogEntriesMap&target, + const Revision & revisionPeg=Revision::UNDEFINED, + bool discoverChangedPaths=false, + bool strictNodeHistory=true,int limit = 0, + bool include_merged_revisions = false, + const StringArray&revprops=StringArray() + ) throw (ClientException)=0; + + /** + * Produce diff output which describes the delta between + * @a path/@a revision1 and @a path/@a revision2. @a path + * can be either a working-copy path or a URL. + * + * A ClientException will be thrown if either @a revision1 or + * @a revision2 has an `unspecified' or unrecognized `kind'. + * + * @param tmpPath prefix for a temporary directory needed by diff. + * Filenames will have ".tmp" and similar added to this prefix in + * order to ensure uniqueness. + * @param path path of the file. + * @param revision1 one of the revisions to check. + * @param revision2 the other revision. + * @param recurse whether the operation should be done recursively. + * @param ignoreAncestry whether the files will be checked for + * relatedness. + * @param noDiffDeleted if true, no diff output will be generated on deleted files. + * @param ignore_contenttype if true generate diff even the items are marked as binaries + * @param extra extra options for diff ("-b", "-w","--ignore-eol-style") + * @return delta between the files + * @exception ClientException + */ + virtual TQByteArray + diff_peg(const Path & tmpPath, const Path & path,const Path&relativeTo, + const Revision & revision1, const Revision & revision2, const Revision& peg_revision, + Depth depth, bool ignoreAncestry, + bool noDiffDeleted,bool ignore_contenttype, + const StringArray&extra, + const StringArray&changelists + ) throw (ClientException)=0; + + /** + * Same as other diff but extra options always set to empty list. + */ + virtual TQByteArray + diff_peg (const Path & tmpPath, const Path & path,const Path&relativeTo, + const Revision & revision1, const Revision & revision2, const Revision& peg_revision, + Depth depth, bool ignoreAncestry, + bool noDiffDeleted,bool ignore_contenttype) throw (ClientException)=0; + + /** + * Produce diff output which describes the delta between + * @a path1/@a revision1 and @a path2/@a revision2. @a path2 + * can be either a working-copy path or a URL. + * + * A ClientException will be thrown if either @a revision1 or + * @a revision2 has an `unspecified' or unrecognized `kind'. + * + * @param tmpPath prefix for a temporary directory needed by diff. + * Filenames will have ".tmp" and similar added to this prefix in + * order to ensure uniqueness. + * @param path1 first file or folder to diff. + * @param path2 second file or folder to diff. + * @param revision1 one of the revisions to check (path1). + * @param revision2 the other revision (path2). + * @param recurse whether the operation should be done recursively. + * @param ignoreAncestry whether the files will be checked for + * relatedness. + * @param noDiffDeleted if true, no diff output will be generated on deleted files. + * @param ignore_contenttype if true generate diff even the items are marked as binaries + * @param extra extra options for diff ("-b", "-w","--ignore-eol-style") + * @return delta between the files + * @exception ClientException + */ + virtual TQByteArray + diff (const Path & tmpPath, const Path & path1,const Path & path2,const Path&relativeTo, + const Revision & revision1, const Revision & revision2, + Depth depth, bool ignoreAncestry, + bool noDiffDeleted,bool ignore_contenttype, + const StringArray&extra, + const StringArray&changelists + ) throw (ClientException)=0; + + /** + * Same as other diff but extra options and changelists always set to empty list. + */ + virtual TQByteArray + diff (const Path & tmpPath, const Path & path1,const Path & path2,const Path&relativeTo, + const Revision & revision1, const Revision & revision2, + Depth depth, bool ignoreAncestry, + bool noDiffDeleted,bool ignore_contenttype) throw (ClientException)=0; + + /** + * lists entries in @a pathOrUrl no matter whether local or + * repository + * + * If checking for locks is activated, it lists the locks inside repository, not locks inside + * working copy! + * @param pathOrUrl + * @param revision + * @param peg at wich revision path exists + * @param depth @sa depth + * @param retrieve_locks check for REPOSITORY locks while listing. + * @return a vector of directory entries, each with + * a relative path (only filename). In subversion >= 1.4 an entry without a name is returned, too. This + * is the searched directory (done in subversion itself) + */ + virtual DirEntries + list (const Path& pathOrUrl, + const Revision& revision, + const Revision& peg, + svn::Depth depth,bool retrieve_locks) throw (ClientException)=0; + + /** + * lists properties in @a path no matter whether local or + * repository + * + * @param path + * @param revision + * @param peg most case should set to @a revision + * @param recurse + * @return PropertiesList + */ + virtual PathPropertiesMapListPtr + proplist(const Path &path, + const Revision &revision, + const Revision &peg, + Depth depth=DepthEmpty, + const StringArray&changelists=StringArray() + )=0; + + /** + * lists one property in @a path no matter whether local or + * repository + * + * @param propName + * @param path + * @param revision + * @param peg most case should set to @a revision + * @param recurse + * @return PathPropertiesMapList and revision where the properties are taken from (svn 1.5) or undefined revision (prior 1.5) + */ + virtual TQPair + propget(const TQString& propName, + const Path &path, + const Revision &revision, + const Revision &peg, + Depth depth = svn::DepthEmpty, + const StringArray&changelists=StringArray()) = 0; + + /** + * set property in @a path no matter whether local or + * repository + * + * @param path + * @param revision + * @param propName + * @param propValue + * @param recurse + * @param skip_checks if true skip validity checks + * @return PropertiesList + */ + virtual void + propset(const TQString& propName, + const TQString& propValue, + const Path &path, + Depth depth=DepthEmpty, + bool skip_checks=false, + const Revision&base_revision=Revision::UNDEFINED, + const StringArray&changelists=StringArray(), + const PropertiesMap&revProps=PropertiesMap() + ) = 0; + + /** + * delete property in @a path no matter whether local or + * repository + * + * @param propName + * @param path + * @param revision + * @param recurse + */ + virtual void + propdel(const TQString& propName, + const Path &path, + Depth depth=DepthEmpty, + bool skip_check=false, + const Revision&base_revision=Revision::UNDEFINED, + const StringArray&changelists=StringArray())=0; + + + /** + * lists revision properties in @a path no matter whether local or + * repository + * + * @param path + * @param revision + * @return PropertiesList + */ + virtual TQPair + revproplist(const Path &path, + const Revision &revision)=0; + + /** + * lists one revision property in @a path no matter whether local or + * repository + * + * @param propName + * @param path + * @param revision + * @return PropertiesList + */ + virtual TQPair + revpropget(const TQString& propName, + const Path &path, + const Revision &revision)=0; + + /** + * set revision property in @a path no matter whether local or + * repository + * + * @param propName + * @param propValue + * @param path + * @param revision + * @param force + * @return Revision + */ + virtual TQLONG + revpropset(const TQString& propName, + const TQString& propValue, + const Path &path, + const Revision &revision, + bool force=false)=0; + + /** + * delete revision property in @a path no matter whether local or + * repository + * + * @param propName + * @param path + * @param revision + * @param force + * @return Revision + */ + virtual TQLONG + revpropdel(const TQString& propName, + const Path &path, + const Revision &revision, + bool force=false) = 0; + + /** + * lock files in repository or working copy + * @param targets items to be locked + * @param message if non null stored with each lock in repository + * @param steal_lock if true locks in wc will stolen. + * @since subversion 1.2 + */ + virtual void + lock (const Targets & targets, + const TQString& message, + bool steal_lock) throw (ClientException)=0; + /** + * unlock files in repository or working copy + * @param targets items to unlock + * @param break_lock ignore any errors + */ + virtual void + unlock (const Targets&targets, + bool break_lock) throw (ClientException)=0; + + virtual void + url2Revision(const TQString&revstring, + Revision&start,Revision&end)=0; + virtual void + url2Revision(const TQString&revstring, + Revision&start)=0; + + private: + /** + * disallow assignment operator + */ + Client & operator= (const Client &); + /** + * disallow copy constructor + */ + Client (const Client &); + }; + +} + +#endif diff --git a/src/svnqt/client.hpp b/src/svnqt/client.hpp deleted file mode 100644 index ea04be5..0000000 --- a/src/svnqt/client.hpp +++ /dev/null @@ -1,873 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_CLIENT_H_ -#define _SVNCPP_CLIENT_H_ - -// Ignore MSVC 6 compiler warning: debug symbol truncated -#if defined (_MSC_VER) && _MSC_VER <= 1200 -#pragma warning (disable: 4786) -#endif - -// Ignore MSVC 7, 2005 & 2008 compiler warning: C++ exception specification -#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1550 -#pragma warning (disable: 4290) -#endif - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/svnqttypes.hpp" -#include "svnqt/svnstream.hpp" - -// qt -#include - -#include -#include -#include -#include - -// svnqt -#include "svnqt/context.hpp" -#include "svnqt/exception.hpp" -#include "svnqt/path.hpp" -#include "svnqt/entry.hpp" -#include "svnqt/revision.hpp" -#include "svnqt/log_entry.hpp" -#include "svnqt/info_entry.hpp" -#include "svnqt/annotate_line.hpp" -#include "svnqt/stringarray.hpp" -#include "svnqt/diffoptions.hpp" -#include "svnqt/conflictresult.hpp" - -class TQStringList; - -namespace svn -{ - /** Subversion client API. - * - * Never use an object of this as global static! This will make problems with subversion - * initialize. - */ - class SVNTQT_EXPORT Client - { - public: - - /** - * Initializes the primary memory pool. - */ - Client(); - - virtual ~Client (); - - - /** - * @return returns the Client context - */ - virtual const ContextP - getContext () const = 0; - - /** - * sets the client context - * you have to make sure the old context - * is de-allocated - * - * @param context new context to use - */ - virtual void - setContext (ContextP context) = 0; - - /** - * get a real instance. Result must cleaned with delete. - * \param context The context to use - * \param subtype the wanted implementation - this moment only 0 allowed. - * \return an instance of client or 0L if error. - */ - static Client*getobject(ContextP context,int subtype=0); - - /** - * Enumerates all files/dirs at a given path. - * - * Throws an exception if an error occurs - * - * @param path Path to explore. - * @param descend Recurse into subdirectories if existant. - * @param get_all Return all entries, not just the interesting ones. - * @param update Query the repository for updates. - * @param no_ignore Disregard default and svn:ignore property ignores. - * @param hide_externals don't recurse into external definitions - * @param revision list specific revision when browsing remote, on working copies parameter will ignored - * @param detailed_remote if on remote listing detailed item info should get if possible - * that may slow so should configureable in frontends! - * @return vector with Status entries. - */ - virtual StatusEntries - status (const Path& path, - Depth depth=DepthImmediates, - bool get_all = true, - bool update = false, - bool no_ignore = false, - const Revision revision = svn::Revision::HEAD, - bool detailed_remote = false, - bool hide_externals = false, - const StringArray & changelists=StringArray() ) throw (ClientException) = 0; - - /** - * Returns the status of a single file in the path. - * - * Throws an exception if an error occurs - * - * @param path File to gather status. - * @param update if check against repository if new updates are there (for WC only) - * @param revision list specific revision when browsing remote, on working copies parameter will ignored - * @return a Status with Statis.isVersioned = FALSE - */ - virtual StatusPtr - singleStatus (const Path& path,bool update=false,const Revision revision = svn::Revision::HEAD) throw (ClientException)=0; - - /** - * Executes a revision checkout. - * @param moduleName name of the module to checkout. - * @param destPath destination directory for checkout. - * @param revision the revision number to checkout. If the number is -1 - * then it will checkout the latest revision. - * @param peg Revision to look up - * @param recurse whether you want it to checkout files recursively. - * @param ignore_externals if true don't process externals definitions. - * @exception ClientException - */ - virtual svn_revnum_t - checkout (const Path& moduleName, const Path & destPath, - const Revision & revision, - const Revision & peg = Revision::UNDEFINED, - svn::Depth depth=DepthInfinity, - bool ignore_externals=false, - bool overwrite=false - ) throw (ClientException) = 0; - - /** - * relocate wc @a from to @a to - * @exception ClientException - */ - virtual void - relocate (const Path & path, const TQString &from_url, - const TQString &to_url, bool recurse) throw (ClientException)=0; - - /** - * Sets a single file for deletion. - * @exception ClientException - */ - virtual svn::Revision - remove (const Path & path, bool force, - bool keep_local = true, - const PropertiesMap&revProps = PropertiesMap()) throw (ClientException)=0; - - /** - * Sets files for deletion. - * - * @param targets targets to delete - * @param force force if files are locally modified - * @exception ClientException - */ - virtual svn::Revision - remove (const Targets & targets, - bool force, - bool keep_local=true, - const PropertiesMap&revProps=PropertiesMap()) throw (ClientException) = 0; - - /** - * Reverts a couple of files to a pristiner state. - * @exception ClientException - */ - virtual void - revert (const Targets & targets, - Depth depth, - const StringArray&changelist=StringArray() - ) throw (ClientException)=0; - - - /** - * Adds a file to the repository. - * @param path the path to add - * @param depth if @a path is a folder add items recursive depending on value if it. - * @param force if true, do not error on already-versioned items. - * @param no_ignore if false don't add files or directories that match ignore patterns. When build against svn 1.2 always false - * @param add_parents if true, go up to the next versioned folder and add all between path and this folder. - * @exception ClientException - */ - virtual void - add (const Path & path, svn::Depth depth,bool force=false, bool no_ignore=false, bool add_parents = true) throw (ClientException)=0; - - /** - * Updates the file or directory. - * @param path targets. - * @param revision the revision number to checkout. - * Revision::HEAD will checkout the - * latest revision. - * @param depth Depthness for operation - * @param ignore_externals ignore externals - * @param allow_unversioned will operation not fail if there are unversioned items in tree with same name. - * @exception ClientException - */ - virtual Revisions - update (const Targets & path, const Revision & revision, - Depth depth,bool ignore_externals,bool allow_unversioned, - bool sticky_depth) throw (ClientException) = 0; - - /** - * Retrieves the contents for a specific @a revision of - * a @a path at @a peg_revision - * - * @param path path of file or directory - * @param peg_revision revision to base the URL - * @param revision revision to retrieve - * @return contents of the file - */ - virtual TQByteArray - cat (const Path & path, - const Revision & revision, - const Revision & peg_revision=svn_opt_revision_unspecified) throw (ClientException)=0; - /** - * Retrieves the contents for a specific @a revision of - * a @a path at @a peg_revision - * - * @param buffer Stream to store content direct - * @param path path of file or directory - * @param peg_revision revision to base the URL - * @param revision revision to retrieve - * @exception ClientException - */ - virtual void - cat(svn::stream::SvnStream&buffer, - const Path & path, - const Revision & revision, - const Revision & peg_revision) throw (ClientException)=0; - /** - * Retrieves the contents for a specific @a revision of - * a @a path at @a peg_revision - * - * @param path path of file or directory - * @param target new (local) name - * @param peg_revision revision to base the URL - * @param revision revision to retrieve - * @param peg_revision Revision to look at - */ - virtual void - get (const Path & path, - const TQString & target, - const Revision & revision, - const Revision & peg_revision=svn_opt_revision_unspecified) throw (ClientException)=0; - - /** - * Retrieves the contents for a specific @a revision of - * a @a path and stores the result in @a target - * - * @param target the container where to store the result - * @param path path of file or directory - * @param revisionStart revision to retrieve - * @param revisionEnd revision to retrieve - * @param peg indicates in which revision path is valid - */ - virtual void - annotate (AnnotatedFile&target, - const Path & path, - const Revision & revisionStart, - const Revision & revisionEnd, - const Revision & peg = Revision::UNDEFINED, - const DiffOptions&diffoptions = DiffOptions(), - bool ignore_mimetypes = false, - bool include_merged_revisions = false - ) throw (ClientException)=0; - - /** - * Commits changes to the repository. This usually requires - * authentication, see Auth. - * @return Returns revision transferred or svn::Revision::UNDEFINED if the revision number is invalid. - * @param targets files to commit. - * @param message log message. - * @param depth whether the operation should be done recursively. - * @param keep_locks if false unlock items in paths - * @param changelist - * @param keep_changelist - * @exception ClientException - */ - virtual svn::Revision - commit (const Targets & targets, - const TQString& message, - svn::Depth depth,bool keep_locks=true, - const svn::StringArray&contents=svn::StringArray(), - const PropertiesMap&revProps=PropertiesMap(), - bool keep_changelist=false - ) throw (ClientException)=0; - - /** - * Copies a versioned file with the history preserved. - * @exception ClientException - */ - virtual svn::Revision - copy (const Path & srcPath, - const Revision & srcRevision, - const Path & destPath) throw (ClientException)=0; - /** - * Copies a versioned file with the history preserved. - * @since subversion 1.5 api - * @see svn_client_copy4 - * @exception ClientException - */ - virtual svn::Revision - copy (const Targets & srcPath, - const Revision & srcRevision, - const Revision & pegRevision, - const Path & destPath, - bool asChild=false,bool makeParent=false,const PropertiesMap&revProps=PropertiesMap()) throw (ClientException)=0; - - /** - * Moves or renames a file. - * @exception ClientException - */ - virtual svn::Revision - move (const Path & srcPath, - const Path & destPath, - bool force) throw (ClientException)=0; - /** - * Moves or renames a file. - * @exception ClientException - */ - virtual svn::Revision - move (const Targets & srcPath, - const Path & destPath, - bool force,bool asChild,bool makeParent,const PropertiesMap&revProps=PropertiesMap()) throw (ClientException)=0; - - /** - * Creates a directory directly in a repository or creates a - * directory on disk and schedules it for addition. If path - * is a URL then authentication is usually required, see Auth and - * the callback asks for a logmessage. With subversion 1.4 the target - * must not exist (\sa svn_client_move4) - * - * @param path - * @param message log message. if it is TQString() asks when working on repository - * @param makeParent create parent folders if not existant (only when build with svn 1.5 or above) - * @exception ClientException - */ - virtual svn::Revision - mkdir (const Path & path, - const TQString& message, - bool makeParent=true, - const PropertiesMap&revProps=PropertiesMap() - ) throw (ClientException)=0; - /** - * Creates a directory directly in a repository or creates a - * directory on disk and schedules it for addition. If path - * is a URL then authentication is usually required, see Auth and - * the callback asks for a logmessage. - * - * @param targets encoded pathes to create - * @param message log message. if it is TQString() asks when working on repository - * @param makeParent create parent folders if not existant (only when build with svn 1.5 or above) - * @exception ClientException - */ - virtual svn::Revision - mkdir (const Targets & targets, - const TQString& message, - bool makeParent=true, - const PropertiesMap&revProps=PropertiesMap() - ) throw (ClientException)=0; - - /** - * Recursively cleans up a local directory, finishing any - * incomplete operations, removing lockfiles, etc. - * @param path a local directory. - * @exception ClientException - */ - virtual void - cleanup (const Path & path) throw (ClientException)=0; - - /** - * Removes the 'conflicted' state on a file. - * @exception ClientException - */ - virtual void resolve (const Path & path,Depth depth,const ConflictResult&resolution=ConflictResult()) throw (ClientException)=0; - - /** - * Exports the contents of either a subversion repository into a - * 'clean' directory (meaning a directory with no administrative - * directories). - * @exception ClientException - * @param srcPath source path - * @param destPath a destination path that must not already exist. - * @param revision revision to use for the export - * @param peg the revision where the path is first looked up when exporting from a repository. - * @param overwrite overwrite existing files - * @param native_eol Either "LF", "CR" or "CRLF" or NULL. - * @param ignore_externals don't process externals definitions as part of this operation. - * @param recurse if true, export recursively.
- Otherwise, export just the directory represented by from and its immediate non-directory children. - */ - virtual svn_revnum_t - doExport (const Path & srcPath, - const Path & destPath, - const Revision & revision, - const Revision & peg = Revision::UNDEFINED, - bool overwrite=false, - const TQString&native_eol=TQString(), - bool ignore_externals = false, - svn::Depth depth=svn::DepthInfinity - ) throw (ClientException)=0; - - /** - * Update local copy to mirror a new url. This excapsulates the - * svn_client_switch() client method. - * @exception ClientException - */ - virtual svn_revnum_t - doSwitch ( - const Path & path, const TQString& url, - const Revision & revision, - Depth depth, - const Revision & peg=Revision::UNDEFINED, - bool sticky_depth = true, - bool ignore_externals=false, - bool allow_unversioned=false - ) throw (ClientException)=0; - - /** - * Import file or directory PATH into repository directory URL at - * head. This usually requires authentication, see Auth. - * @param path path to import - * @param url - * @param message log message. - * @param depth kind of recurse operation - * @param no_ignore if false, don't add items matching global ignore pattern (@since subversion 1.3) - * @param no_unknown_nodetype if true ignore files type not known like pipes or device files (@since subversion 1.5) - * @exception ClientException - */ - virtual svn::Revision - import (const Path & path, const TQString& url, - const TQString& message, - svn::Depth depth, - bool no_ignore,bool no_unknown_nodetype, - const PropertiesMap&revProps=PropertiesMap()) throw (ClientException)=0; - - /** - * Merge changes from two paths into a new local path. - * @exception ClientException - */ - virtual void - merge (const Path & path1, const Revision & revision1, - const Path & path2, const Revision & revision2, - const Path & localPath, bool force, - Depth depth, - bool notice_ancestry=false, - bool dry_run=false, - bool record_only=false, - const StringArray&merge_options=StringArray() - ) throw (ClientException)=0; - - virtual void - merge_peg(const Path&src, - const RevisionRanges&ranges, - const Revision&peg, - const Path&targetWc, - Depth depth, - bool notice_ancestry=false, - bool dry_run=false, - bool force=false, - bool record_only=false, - const StringArray&merge_options=StringArray() - ) throw (ClientException)=0; - - virtual void - merge_peg(const Path&src, - const RevisionRange&range, - const Revision&peg, - const Path&targetWc, - Depth depth, - bool notice_ancestry=false, - bool dry_run=false, - bool force=false, - const StringArray&merge_options=StringArray() - ) throw (ClientException)=0; - - /** - * Retrieve information for the given path - * remote or local. - * - * @param path path for info - * @param rec recursive (if dir) - * @param rev for which revision - * @param peg_revision peg revision - * @return InfoEntries - */ - virtual InfoEntries - info (const Path &path, - Depth depth, - const Revision & rev, - const Revision & peg_revision=svn_opt_revision_unspecified, - const StringArray&changelists=StringArray() - ) throw (ClientException)=0; - - /** - * Retrieve log information for the given path - * Loads the log messages result set. The first - * entry is the youngest revision. - * - * You can use the constants Revision::START and - * Revision::HEAD - * - * @param path - * @param revisionStart - * @param revisionEnd - * @param discoverChangedPaths - * @param strictNodeHistory - * @param limit the maximum log entries count. - * @return a vector with log entries - */ - virtual LogEntriesPtr - log (const Path& path, - const Revision & revisionStart, - const Revision & revisionEnd, - const Revision & revisionPeg, - bool discoverChangedPaths=false, - bool strictNodeHistory=true,int limit = 0, - bool include_merged_revisions = false, - const StringArray&revprops=StringArray() - ) throw (ClientException)=0; - - /** - * Retrieve log information for the given path - * Loads the log messages result set. Result will stored - * in a map where the key is the revision number - * - * You can use the constants Revision::START and - * Revision::HEAD - * - * @param path Path to make a log for - * @param revisionStart - * @param revisionEnd - * @param target the logmap where to store the entries - * @param discoverChangedPaths - * @param strictNodeHistory - * @param limit (ignored when subversion 1.1 API) - * @return true if success - */ - virtual bool - log (const Path& path, const Revision & revisionStart, - const Revision & revisionEnd, - LogEntriesMap&target, - const Revision & revisionPeg=Revision::UNDEFINED, - bool discoverChangedPaths=false, - bool strictNodeHistory=true,int limit = 0, - bool include_merged_revisions = false, - const StringArray&revprops=StringArray() - ) throw (ClientException)=0; - - /** - * Produce diff output which describes the delta between - * @a path/@a revision1 and @a path/@a revision2. @a path - * can be either a working-copy path or a URL. - * - * A ClientException will be thrown if either @a revision1 or - * @a revision2 has an `unspecified' or unrecognized `kind'. - * - * @param tmpPath prefix for a temporary directory needed by diff. - * Filenames will have ".tmp" and similar added to this prefix in - * order to ensure uniqueness. - * @param path path of the file. - * @param revision1 one of the revisions to check. - * @param revision2 the other revision. - * @param recurse whether the operation should be done recursively. - * @param ignoreAncestry whether the files will be checked for - * relatedness. - * @param noDiffDeleted if true, no diff output will be generated on deleted files. - * @param ignore_contenttype if true generate diff even the items are marked as binaries - * @param extra extra options for diff ("-b", "-w","--ignore-eol-style") - * @return delta between the files - * @exception ClientException - */ - virtual TQByteArray - diff_peg(const Path & tmpPath, const Path & path,const Path&relativeTo, - const Revision & revision1, const Revision & revision2, const Revision& peg_revision, - Depth depth, bool ignoreAncestry, - bool noDiffDeleted,bool ignore_contenttype, - const StringArray&extra, - const StringArray&changelists - ) throw (ClientException)=0; - - /** - * Same as other diff but extra options always set to empty list. - */ - virtual TQByteArray - diff_peg (const Path & tmpPath, const Path & path,const Path&relativeTo, - const Revision & revision1, const Revision & revision2, const Revision& peg_revision, - Depth depth, bool ignoreAncestry, - bool noDiffDeleted,bool ignore_contenttype) throw (ClientException)=0; - - /** - * Produce diff output which describes the delta between - * @a path1/@a revision1 and @a path2/@a revision2. @a path2 - * can be either a working-copy path or a URL. - * - * A ClientException will be thrown if either @a revision1 or - * @a revision2 has an `unspecified' or unrecognized `kind'. - * - * @param tmpPath prefix for a temporary directory needed by diff. - * Filenames will have ".tmp" and similar added to this prefix in - * order to ensure uniqueness. - * @param path1 first file or folder to diff. - * @param path2 second file or folder to diff. - * @param revision1 one of the revisions to check (path1). - * @param revision2 the other revision (path2). - * @param recurse whether the operation should be done recursively. - * @param ignoreAncestry whether the files will be checked for - * relatedness. - * @param noDiffDeleted if true, no diff output will be generated on deleted files. - * @param ignore_contenttype if true generate diff even the items are marked as binaries - * @param extra extra options for diff ("-b", "-w","--ignore-eol-style") - * @return delta between the files - * @exception ClientException - */ - virtual TQByteArray - diff (const Path & tmpPath, const Path & path1,const Path & path2,const Path&relativeTo, - const Revision & revision1, const Revision & revision2, - Depth depth, bool ignoreAncestry, - bool noDiffDeleted,bool ignore_contenttype, - const StringArray&extra, - const StringArray&changelists - ) throw (ClientException)=0; - - /** - * Same as other diff but extra options and changelists always set to empty list. - */ - virtual TQByteArray - diff (const Path & tmpPath, const Path & path1,const Path & path2,const Path&relativeTo, - const Revision & revision1, const Revision & revision2, - Depth depth, bool ignoreAncestry, - bool noDiffDeleted,bool ignore_contenttype) throw (ClientException)=0; - - /** - * lists entries in @a pathOrUrl no matter whether local or - * repository - * - * If checking for locks is activated, it lists the locks inside repository, not locks inside - * working copy! - * @param pathOrUrl - * @param revision - * @param peg at wich revision path exists - * @param depth @sa depth - * @param retrieve_locks check for REPOSITORY locks while listing. - * @return a vector of directory entries, each with - * a relative path (only filename). In subversion >= 1.4 an entry without a name is returned, too. This - * is the searched directory (done in subversion itself) - */ - virtual DirEntries - list (const Path& pathOrUrl, - const Revision& revision, - const Revision& peg, - svn::Depth depth,bool retrieve_locks) throw (ClientException)=0; - - /** - * lists properties in @a path no matter whether local or - * repository - * - * @param path - * @param revision - * @param peg most case should set to @a revision - * @param recurse - * @return PropertiesList - */ - virtual PathPropertiesMapListPtr - proplist(const Path &path, - const Revision &revision, - const Revision &peg, - Depth depth=DepthEmpty, - const StringArray&changelists=StringArray() - )=0; - - /** - * lists one property in @a path no matter whether local or - * repository - * - * @param propName - * @param path - * @param revision - * @param peg most case should set to @a revision - * @param recurse - * @return PathPropertiesMapList and revision where the properties are taken from (svn 1.5) or undefined revision (prior 1.5) - */ - virtual TQPair - propget(const TQString& propName, - const Path &path, - const Revision &revision, - const Revision &peg, - Depth depth = svn::DepthEmpty, - const StringArray&changelists=StringArray()) = 0; - - /** - * set property in @a path no matter whether local or - * repository - * - * @param path - * @param revision - * @param propName - * @param propValue - * @param recurse - * @param skip_checks if true skip validity checks - * @return PropertiesList - */ - virtual void - propset(const TQString& propName, - const TQString& propValue, - const Path &path, - Depth depth=DepthEmpty, - bool skip_checks=false, - const Revision&base_revision=Revision::UNDEFINED, - const StringArray&changelists=StringArray(), - const PropertiesMap&revProps=PropertiesMap() - ) = 0; - - /** - * delete property in @a path no matter whether local or - * repository - * - * @param propName - * @param path - * @param revision - * @param recurse - */ - virtual void - propdel(const TQString& propName, - const Path &path, - Depth depth=DepthEmpty, - bool skip_check=false, - const Revision&base_revision=Revision::UNDEFINED, - const StringArray&changelists=StringArray())=0; - - - /** - * lists revision properties in @a path no matter whether local or - * repository - * - * @param path - * @param revision - * @return PropertiesList - */ - virtual TQPair - revproplist(const Path &path, - const Revision &revision)=0; - - /** - * lists one revision property in @a path no matter whether local or - * repository - * - * @param propName - * @param path - * @param revision - * @return PropertiesList - */ - virtual TQPair - revpropget(const TQString& propName, - const Path &path, - const Revision &revision)=0; - - /** - * set revision property in @a path no matter whether local or - * repository - * - * @param propName - * @param propValue - * @param path - * @param revision - * @param force - * @return Revision - */ - virtual TQLONG - revpropset(const TQString& propName, - const TQString& propValue, - const Path &path, - const Revision &revision, - bool force=false)=0; - - /** - * delete revision property in @a path no matter whether local or - * repository - * - * @param propName - * @param path - * @param revision - * @param force - * @return Revision - */ - virtual TQLONG - revpropdel(const TQString& propName, - const Path &path, - const Revision &revision, - bool force=false) = 0; - - /** - * lock files in repository or working copy - * @param targets items to be locked - * @param message if non null stored with each lock in repository - * @param steal_lock if true locks in wc will stolen. - * @since subversion 1.2 - */ - virtual void - lock (const Targets & targets, - const TQString& message, - bool steal_lock) throw (ClientException)=0; - /** - * unlock files in repository or working copy - * @param targets items to unlock - * @param break_lock ignore any errors - */ - virtual void - unlock (const Targets&targets, - bool break_lock) throw (ClientException)=0; - - virtual void - url2Revision(const TQString&revstring, - Revision&start,Revision&end)=0; - virtual void - url2Revision(const TQString&revstring, - Revision&start)=0; - - private: - /** - * disallow assignment operator - */ - Client & operator= (const Client &); - /** - * disallow copy constructor - */ - Client (const Client &); - }; - -} - -#endif diff --git a/src/svnqt/client_annotate.cpp b/src/svnqt/client_annotate.cpp index 94e5d71..2930298 100644 --- a/src/svnqt/client_annotate.cpp +++ b/src/svnqt/client_annotate.cpp @@ -31,8 +31,8 @@ #pragma warning( disable: 4786 )// debug symbol truncated #endif // svncpp -#include "svnqt/client_impl.hpp" -#include "svnqt/svnqt_defines.hpp" +#include "svnqt/client_impl.h" +#include "svnqt/svnqt_defines.h" // Subversion api #include "svn_client.h" diff --git a/src/svnqt/client_cat.cpp b/src/svnqt/client_cat.cpp index c32ff31..5200917 100644 --- a/src/svnqt/client_cat.cpp +++ b/src/svnqt/client_cat.cpp @@ -31,18 +31,18 @@ #pragma warning( disable: 4786 )// debug symbol truncated #endif // svncpp -#include "client_impl.hpp" +#include "client_impl.h" // Subversion api #include "svn_client.h" //#include "svn_io.h" -#include "svnqt/exception.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/status.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/svnstream.hpp" -#include "svnqt/svnfilestream.hpp" +#include "svnqt/exception.h" +#include "svnqt/pool.h" +#include "svnqt/status.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/svnstream.h" +#include "svnqt/svnfilestream.h" namespace svn { diff --git a/src/svnqt/client_diff.cpp b/src/svnqt/client_diff.cpp index edcad8b..1a3a6ee 100644 --- a/src/svnqt/client_diff.cpp +++ b/src/svnqt/client_diff.cpp @@ -31,18 +31,18 @@ #pragma warning( disable: 4786 )// debug symbol truncated #endif // svncpp -#include "svnqt/client_impl.hpp" +#include "svnqt/client_impl.h" // Subversion api #include "svn_client.h" #include "svn_path.h" -#include "svnqt/exception.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/status.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/helper.hpp" -#include "diff_data.hpp" +#include "svnqt/exception.h" +#include "svnqt/pool.h" +#include "svnqt/status.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/helper.h" +#include "diff_data.h" #include #include diff --git a/src/svnqt/client_impl.cpp b/src/svnqt/client_impl.cpp index de40c69..8cdb47a 100644 --- a/src/svnqt/client_impl.cpp +++ b/src/svnqt/client_impl.cpp @@ -32,9 +32,9 @@ #endif // svncpp -#include "svnqt/client_impl.hpp" +#include "svnqt/client_impl.h" #include "svn_opt.h" -#include "svnqt/svnqt_defines.hpp" +#include "svnqt/svnqt_defines.h" #include #include diff --git a/src/svnqt/client_impl.h b/src/svnqt/client_impl.h new file mode 100644 index 0000000..bf01d98 --- /dev/null +++ b/src/svnqt/client_impl.h @@ -0,0 +1,895 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_CLIENT_IMPL_H_ +#define _SVNCPP_CLIENT_IMPL_H_ + +#include "svn_sorts.h" +#include + +#include "svnqt/client.h" +#include "svnqt/svnqt_defines.h" + +// Ignore MSVC 6 compiler warning: debug symbol truncated +#if defined (_MSC_VER) && _MSC_VER <= 1200 +#pragma warning (disable: 4786) +#endif + +// Ignore MSVC 7, 2005 & 2008 compiler warning: C++ exception specification +#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1550 +#pragma warning (disable: 4290) +#endif + +class TQStringList; + +#if (SVN_VER_MAJOR == 1 && SVN_VER_MINOR <= 8) +typedef svn_sort__item_t svn_sort_item_type; +#else +// Taken from subversion 1.8.10 source code and modified where needed + +// Same as svn_sort__item_t +typedef struct svn_sort_item_type { + const void *key; // pointer to the key + apr_ssize_t klen; // size of the key + void *value; // pointer to the value +} svn_sort_item_type; + +apr_array_header_t* svn_sort__hash(apr_hash_t *ht, + int (*comparison_func)(const svn_sort__item_t*, const svn_sort__item_t*), apr_pool_t *pool); +#endif + +namespace svn +{ + namespace stream { + class SvnStream; + } + + /** + * Subversion client API. + */ + class SVNTQT_NOEXPORT Client_impl:public Client + { + public: + /** + * Initializes the primary memory pool. + */ + Client_impl(ContextP context); + + virtual ~Client_impl(); + + /** + * @return returns the Client context + */ + virtual const ContextP + getContext () const; + + /** + * sets the client context + * you have to make sure the old context + * is de-allocated + * + * @param context new context to use + */ + virtual void + setContext (ContextP context); + + + /** + * Enumerates all files/dirs at a given path. + * + * Throws an exception if an error occurs + * + * @param path Path to explore. + * @param descend Recurse into subdirectories if existant. + * @param get_all Return all entries, not just the interesting ones. + * @param update Query the repository for updates. + * @param no_ignore Disregard default and svn:ignore property ignores. + * @param hide_externals don't recurse into external definitions + * @param revision list specific revision when browsing remote, on working copies parameter will ignored + * @param detailed_remote if on remote listing detailed item info should get if possible + * that may slow so should configureable in frontends! + * @return vector with Status entries. + */ + virtual StatusEntries + status (const Path& path, + Depth depth=DepthEmpty, + bool get_all = true, + bool update = false, + bool no_ignore = false, + const Revision revision = svn::Revision::HEAD, + bool detailed_remote = false, + bool hide_externals = false, + const StringArray & changelists=StringArray()) throw (ClientException); + + /** + * Returns the status of a single file in the path. + * + * Throws an exception if an error occurs + * + * @param path File to gather status. + * @param update if check against repository if new updates are there (for WC only) + * @param revision list specific revision when browsing remote, on working copies parameter will ignored + * @return a Status with Statis.isVersioned = FALSE + */ + virtual StatusPtr + singleStatus (const Path& path,bool update=false,const Revision revision = svn::Revision::HEAD) throw (ClientException); + + /** + * Executes a revision checkout. + * @param moduleName name of the module to checkout. + * @param destPath destination directory for checkout. + * @param revision the revision number to checkout. If the number is -1 + * then it will checkout the latest revision. + * @param peg Revision to look up + * @param recurse whether you want it to checkout files recursively. + * @param ignore_externals if true don't process externals definitions. + * @exception ClientException + */ + virtual svn_revnum_t + checkout (const Path& moduleName, const Path & destPath, + const Revision & revision, + const Revision & peg = Revision::UNDEFINED, + svn::Depth depth=DepthInfinity, + bool ignore_externals=false, + bool overwrite=false + ) throw (ClientException); + + /** + * relocate wc @a from to @a to + * @exception ClientException + */ + virtual void + relocate (const Path & path, const TQString &from_url, + const TQString &to_url, bool recurse) throw (ClientException); + + /** + * Sets a single file for deletion. + * @exception ClientException + */ + virtual svn::Revision + remove (const Path & path, bool force, + bool keep_local = true, + const PropertiesMap&revProps = PropertiesMap()) throw (ClientException); + + /** + * Sets files for deletion. + * + * @param targets targets to delete + * @param force force if files are locally modified + * @exception ClientException + */ + virtual svn::Revision + remove (const Targets & targets, + bool force, + bool keep_local = true, + const PropertiesMap&revProps = PropertiesMap()) throw (ClientException); + + /** + * Reverts a couple of files to a pristiner state. + * @exception ClientException + */ + virtual void + revert (const Targets & targets, + Depth depth, + const StringArray&changelist=StringArray() + ) throw (ClientException); + + + /** + * Adds a file to the repository. + * @param path the path to add + * @param depth if @a path is a folder add items recursive depending on value if it. Pre-subversion 1.5 DepthInfinity is mapped to recursive, all other to not-recursive. + * @param force if true, do not error on already-versioned items. + * @param no_ignore if false don't add files or directories that match ignore patterns. + * @param add_parents if true, go up to the next versioned folder and add all between path and this folder. Used only with subversion 1.5 or newer + * @exception ClientException + * @sa svn::Depth + */ + virtual void add (const Path & path, svn::Depth depth,bool force=false, bool no_ignore=false, bool add_parents = true) throw (ClientException); + + /** + * Updates the file or directory. + * @param path targets. + * @param revision the revision number to checkout. + * Revision::HEAD will checkout the + * latest revision. + * @param depth Depthness for operation + * @param ignore_externals ignore externals + * @param allow_unversioned will operation not fail if there are unversioned items in tree with same name. + * @exception ClientException + */ + virtual Revisions + update (const Targets & path, const Revision & revision, + Depth depth,bool ignore_externals,bool allow_unversioned, + bool sticky_depth) throw (ClientException); + + /** + * Retrieves the contents for a specific @a revision of + * a @a path at @a peg_revision + * + * @param path path of file or directory + * @param peg_revision revision to base the URL + * @param revision revision to retrieve + * @param peg_revision Revision to look at + * @return contents of the file + */ + virtual TQByteArray + cat (const Path & path, + const Revision & revision, + const Revision & peg_revision=svn_opt_revision_unspecified) throw (ClientException); + /** + * Retrieves the contents for a specific @a revision of + * a @a path at @a peg_revision + * + * @param buffer Stream to store content direct + * @param path path of file or directory + * @param peg_revision revision to base the URL + * @param revision revision to retrieve + * @exception ClientException + */ + virtual void + cat(svn::stream::SvnStream&buffer, + const Path & path, + const Revision & revision, + const Revision & peg_revision) throw (ClientException); + + /** + * Retrieves the contents for a specific @a revision of + * a @a path at @a peg_revision + * + * @param path path of file or directory + * @param target new (local) name + * @param peg_revision revision to base the URL + * @param revision revision to retrieve + * @param peg_revision Revision to look at + */ + virtual void + get (const Path & path, + const TQString & target, + const Revision & revision, + const Revision & peg_revision=svn_opt_revision_unspecified) throw (ClientException); + + /** + * Retrieves the contents for a specific @a revision of + * a @a path and stores the result in @a target + * + * @param target the container where to store the result + * @param path path of file or directory + * @param revisionStart revision to retrieve + * @param revisionEnd revision to retrieve + * @param peg indicates in which revision path is valid + */ + virtual void + annotate (AnnotatedFile&target, + const Path & path, + const Revision & revisionStart, + const Revision & revisionEnd, + const Revision & peg = Revision::UNDEFINED, + const DiffOptions&diffoptions = DiffOptions(), + bool ignore_mimetypes = false, + bool include_merged_revisions = false + ) throw (ClientException); + + /** + * Commits changes to the repository. This usually requires + * authentication, see Auth. + * @return Returns revision transferred or svn::Revision::UNDEFINED if the revision number is invalid. + * @param targets files to commit. + * @param message log message. + * @param depth whether the operation should be done recursively. + * @param keep_locks if false unlock items in paths + * @param changelist + * @param keep_changelist + * @exception ClientException + */ + virtual svn::Revision + commit (const Targets & targets, + const TQString& message, + svn::Depth depth,bool keep_locks=true, + const svn::StringArray&changelist=svn::StringArray(), + const PropertiesMap&revProps=PropertiesMap(), + bool keep_changelist=false + ) throw (ClientException); + + /** + * Copies a versioned file with the history preserved. + * @exception ClientException + */ + virtual svn::Revision + copy (const Path & srcPath, + const Revision & srcRevision, + const Path & destPath) throw (ClientException); + /** + * Copies a versioned file with the history preserved. + * @since subversion 1.5 api + * @see svn_client_copy4 + * @exception ClientException + */ + virtual svn::Revision + copy (const Targets & srcPath, + const Revision & srcRevision, + const Revision & pegRevision, + const Path & destPath, + bool asChild=false,bool makeParent=false,const PropertiesMap&revProps=PropertiesMap()) throw (ClientException); + + /** + * Moves or renames a file. + * @exception ClientException + */ + virtual svn::Revision + move (const Path & srcPath, + const Path & destPath, + bool force) throw (ClientException); + + /** + * Moves or renames a file. + * @exception ClientException + */ + virtual svn::Revision + move (const Targets & srcPath, + const Path & destPath, + bool force,bool asChild,bool makeParent,const PropertiesMap&revProps=PropertiesMap()) throw (ClientException); + + /** + * Creates a directory directly in a repository or creates a + * directory on disk and schedules it for addition. If path + * is a URL then authentication is usually required, see Auth and + * the callback asks for a logmessage. + * + * @param path + * @param message log message. if it is TQString() asks when working on repository + * @exception ClientException + */ + virtual svn::Revision + mkdir (const Path & path, + const TQString& message, + bool makeParent=true, + const PropertiesMap&revProps=PropertiesMap() + ) throw (ClientException); + /** + * Creates a directory directly in a repository or creates a + * directory on disk and schedules it for addition. If path + * is a URL then authentication is usually required, see Auth and + * the callback asks for a logmessage. + * + * @param targets encoded pathes to create + * @param message log message. if it is TQString() asks when working on repository + * @exception ClientException + */ + virtual svn::Revision + mkdir (const Targets & targets, + const TQString& message, + bool makeParent=true, + const PropertiesMap&revProps=PropertiesMap() + ) throw (ClientException); + + /** + * Recursively cleans up a local directory, finishing any + * incomplete operations, removing lockfiles, etc. + * @param path a local directory. + * @exception ClientException + */ + virtual void + cleanup (const Path & path) throw (ClientException); + + /** + * Removes the 'conflicted' state on a file. + * @exception ClientException + */ + virtual void resolve (const Path & path,Depth depth,const ConflictResult&resolution=ConflictResult()) throw (ClientException); + + /** + * Exports the contents of either a subversion repository into a + * 'clean' directory (meaning a directory with no administrative + * directories). + * @exception ClientException + * @param srcPath source path + * @param destPath a destination path that must not already exist. + * @param revision revision to use for the export + * @param peg the revision where the path is first looked up when exporting from a repository. + * @param overwrite overwrite existing files + * @param native_eol Either "LF", "CR" or "CRLF" or NULL. + * @param ignore_externals don't process externals definitions as part of this operation. + * @param recurse if true, export recursively. Otherwise, export just the directory represented by from and its immediate non-directory children. + */ + virtual svn_revnum_t + doExport (const Path & srcPath, + const Path & destPath, + const Revision & revision, + const Revision & peg = Revision::UNDEFINED, + bool overwrite=false, + const TQString&native_eol=TQString(), + bool ignore_externals = false, + svn::Depth depth=svn::DepthInfinity + ) throw (ClientException); + + /** + * Update local copy to mirror a new url. This excapsulates the + * svn_client_switch() client method. + * @exception ClientException + */ + virtual svn_revnum_t + doSwitch ( + const Path & path, const TQString& url, + const Revision & revision, + Depth depth, + const Revision & peg=Revision::UNDEFINED, + bool sticky_depth = true, + bool ignore_externals=false, + bool allow_unversioned=false + ) throw (ClientException); + + /** + * Import file or directory PATH into repository directory URL at + * head. This usually requires authentication, see Auth. + * @param path path to import + * @param url + * @param message log message. + * @param depth kind of recurse operation + * @param no_ignore if false, don't add items matching global ignore pattern + * @param no_unknown_nodetype if true ignore files type not known like pipes or device files + * @exception ClientException + */ + virtual svn::Revision + import (const Path & path, const TQString& url, + const TQString& message, + svn::Depth depth, + bool no_ignore,bool no_unknown_nodetype, + const PropertiesMap&revProps=PropertiesMap()) throw (ClientException); + + /** + * Merge changes from two paths into a new local path. + * @exception ClientException + */ + virtual void + merge (const Path & path1, const Revision & revision1, + const Path & path2, const Revision & revision2, + const Path & localPath, bool force, + Depth depth, + bool notice_ancestry=false, + bool dry_run=false, + bool record_only=false, + const StringArray&merge_options=StringArray() + ) throw (ClientException); + + virtual void + merge_peg(const Path&src, + const RevisionRanges&ranges, + const Revision&peg, + const Path&targetWc, + Depth depth, + bool notice_ancestry=false, + bool dry_run=false, + bool force=false, + bool record_only=false, + const StringArray&merge_options=StringArray() + ) throw (ClientException); + + virtual void + merge_peg(const Path&src, + const RevisionRange&range, + const Revision&peg, + const Path&targetWc, + Depth depth, + bool notice_ancestry, + bool dry_run, + bool force, + const StringArray&merge_options + ) throw (ClientException); + + /** + * Retrieve information for the given path + * remote or local. Only gives with subversion 1.2 + * usefull results + * + * @param path path for info + * @param rec recursive (if dir) + * @param rev for which revision + * @param peg_revision peg revision + * @return InfoEntries + * @since subversion 1.2 + */ + virtual InfoEntries + info(const Path &path, + Depth depth, + const Revision & rev, + const Revision & peg_revision=svn_opt_revision_unspecified, + const StringArray&changelists=StringArray() + ) throw (ClientException); + /** + * Retrieve log information for the given path + * Loads the log messages result set. The first + * entry is the youngest revision. + * + * You can use the constants Revision::START and + * Revision::HEAD + * + * @param path + * @param revisionStart Start revision. + * @param revisionEnd End revision + * @param revisionPeg Revision where path is valid. + * @param discoverChangedPaths Should changed pathes transferred + * @param strictNodeHistory + * @param limit the maximum log entries count. + * @param include_merged_revisions log information for revisions which have been merged to targets will also be returned. (subversion 1.5) + * @return a vector with log entries + */ + virtual LogEntriesPtr + log (const Path& path, const Revision & revisionStart, + const Revision & revisionEnd, + const Revision & revisionPeg, + bool discoverChangedPaths=false, + bool strictNodeHistory=true,int limit=0, + bool include_merged_revisions = false, + const StringArray&revprops=StringArray() + ) throw (ClientException); + /** + * Retrieve log information for the given path + * Loads the log messages result set. Result will stored + * in a map where the key is the revision number + * + * You can use the constants Revision::START and + * Revision::HEAD + * + * @param path + * @param revisionStart + * @param revisionEnd + * @param revisionPeg Revision where path is valid. + * @param target the logmap where to store the entries + * @param discoverChangedPaths + * @param strictNodeHistory + * @param limit (ignored when subversion 1.1 API) + * @return true if success + */ + virtual bool + log (const Path& path, const Revision & revisionStart, + const Revision & revisionEnd, + LogEntriesMap&target, + const Revision & revisionPeg, + bool discoverChangedPaths, + bool strictNodeHistory,int limit, + bool include_merged_revisions = false, + const StringArray&revprops=StringArray() + ) throw (ClientException); + + /** + * Produce diff output which describes the delta between + * @a path/@a revision1 and @a path/@a revision2. @a path + * can be either a working-copy path or a URL. + * + * A ClientException will be thrown if either @a revision1 or + * @a revision2 has an `unspecified' or unrecognized `kind'. + * + * @param tmpPath prefix for a temporary directory needed by diff. + * Filenames will have ".tmp" and similar added to this prefix in + * order to ensure uniqueness. + * @param path path of the file. + * @param revision1 one of the revisions to check. + * @param revision2 the other revision. + * @param recurse whether the operation should be done recursively. + * @param ignoreAncestry whether the files will be checked for + * relatedness. + * @param noDiffDeleted if true, no diff output will be generated on deleted files. + * @param ignore_contenttype if true generate diff even the items are marked as binaries + * @param extra extra options for diff ("-b", "-w","--ignore-eol-style") + * @return delta between the files + * @exception ClientException + */ + virtual TQByteArray + diff_peg (const Path & tmpPath, const Path & path,const Path&relativeTo, + const Revision & revision1, const Revision & revision2, const Revision& peg_revision, + Depth depth, bool ignoreAncestry, + bool noDiffDeleted,bool ignore_contenttype, + const StringArray&extra, + const StringArray&changelists + ) + throw (ClientException); + + /** + * Same as other diff but extra options and changelists always set to empty list. + */ + virtual TQByteArray + diff_peg (const Path & tmpPath, const Path & path,const Path&relativeTo, + const Revision & revision1, const Revision & revision2, const Revision& peg_revision, + Depth depth, bool ignoreAncestry, + bool noDiffDeleted,bool ignore_contenttype) + throw (ClientException); + + /** + * Produce diff output which describes the delta between + * @a path1/@a revision1 and @a path2/@a revision2. @a path2 + * can be either a working-copy path or a URL. + * + * A ClientException will be thrown if either @a revision1 or + * @a revision2 has an `unspecified' or unrecognized `kind'. + * + * @param tmpPath prefix for a temporary directory needed by diff. + * Filenames will have ".tmp" and similar added to this prefix in + * order to ensure uniqueness. + * @param path1 first file or folder to diff. + * @param path2 second file or folder to diff. + * @param revision1 one of the revisions to check (path1). + * @param revision2 the other revision (path2). + * @param recurse whether the operation should be done recursively. + * @param ignoreAncestry whether the files will be checked for + * relatedness. + * @param noDiffDeleted if true, no diff output will be generated on deleted files. + * @param ignore_contenttype if true generate diff even the items are marked as binaries + * @param extra extra options for diff ("-b", "-w","--ignore-eol-style") + * @return delta between the files + * @exception ClientException + */ + virtual TQByteArray + diff (const Path & tmpPath, const Path & path1,const Path & path2,const Path&relativeTo, + const Revision & revision1, const Revision & revision2, + Depth depth, bool ignoreAncestry, + bool noDiffDeleted,bool ignore_contenttype, + const StringArray&extra, + const StringArray&changelists + ) + throw (ClientException); + + /** + * Same as other diff but extra options always set to empty list. + */ + virtual TQByteArray + diff (const Path & tmpPath, const Path & path1,const Path & path2,const Path&relativeTo, + const Revision & revision1, const Revision & revision2, + Depth depth, bool ignoreAncestry, + bool noDiffDeleted,bool ignore_contenttype) + throw (ClientException); + + /** + * lists entries in @a pathOrUrl no matter whether local or + * repository + * + * @param pathOrUrl + * @param revision + * @param peg at wich revision path exists + * @param depth @sa svn::Depth + * @param retrieve_locks check for REPOSITORY locks while listing + * @return a vector of directory entries, each with + * a relative path (only filename) + */ + virtual DirEntries + list (const Path& pathOrUrl, + const Revision& revision, + const Revision& peg, + svn::Depth depth,bool retrieve_locks) throw (ClientException); + + /** + * lists properties in @a path no matter whether local or + * repository + * + * @param path + * @param revision + * @param peg most case should set to @a revision + * @param recurse + * @return PropertiesList + */ + virtual PathPropertiesMapListPtr + proplist(const Path &path, + const Revision &revision, + const Revision &peg, + Depth depth=DepthEmpty, + const StringArray&changelists=StringArray()); + + /** + * lists one property in @a path no matter whether local or + * repository + * + * @param propName + * @param path + * @param revision + * @param peg most case should set to @a revision + * @param recurse + * @return PathPropertiesMapList + */ + virtual TQPair + propget(const TQString& propName, + const Path &path, + const Revision &revision, + const Revision &peg, + Depth depth = svn::DepthEmpty, + const StringArray&changelists=StringArray()); + + /** + * set property in @a path no matter whether local or + * repository + * + * @param path + * @param propName + * @param propValue + * @param recurse + * @param skip_check if true skip validity checks + * @return PropertiesList + */ + virtual void + propset(const TQString& propName, + const TQString& propValue, + const Path &path, + Depth depth=DepthEmpty, + bool skip_check=false, + const Revision&base_revision=Revision::UNDEFINED, + const StringArray&changelists=StringArray(), + const PropertiesMap&revProps=PropertiesMap() + ); + + /** + * delete property in @a path no matter whether local or + * repository + * + * @param propName + * @param path + * @param revision + * @param recurse + */ + virtual void + propdel(const TQString& propName, + const Path &path, + Depth depth=DepthEmpty, + bool skip_check=false, + const Revision&base_revision=Revision::UNDEFINED, + const StringArray&changelists=StringArray()); + + + /** + * lists revision properties in @a path no matter whether local or + * repository + * + * @param path + * @param revision + * @return PropertiesList + */ + virtual TQPair + revproplist(const Path &path, + const Revision &revision); + + /** + * lists one revision property in @a path no matter whether local or + * repository + * + * @param propName + * @param path + * @param revision + * @return PropertiesList + */ + TQPair + revpropget(const TQString& propName, + const Path &path, + const Revision &revision); + + /** + * set revision property in @a path no matter whether local or + * repository + * + * @param propName + * @param propValue + * @param path + * @param revision + * @param force + * @return Revision + */ + virtual TQLONG + revpropset(const TQString& propName, + const TQString& propValue, + const Path &path, + const Revision &revision, + bool force=false); + + /** + * delete revision property in @a path no matter whether local or + * repository + * + * @param propName + * @param path + * @param revision + * @param force + * @return Revision + */ + virtual TQLONG + revpropdel(const TQString& propName, + const Path &path, + const Revision &revision, + bool force=false); + + /** + * lock files in repository or working copy + * @param targets items to be locked + * @param message if non null stored with each lock in repository + * @param steal_lock if true locks in wc will stolen. + * @since subversion 1.2 + */ + virtual void + lock (const Targets & targets, + const TQString& message, + bool steal_lock) throw (ClientException); + /** + * unlock files in repository or working copy + * @param targets items to unlock + * @param break_lock ignore any errors + */ + virtual void + unlock (const Targets&targets, + bool break_lock) throw (ClientException); + + virtual void + url2Revision(const TQString&revstring, + Revision&start,Revision&end); + virtual void + url2Revision(const TQString&revstring, + Revision&start); + + struct sBaton { + Context*m_context; + void*m_data; + void*m_revstack; + }; + + struct propBaton { + Context*m_context; + PathPropertiesMapList*resultlist; + }; + + private: + ContextP m_context; + + /** + * disallow assignment operator + */ + Client_impl & operator= (const Client &); + + /** + * disallow copy constructor + */ + Client_impl (const Client &); + + DirEntries + list_simple(const Path& pathOrUrl, + const Revision& revision, + const Revision& peg, + bool recurse) throw (ClientException); + DirEntries + list_locks(const Path& pathOrUrl, + const Revision& revision, + const Revision& peg, + bool recurse) throw (ClientException); + + svn_error_t * internal_cat(const Path & path, + const Revision & revision, + const Revision & peg_revision, + svn::stream::SvnStream&); + + apr_hash_t * map2hash(const PropertiesMap&,const Pool&); + }; + +} + +#endif diff --git a/src/svnqt/client_impl.hpp b/src/svnqt/client_impl.hpp deleted file mode 100644 index e655d3f..0000000 --- a/src/svnqt/client_impl.hpp +++ /dev/null @@ -1,895 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_CLIENT_IMPL_H_ -#define _SVNCPP_CLIENT_IMPL_H_ - -#include "svn_sorts.h" -#include - -#include "svnqt/client.hpp" -#include "svnqt/svnqt_defines.hpp" - -// Ignore MSVC 6 compiler warning: debug symbol truncated -#if defined (_MSC_VER) && _MSC_VER <= 1200 -#pragma warning (disable: 4786) -#endif - -// Ignore MSVC 7, 2005 & 2008 compiler warning: C++ exception specification -#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1550 -#pragma warning (disable: 4290) -#endif - -class TQStringList; - -#if (SVN_VER_MAJOR == 1 && SVN_VER_MINOR <= 8) -typedef svn_sort__item_t svn_sort_item_type; -#else -// Taken from subversion 1.8.10 source code and modified where needed - -// Same as svn_sort__item_t -typedef struct svn_sort_item_type { - const void *key; // pointer to the key - apr_ssize_t klen; // size of the key - void *value; // pointer to the value -} svn_sort_item_type; - -apr_array_header_t* svn_sort__hash(apr_hash_t *ht, - int (*comparison_func)(const svn_sort__item_t*, const svn_sort__item_t*), apr_pool_t *pool); -#endif - -namespace svn -{ - namespace stream { - class SvnStream; - } - - /** - * Subversion client API. - */ - class SVNTQT_NOEXPORT Client_impl:public Client - { - public: - /** - * Initializes the primary memory pool. - */ - Client_impl(ContextP context); - - virtual ~Client_impl(); - - /** - * @return returns the Client context - */ - virtual const ContextP - getContext () const; - - /** - * sets the client context - * you have to make sure the old context - * is de-allocated - * - * @param context new context to use - */ - virtual void - setContext (ContextP context); - - - /** - * Enumerates all files/dirs at a given path. - * - * Throws an exception if an error occurs - * - * @param path Path to explore. - * @param descend Recurse into subdirectories if existant. - * @param get_all Return all entries, not just the interesting ones. - * @param update Query the repository for updates. - * @param no_ignore Disregard default and svn:ignore property ignores. - * @param hide_externals don't recurse into external definitions - * @param revision list specific revision when browsing remote, on working copies parameter will ignored - * @param detailed_remote if on remote listing detailed item info should get if possible - * that may slow so should configureable in frontends! - * @return vector with Status entries. - */ - virtual StatusEntries - status (const Path& path, - Depth depth=DepthEmpty, - bool get_all = true, - bool update = false, - bool no_ignore = false, - const Revision revision = svn::Revision::HEAD, - bool detailed_remote = false, - bool hide_externals = false, - const StringArray & changelists=StringArray()) throw (ClientException); - - /** - * Returns the status of a single file in the path. - * - * Throws an exception if an error occurs - * - * @param path File to gather status. - * @param update if check against repository if new updates are there (for WC only) - * @param revision list specific revision when browsing remote, on working copies parameter will ignored - * @return a Status with Statis.isVersioned = FALSE - */ - virtual StatusPtr - singleStatus (const Path& path,bool update=false,const Revision revision = svn::Revision::HEAD) throw (ClientException); - - /** - * Executes a revision checkout. - * @param moduleName name of the module to checkout. - * @param destPath destination directory for checkout. - * @param revision the revision number to checkout. If the number is -1 - * then it will checkout the latest revision. - * @param peg Revision to look up - * @param recurse whether you want it to checkout files recursively. - * @param ignore_externals if true don't process externals definitions. - * @exception ClientException - */ - virtual svn_revnum_t - checkout (const Path& moduleName, const Path & destPath, - const Revision & revision, - const Revision & peg = Revision::UNDEFINED, - svn::Depth depth=DepthInfinity, - bool ignore_externals=false, - bool overwrite=false - ) throw (ClientException); - - /** - * relocate wc @a from to @a to - * @exception ClientException - */ - virtual void - relocate (const Path & path, const TQString &from_url, - const TQString &to_url, bool recurse) throw (ClientException); - - /** - * Sets a single file for deletion. - * @exception ClientException - */ - virtual svn::Revision - remove (const Path & path, bool force, - bool keep_local = true, - const PropertiesMap&revProps = PropertiesMap()) throw (ClientException); - - /** - * Sets files for deletion. - * - * @param targets targets to delete - * @param force force if files are locally modified - * @exception ClientException - */ - virtual svn::Revision - remove (const Targets & targets, - bool force, - bool keep_local = true, - const PropertiesMap&revProps = PropertiesMap()) throw (ClientException); - - /** - * Reverts a couple of files to a pristiner state. - * @exception ClientException - */ - virtual void - revert (const Targets & targets, - Depth depth, - const StringArray&changelist=StringArray() - ) throw (ClientException); - - - /** - * Adds a file to the repository. - * @param path the path to add - * @param depth if @a path is a folder add items recursive depending on value if it. Pre-subversion 1.5 DepthInfinity is mapped to recursive, all other to not-recursive. - * @param force if true, do not error on already-versioned items. - * @param no_ignore if false don't add files or directories that match ignore patterns. - * @param add_parents if true, go up to the next versioned folder and add all between path and this folder. Used only with subversion 1.5 or newer - * @exception ClientException - * @sa svn::Depth - */ - virtual void add (const Path & path, svn::Depth depth,bool force=false, bool no_ignore=false, bool add_parents = true) throw (ClientException); - - /** - * Updates the file or directory. - * @param path targets. - * @param revision the revision number to checkout. - * Revision::HEAD will checkout the - * latest revision. - * @param depth Depthness for operation - * @param ignore_externals ignore externals - * @param allow_unversioned will operation not fail if there are unversioned items in tree with same name. - * @exception ClientException - */ - virtual Revisions - update (const Targets & path, const Revision & revision, - Depth depth,bool ignore_externals,bool allow_unversioned, - bool sticky_depth) throw (ClientException); - - /** - * Retrieves the contents for a specific @a revision of - * a @a path at @a peg_revision - * - * @param path path of file or directory - * @param peg_revision revision to base the URL - * @param revision revision to retrieve - * @param peg_revision Revision to look at - * @return contents of the file - */ - virtual TQByteArray - cat (const Path & path, - const Revision & revision, - const Revision & peg_revision=svn_opt_revision_unspecified) throw (ClientException); - /** - * Retrieves the contents for a specific @a revision of - * a @a path at @a peg_revision - * - * @param buffer Stream to store content direct - * @param path path of file or directory - * @param peg_revision revision to base the URL - * @param revision revision to retrieve - * @exception ClientException - */ - virtual void - cat(svn::stream::SvnStream&buffer, - const Path & path, - const Revision & revision, - const Revision & peg_revision) throw (ClientException); - - /** - * Retrieves the contents for a specific @a revision of - * a @a path at @a peg_revision - * - * @param path path of file or directory - * @param target new (local) name - * @param peg_revision revision to base the URL - * @param revision revision to retrieve - * @param peg_revision Revision to look at - */ - virtual void - get (const Path & path, - const TQString & target, - const Revision & revision, - const Revision & peg_revision=svn_opt_revision_unspecified) throw (ClientException); - - /** - * Retrieves the contents for a specific @a revision of - * a @a path and stores the result in @a target - * - * @param target the container where to store the result - * @param path path of file or directory - * @param revisionStart revision to retrieve - * @param revisionEnd revision to retrieve - * @param peg indicates in which revision path is valid - */ - virtual void - annotate (AnnotatedFile&target, - const Path & path, - const Revision & revisionStart, - const Revision & revisionEnd, - const Revision & peg = Revision::UNDEFINED, - const DiffOptions&diffoptions = DiffOptions(), - bool ignore_mimetypes = false, - bool include_merged_revisions = false - ) throw (ClientException); - - /** - * Commits changes to the repository. This usually requires - * authentication, see Auth. - * @return Returns revision transferred or svn::Revision::UNDEFINED if the revision number is invalid. - * @param targets files to commit. - * @param message log message. - * @param depth whether the operation should be done recursively. - * @param keep_locks if false unlock items in paths - * @param changelist - * @param keep_changelist - * @exception ClientException - */ - virtual svn::Revision - commit (const Targets & targets, - const TQString& message, - svn::Depth depth,bool keep_locks=true, - const svn::StringArray&changelist=svn::StringArray(), - const PropertiesMap&revProps=PropertiesMap(), - bool keep_changelist=false - ) throw (ClientException); - - /** - * Copies a versioned file with the history preserved. - * @exception ClientException - */ - virtual svn::Revision - copy (const Path & srcPath, - const Revision & srcRevision, - const Path & destPath) throw (ClientException); - /** - * Copies a versioned file with the history preserved. - * @since subversion 1.5 api - * @see svn_client_copy4 - * @exception ClientException - */ - virtual svn::Revision - copy (const Targets & srcPath, - const Revision & srcRevision, - const Revision & pegRevision, - const Path & destPath, - bool asChild=false,bool makeParent=false,const PropertiesMap&revProps=PropertiesMap()) throw (ClientException); - - /** - * Moves or renames a file. - * @exception ClientException - */ - virtual svn::Revision - move (const Path & srcPath, - const Path & destPath, - bool force) throw (ClientException); - - /** - * Moves or renames a file. - * @exception ClientException - */ - virtual svn::Revision - move (const Targets & srcPath, - const Path & destPath, - bool force,bool asChild,bool makeParent,const PropertiesMap&revProps=PropertiesMap()) throw (ClientException); - - /** - * Creates a directory directly in a repository or creates a - * directory on disk and schedules it for addition. If path - * is a URL then authentication is usually required, see Auth and - * the callback asks for a logmessage. - * - * @param path - * @param message log message. if it is TQString() asks when working on repository - * @exception ClientException - */ - virtual svn::Revision - mkdir (const Path & path, - const TQString& message, - bool makeParent=true, - const PropertiesMap&revProps=PropertiesMap() - ) throw (ClientException); - /** - * Creates a directory directly in a repository or creates a - * directory on disk and schedules it for addition. If path - * is a URL then authentication is usually required, see Auth and - * the callback asks for a logmessage. - * - * @param targets encoded pathes to create - * @param message log message. if it is TQString() asks when working on repository - * @exception ClientException - */ - virtual svn::Revision - mkdir (const Targets & targets, - const TQString& message, - bool makeParent=true, - const PropertiesMap&revProps=PropertiesMap() - ) throw (ClientException); - - /** - * Recursively cleans up a local directory, finishing any - * incomplete operations, removing lockfiles, etc. - * @param path a local directory. - * @exception ClientException - */ - virtual void - cleanup (const Path & path) throw (ClientException); - - /** - * Removes the 'conflicted' state on a file. - * @exception ClientException - */ - virtual void resolve (const Path & path,Depth depth,const ConflictResult&resolution=ConflictResult()) throw (ClientException); - - /** - * Exports the contents of either a subversion repository into a - * 'clean' directory (meaning a directory with no administrative - * directories). - * @exception ClientException - * @param srcPath source path - * @param destPath a destination path that must not already exist. - * @param revision revision to use for the export - * @param peg the revision where the path is first looked up when exporting from a repository. - * @param overwrite overwrite existing files - * @param native_eol Either "LF", "CR" or "CRLF" or NULL. - * @param ignore_externals don't process externals definitions as part of this operation. - * @param recurse if true, export recursively. Otherwise, export just the directory represented by from and its immediate non-directory children. - */ - virtual svn_revnum_t - doExport (const Path & srcPath, - const Path & destPath, - const Revision & revision, - const Revision & peg = Revision::UNDEFINED, - bool overwrite=false, - const TQString&native_eol=TQString(), - bool ignore_externals = false, - svn::Depth depth=svn::DepthInfinity - ) throw (ClientException); - - /** - * Update local copy to mirror a new url. This excapsulates the - * svn_client_switch() client method. - * @exception ClientException - */ - virtual svn_revnum_t - doSwitch ( - const Path & path, const TQString& url, - const Revision & revision, - Depth depth, - const Revision & peg=Revision::UNDEFINED, - bool sticky_depth = true, - bool ignore_externals=false, - bool allow_unversioned=false - ) throw (ClientException); - - /** - * Import file or directory PATH into repository directory URL at - * head. This usually requires authentication, see Auth. - * @param path path to import - * @param url - * @param message log message. - * @param depth kind of recurse operation - * @param no_ignore if false, don't add items matching global ignore pattern - * @param no_unknown_nodetype if true ignore files type not known like pipes or device files - * @exception ClientException - */ - virtual svn::Revision - import (const Path & path, const TQString& url, - const TQString& message, - svn::Depth depth, - bool no_ignore,bool no_unknown_nodetype, - const PropertiesMap&revProps=PropertiesMap()) throw (ClientException); - - /** - * Merge changes from two paths into a new local path. - * @exception ClientException - */ - virtual void - merge (const Path & path1, const Revision & revision1, - const Path & path2, const Revision & revision2, - const Path & localPath, bool force, - Depth depth, - bool notice_ancestry=false, - bool dry_run=false, - bool record_only=false, - const StringArray&merge_options=StringArray() - ) throw (ClientException); - - virtual void - merge_peg(const Path&src, - const RevisionRanges&ranges, - const Revision&peg, - const Path&targetWc, - Depth depth, - bool notice_ancestry=false, - bool dry_run=false, - bool force=false, - bool record_only=false, - const StringArray&merge_options=StringArray() - ) throw (ClientException); - - virtual void - merge_peg(const Path&src, - const RevisionRange&range, - const Revision&peg, - const Path&targetWc, - Depth depth, - bool notice_ancestry, - bool dry_run, - bool force, - const StringArray&merge_options - ) throw (ClientException); - - /** - * Retrieve information for the given path - * remote or local. Only gives with subversion 1.2 - * usefull results - * - * @param path path for info - * @param rec recursive (if dir) - * @param rev for which revision - * @param peg_revision peg revision - * @return InfoEntries - * @since subversion 1.2 - */ - virtual InfoEntries - info(const Path &path, - Depth depth, - const Revision & rev, - const Revision & peg_revision=svn_opt_revision_unspecified, - const StringArray&changelists=StringArray() - ) throw (ClientException); - /** - * Retrieve log information for the given path - * Loads the log messages result set. The first - * entry is the youngest revision. - * - * You can use the constants Revision::START and - * Revision::HEAD - * - * @param path - * @param revisionStart Start revision. - * @param revisionEnd End revision - * @param revisionPeg Revision where path is valid. - * @param discoverChangedPaths Should changed pathes transferred - * @param strictNodeHistory - * @param limit the maximum log entries count. - * @param include_merged_revisions log information for revisions which have been merged to targets will also be returned. (subversion 1.5) - * @return a vector with log entries - */ - virtual LogEntriesPtr - log (const Path& path, const Revision & revisionStart, - const Revision & revisionEnd, - const Revision & revisionPeg, - bool discoverChangedPaths=false, - bool strictNodeHistory=true,int limit=0, - bool include_merged_revisions = false, - const StringArray&revprops=StringArray() - ) throw (ClientException); - /** - * Retrieve log information for the given path - * Loads the log messages result set. Result will stored - * in a map where the key is the revision number - * - * You can use the constants Revision::START and - * Revision::HEAD - * - * @param path - * @param revisionStart - * @param revisionEnd - * @param revisionPeg Revision where path is valid. - * @param target the logmap where to store the entries - * @param discoverChangedPaths - * @param strictNodeHistory - * @param limit (ignored when subversion 1.1 API) - * @return true if success - */ - virtual bool - log (const Path& path, const Revision & revisionStart, - const Revision & revisionEnd, - LogEntriesMap&target, - const Revision & revisionPeg, - bool discoverChangedPaths, - bool strictNodeHistory,int limit, - bool include_merged_revisions = false, - const StringArray&revprops=StringArray() - ) throw (ClientException); - - /** - * Produce diff output which describes the delta between - * @a path/@a revision1 and @a path/@a revision2. @a path - * can be either a working-copy path or a URL. - * - * A ClientException will be thrown if either @a revision1 or - * @a revision2 has an `unspecified' or unrecognized `kind'. - * - * @param tmpPath prefix for a temporary directory needed by diff. - * Filenames will have ".tmp" and similar added to this prefix in - * order to ensure uniqueness. - * @param path path of the file. - * @param revision1 one of the revisions to check. - * @param revision2 the other revision. - * @param recurse whether the operation should be done recursively. - * @param ignoreAncestry whether the files will be checked for - * relatedness. - * @param noDiffDeleted if true, no diff output will be generated on deleted files. - * @param ignore_contenttype if true generate diff even the items are marked as binaries - * @param extra extra options for diff ("-b", "-w","--ignore-eol-style") - * @return delta between the files - * @exception ClientException - */ - virtual TQByteArray - diff_peg (const Path & tmpPath, const Path & path,const Path&relativeTo, - const Revision & revision1, const Revision & revision2, const Revision& peg_revision, - Depth depth, bool ignoreAncestry, - bool noDiffDeleted,bool ignore_contenttype, - const StringArray&extra, - const StringArray&changelists - ) - throw (ClientException); - - /** - * Same as other diff but extra options and changelists always set to empty list. - */ - virtual TQByteArray - diff_peg (const Path & tmpPath, const Path & path,const Path&relativeTo, - const Revision & revision1, const Revision & revision2, const Revision& peg_revision, - Depth depth, bool ignoreAncestry, - bool noDiffDeleted,bool ignore_contenttype) - throw (ClientException); - - /** - * Produce diff output which describes the delta between - * @a path1/@a revision1 and @a path2/@a revision2. @a path2 - * can be either a working-copy path or a URL. - * - * A ClientException will be thrown if either @a revision1 or - * @a revision2 has an `unspecified' or unrecognized `kind'. - * - * @param tmpPath prefix for a temporary directory needed by diff. - * Filenames will have ".tmp" and similar added to this prefix in - * order to ensure uniqueness. - * @param path1 first file or folder to diff. - * @param path2 second file or folder to diff. - * @param revision1 one of the revisions to check (path1). - * @param revision2 the other revision (path2). - * @param recurse whether the operation should be done recursively. - * @param ignoreAncestry whether the files will be checked for - * relatedness. - * @param noDiffDeleted if true, no diff output will be generated on deleted files. - * @param ignore_contenttype if true generate diff even the items are marked as binaries - * @param extra extra options for diff ("-b", "-w","--ignore-eol-style") - * @return delta between the files - * @exception ClientException - */ - virtual TQByteArray - diff (const Path & tmpPath, const Path & path1,const Path & path2,const Path&relativeTo, - const Revision & revision1, const Revision & revision2, - Depth depth, bool ignoreAncestry, - bool noDiffDeleted,bool ignore_contenttype, - const StringArray&extra, - const StringArray&changelists - ) - throw (ClientException); - - /** - * Same as other diff but extra options always set to empty list. - */ - virtual TQByteArray - diff (const Path & tmpPath, const Path & path1,const Path & path2,const Path&relativeTo, - const Revision & revision1, const Revision & revision2, - Depth depth, bool ignoreAncestry, - bool noDiffDeleted,bool ignore_contenttype) - throw (ClientException); - - /** - * lists entries in @a pathOrUrl no matter whether local or - * repository - * - * @param pathOrUrl - * @param revision - * @param peg at wich revision path exists - * @param depth @sa svn::Depth - * @param retrieve_locks check for REPOSITORY locks while listing - * @return a vector of directory entries, each with - * a relative path (only filename) - */ - virtual DirEntries - list (const Path& pathOrUrl, - const Revision& revision, - const Revision& peg, - svn::Depth depth,bool retrieve_locks) throw (ClientException); - - /** - * lists properties in @a path no matter whether local or - * repository - * - * @param path - * @param revision - * @param peg most case should set to @a revision - * @param recurse - * @return PropertiesList - */ - virtual PathPropertiesMapListPtr - proplist(const Path &path, - const Revision &revision, - const Revision &peg, - Depth depth=DepthEmpty, - const StringArray&changelists=StringArray()); - - /** - * lists one property in @a path no matter whether local or - * repository - * - * @param propName - * @param path - * @param revision - * @param peg most case should set to @a revision - * @param recurse - * @return PathPropertiesMapList - */ - virtual TQPair - propget(const TQString& propName, - const Path &path, - const Revision &revision, - const Revision &peg, - Depth depth = svn::DepthEmpty, - const StringArray&changelists=StringArray()); - - /** - * set property in @a path no matter whether local or - * repository - * - * @param path - * @param propName - * @param propValue - * @param recurse - * @param skip_check if true skip validity checks - * @return PropertiesList - */ - virtual void - propset(const TQString& propName, - const TQString& propValue, - const Path &path, - Depth depth=DepthEmpty, - bool skip_check=false, - const Revision&base_revision=Revision::UNDEFINED, - const StringArray&changelists=StringArray(), - const PropertiesMap&revProps=PropertiesMap() - ); - - /** - * delete property in @a path no matter whether local or - * repository - * - * @param propName - * @param path - * @param revision - * @param recurse - */ - virtual void - propdel(const TQString& propName, - const Path &path, - Depth depth=DepthEmpty, - bool skip_check=false, - const Revision&base_revision=Revision::UNDEFINED, - const StringArray&changelists=StringArray()); - - - /** - * lists revision properties in @a path no matter whether local or - * repository - * - * @param path - * @param revision - * @return PropertiesList - */ - virtual TQPair - revproplist(const Path &path, - const Revision &revision); - - /** - * lists one revision property in @a path no matter whether local or - * repository - * - * @param propName - * @param path - * @param revision - * @return PropertiesList - */ - TQPair - revpropget(const TQString& propName, - const Path &path, - const Revision &revision); - - /** - * set revision property in @a path no matter whether local or - * repository - * - * @param propName - * @param propValue - * @param path - * @param revision - * @param force - * @return Revision - */ - virtual TQLONG - revpropset(const TQString& propName, - const TQString& propValue, - const Path &path, - const Revision &revision, - bool force=false); - - /** - * delete revision property in @a path no matter whether local or - * repository - * - * @param propName - * @param path - * @param revision - * @param force - * @return Revision - */ - virtual TQLONG - revpropdel(const TQString& propName, - const Path &path, - const Revision &revision, - bool force=false); - - /** - * lock files in repository or working copy - * @param targets items to be locked - * @param message if non null stored with each lock in repository - * @param steal_lock if true locks in wc will stolen. - * @since subversion 1.2 - */ - virtual void - lock (const Targets & targets, - const TQString& message, - bool steal_lock) throw (ClientException); - /** - * unlock files in repository or working copy - * @param targets items to unlock - * @param break_lock ignore any errors - */ - virtual void - unlock (const Targets&targets, - bool break_lock) throw (ClientException); - - virtual void - url2Revision(const TQString&revstring, - Revision&start,Revision&end); - virtual void - url2Revision(const TQString&revstring, - Revision&start); - - struct sBaton { - Context*m_context; - void*m_data; - void*m_revstack; - }; - - struct propBaton { - Context*m_context; - PathPropertiesMapList*resultlist; - }; - - private: - ContextP m_context; - - /** - * disallow assignment operator - */ - Client_impl & operator= (const Client &); - - /** - * disallow copy constructor - */ - Client_impl (const Client &); - - DirEntries - list_simple(const Path& pathOrUrl, - const Revision& revision, - const Revision& peg, - bool recurse) throw (ClientException); - DirEntries - list_locks(const Path& pathOrUrl, - const Revision& revision, - const Revision& peg, - bool recurse) throw (ClientException); - - svn_error_t * internal_cat(const Path & path, - const Revision & revision, - const Revision & peg_revision, - svn::stream::SvnStream&); - - apr_hash_t * map2hash(const PropertiesMap&,const Pool&); - }; - -} - -#endif diff --git a/src/svnqt/client_lock.cpp b/src/svnqt/client_lock.cpp index 830f215..812c678 100644 --- a/src/svnqt/client_lock.cpp +++ b/src/svnqt/client_lock.cpp @@ -18,15 +18,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ // svncpp -#include "client_impl.hpp" +#include "client_impl.h" // subversion api #include "svn_client.h" -#include "svnqt/exception.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/targets.hpp" -#include "svnqt/svnqt_defines.hpp" +#include "svnqt/exception.h" +#include "svnqt/pool.h" +#include "svnqt/targets.h" +#include "svnqt/svnqt_defines.h" namespace svn { diff --git a/src/svnqt/client_ls.cpp b/src/svnqt/client_ls.cpp index 9528f36..46b3536 100644 --- a/src/svnqt/client_ls.cpp +++ b/src/svnqt/client_ls.cpp @@ -33,18 +33,18 @@ // svncpp -#include "svnqt/client_impl.hpp" +#include "svnqt/client_impl.h" // subversion api #include "svn_client.h" #include "svn_path.h" //#include "svn_utf.h" -#include "svnqt/dirent.hpp" -#include "svnqt/exception.hpp" -#include "svnqt/svnqt_defines.hpp" +#include "svnqt/dirent.h" +#include "svnqt/exception.h" +#include "svnqt/svnqt_defines.h" -#include "svnqt/helper.hpp" +#include "svnqt/helper.h" namespace svn { diff --git a/src/svnqt/client_merge.cpp b/src/svnqt/client_merge.cpp index 0d84cc2..a067244 100644 --- a/src/svnqt/client_merge.cpp +++ b/src/svnqt/client_merge.cpp @@ -1,15 +1,15 @@ -#include "svnqt/client_impl.hpp" +#include "svnqt/client_impl.h" // subversion api #include "svn_client.h" -#include "svnqt/exception.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/targets.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/stringarray.hpp" +#include "svnqt/exception.h" +#include "svnqt/pool.h" +#include "svnqt/targets.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/stringarray.h" -#include "svnqt/helper.hpp" +#include "svnqt/helper.h" namespace svn { diff --git a/src/svnqt/client_modify.cpp b/src/svnqt/client_modify.cpp index d90fdae..dc0174d 100644 --- a/src/svnqt/client_modify.cpp +++ b/src/svnqt/client_modify.cpp @@ -31,18 +31,18 @@ #pragma warning( disable: 4786 )// debug symbol truncated #endif // svncpp -#include "svnqt/client_impl.hpp" +#include "svnqt/client_impl.h" // subversion api #include "svn_client.h" -#include "svnqt/exception.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/targets.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/stringarray.hpp" +#include "svnqt/exception.h" +#include "svnqt/pool.h" +#include "svnqt/targets.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/stringarray.h" -#include "svnqt/helper.hpp" +#include "svnqt/helper.h" namespace svn { diff --git a/src/svnqt/client_property.cpp b/src/svnqt/client_property.cpp index 5600742..49fa534 100644 --- a/src/svnqt/client_property.cpp +++ b/src/svnqt/client_property.cpp @@ -31,19 +31,19 @@ #pragma warning( disable: 4786 )// debug symbol truncated #endif // svncpp -#include "svnqt/client_impl.hpp" +#include "svnqt/client_impl.h" // subversion api #include "svn_client.h" //#include "svn_utf.h" -#include "svnqt/path.hpp" -#include "svnqt/exception.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/revision.hpp" -#include "svnqt/svnqt_defines.hpp" +#include "svnqt/path.h" +#include "svnqt/exception.h" +#include "svnqt/pool.h" +#include "svnqt/revision.h" +#include "svnqt/svnqt_defines.h" -#include "svnqt/helper.hpp" +#include "svnqt/helper.h" namespace svn diff --git a/src/svnqt/client_status.cpp b/src/svnqt/client_status.cpp index 749042c..ff75d25 100644 --- a/src/svnqt/client_status.cpp +++ b/src/svnqt/client_status.cpp @@ -33,23 +33,23 @@ // svncpp -#include "svnqt/client_impl.hpp" -#include "svnqt/helper.hpp" +#include "svnqt/client_impl.h" +#include "svnqt/helper.h" // Subversion api #include "svn_client.h" #include "svn_path.h" //#include "svn_utf.h" -#include "svnqt/dirent.hpp" -#include "svnqt/exception.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/status.hpp" -#include "svnqt/targets.hpp" -#include "svnqt/info_entry.hpp" -#include "svnqt/url.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/context_listener.hpp" +#include "svnqt/dirent.h" +#include "svnqt/exception.h" +#include "svnqt/pool.h" +#include "svnqt/status.h" +#include "svnqt/targets.h" +#include "svnqt/info_entry.h" +#include "svnqt/url.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/context_listener.h" namespace svn { diff --git a/src/svnqt/commititem.cpp b/src/svnqt/commititem.cpp index e39a2c4..8f9a5d6 100644 --- a/src/svnqt/commititem.cpp +++ b/src/svnqt/commititem.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "commititem.hpp" +#include "commititem.h" #include #include diff --git a/src/svnqt/commititem.h b/src/svnqt/commititem.h new file mode 100644 index 0000000..3b65df5 --- /dev/null +++ b/src/svnqt/commititem.h @@ -0,0 +1,97 @@ +/*************************************************************************** + * Copyright (C) 2005-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SVNCOMMITITEM_H +#define SVNCOMMITITEM_H + +#include "client.h" + +#include +#include + +// forward declarations +struct svn_client_commit_item_t; +// only used if build against svn 1.3 api +struct svn_client_commit_item2_t; +// only used if build against svn 1.5 api +struct svn_client_commit_item3_t; + +namespace svn { + +/** + @author Rajko Albrecht +*/ +class SVNTQT_EXPORT CommitItem{ + +private: + void init(); + void convertprop(apr_array_header_t *); + +protected: + PropertiesMap m_CommitProperties; + TQString m_Path,m_Url,m_CopyFromUrl; + svn_node_kind_t m_Kind; + svn_revnum_t m_Revision,m_CopyFromRevision; + apr_byte_t m_State; + +public: + //! constructor + CommitItem(const svn_client_commit_item_t*aSource=0); + //! constructor + /*! + * This one will only do something if build against subversion 1.3 + */ + CommitItem(const svn_client_commit_item2_t*); + /*! + * This one will only do something if build against subversion 1.5 + */ + CommitItem(const svn_client_commit_item3_t*); + //! Destructor + /*! + * Not virtual 'cause no child class is needed + */ + ~CommitItem(); + + const TQString& path()const; + const TQString& url()const; + const TQString& copyfromurl()const; + const PropertiesMap& properties()const; + svn_revnum_t revision()const; + svn_revnum_t copyfromrevision()const; + svn_node_kind_t kind()const; + apr_byte_t state()const; + //! Kind of action + /*! + * \return Char for type of action or 0 if unknown. Currently known is + *
    + *
  • A - add
  • + *
  • C - copy
  • + *
  • D - deletion
  • + *
  • M - Modify (content or property)
  • + *
  • R - replaced
  • + *
  • L - (un-)lock
  • + *
+ */ + char actionType()const; +}; + + typedef TQValueList CommitItemList; +} + +#endif diff --git a/src/svnqt/commititem.hpp b/src/svnqt/commititem.hpp deleted file mode 100644 index 5951e6f..0000000 --- a/src/svnqt/commititem.hpp +++ /dev/null @@ -1,97 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef SVNCOMMITITEM_H -#define SVNCOMMITITEM_H - -#include "client.hpp" - -#include -#include - -// forward declarations -struct svn_client_commit_item_t; -// only used if build against svn 1.3 api -struct svn_client_commit_item2_t; -// only used if build against svn 1.5 api -struct svn_client_commit_item3_t; - -namespace svn { - -/** - @author Rajko Albrecht -*/ -class SVNTQT_EXPORT CommitItem{ - -private: - void init(); - void convertprop(apr_array_header_t *); - -protected: - PropertiesMap m_CommitProperties; - TQString m_Path,m_Url,m_CopyFromUrl; - svn_node_kind_t m_Kind; - svn_revnum_t m_Revision,m_CopyFromRevision; - apr_byte_t m_State; - -public: - //! constructor - CommitItem(const svn_client_commit_item_t*aSource=0); - //! constructor - /*! - * This one will only do something if build against subversion 1.3 - */ - CommitItem(const svn_client_commit_item2_t*); - /*! - * This one will only do something if build against subversion 1.5 - */ - CommitItem(const svn_client_commit_item3_t*); - //! Destructor - /*! - * Not virtual 'cause no child class is needed - */ - ~CommitItem(); - - const TQString& path()const; - const TQString& url()const; - const TQString& copyfromurl()const; - const PropertiesMap& properties()const; - svn_revnum_t revision()const; - svn_revnum_t copyfromrevision()const; - svn_node_kind_t kind()const; - apr_byte_t state()const; - //! Kind of action - /*! - * \return Char for type of action or 0 if unknown. Currently known is - *
    - *
  • A - add
  • - *
  • C - copy
  • - *
  • D - deletion
  • - *
  • M - Modify (content or property)
  • - *
  • R - replaced
  • - *
  • L - (un-)lock
  • - *
- */ - char actionType()const; -}; - - typedef TQValueList CommitItemList; -} - -#endif diff --git a/src/svnqt/conflictdescription.cpp b/src/svnqt/conflictdescription.cpp index 2ccaf38..1dc4e5d 100644 --- a/src/svnqt/conflictdescription.cpp +++ b/src/svnqt/conflictdescription.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "conflictdescription.hpp" -#include "svnqt_defines.hpp" +#include "conflictdescription.h" +#include "svnqt_defines.h" #include diff --git a/src/svnqt/conflictdescription.h b/src/svnqt/conflictdescription.h new file mode 100644 index 0000000..1944827 --- /dev/null +++ b/src/svnqt/conflictdescription.h @@ -0,0 +1,96 @@ +/*************************************************************************** + * Copyright (C) 2008 by Rajko Albrecht ral@alwins-world.de * + * http://tdesvn.alwins-world.de/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SVNCONFLICTDESCRIPTION_H +#define SVNCONFLICTDESCRIPTION_H + +struct svn_wc_conflict_description_t; + +#include "svnqt/pool.h" +#include "svnqt/svnqt_defines.h" +#include + +#include + +namespace svn { + +/** Wrapper for svn_wc_conflict_description_t + * does nothing when build against subversion prior 1.5 + * @since subversion 1.5 + * @author Rajko Albrecht +*/ +class SVNTQT_EXPORT ConflictDescription +{ +public: + enum ConflictType { + ConflictText, + ConflictProperty + }; + enum ConflictReason { + ReasonEdited, + ReasonObstructed, + ReasonDeleted, + ReasonMissing, + ReasonUnversioned + }; + enum ConflictAction { + ConflictEdit, + ConflictAdd, + ConflictDelete + }; + ConflictDescription(); + ConflictDescription(const svn_wc_conflict_description_t*); + ~ConflictDescription(); + + ConflictAction action() const; + ConflictType Type() const; + ConflictReason reason() const; + svn_node_kind_t nodeKind() const; + bool binary() const; + const TQString& baseFile() const; + const TQString& theirFile() const; + const TQString& propertyName() const; + const TQString& Path() const; + const TQString& myFile() const; + const TQString& mimeType() const; + const TQString& mergedFile() const; + +protected: + //! don't use it. + ConflictDescription(const ConflictDescription&); + void init(); +protected: + Pool m_pool; + bool m_binary; + ConflictAction m_action; + ConflictType m_Type; + ConflictReason m_reason; + TQString m_baseFile; + TQString m_mergedFile; + TQString m_mimeType; + TQString m_myFile; + TQString m_Path; + TQString m_propertyName; + TQString m_theirFile; + svn_node_kind_t m_nodeKind; +}; + +} + +#endif diff --git a/src/svnqt/conflictdescription.hpp b/src/svnqt/conflictdescription.hpp deleted file mode 100644 index f7e0ea7..0000000 --- a/src/svnqt/conflictdescription.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Rajko Albrecht ral@alwins-world.de * - * http://tdesvn.alwins-world.de/ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef SVNCONFLICTDESCRIPTION_H -#define SVNCONFLICTDESCRIPTION_H - -struct svn_wc_conflict_description_t; - -#include "svnqt/pool.hpp" -#include "svnqt/svnqt_defines.hpp" -#include - -#include - -namespace svn { - -/** Wrapper for svn_wc_conflict_description_t - * does nothing when build against subversion prior 1.5 - * @since subversion 1.5 - * @author Rajko Albrecht -*/ -class SVNTQT_EXPORT ConflictDescription -{ -public: - enum ConflictType { - ConflictText, - ConflictProperty - }; - enum ConflictReason { - ReasonEdited, - ReasonObstructed, - ReasonDeleted, - ReasonMissing, - ReasonUnversioned - }; - enum ConflictAction { - ConflictEdit, - ConflictAdd, - ConflictDelete - }; - ConflictDescription(); - ConflictDescription(const svn_wc_conflict_description_t*); - ~ConflictDescription(); - - ConflictAction action() const; - ConflictType Type() const; - ConflictReason reason() const; - svn_node_kind_t nodeKind() const; - bool binary() const; - const TQString& baseFile() const; - const TQString& theirFile() const; - const TQString& propertyName() const; - const TQString& Path() const; - const TQString& myFile() const; - const TQString& mimeType() const; - const TQString& mergedFile() const; - -protected: - //! don't use it. - ConflictDescription(const ConflictDescription&); - void init(); -protected: - Pool m_pool; - bool m_binary; - ConflictAction m_action; - ConflictType m_Type; - ConflictReason m_reason; - TQString m_baseFile; - TQString m_mergedFile; - TQString m_mimeType; - TQString m_myFile; - TQString m_Path; - TQString m_propertyName; - TQString m_theirFile; - svn_node_kind_t m_nodeKind; -}; - -} - -#endif diff --git a/src/svnqt/conflictresult.cpp b/src/svnqt/conflictresult.cpp index 798ebf6..f65bec2 100644 --- a/src/svnqt/conflictresult.cpp +++ b/src/svnqt/conflictresult.cpp @@ -18,9 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "conflictresult.hpp" +#include "conflictresult.h" -#include "svnqt_defines.hpp" +#include "svnqt_defines.h" #include diff --git a/src/svnqt/conflictresult.h b/src/svnqt/conflictresult.h new file mode 100644 index 0000000..50222a2 --- /dev/null +++ b/src/svnqt/conflictresult.h @@ -0,0 +1,78 @@ +/*************************************************************************** + * Copyright (C) 2007 by Rajko Albrecht ral@alwins-world.de * + * http://tdesvn.alwins-world.de/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _CONFLICT_RESULT_HPP +#define _CONFLICT_RESULT_HPP + +struct svn_wc_conflict_result_t; + +#include "svnqt/pool.h" +#include "svnqt/svnqt_defines.h" +#include + +#include + +namespace svn { + +class SVNTQT_EXPORT ConflictResult +{ + public: + enum ConflictChoice { + //! let user make a call to resolve + ChoosePostpone, + ChooseBase, + ChooseTheirsFull, + ChooseMineFull, + ChooseTheirsConflict, + ChooseMineConflict, + ChooseMerged + }; + ConflictResult(); + //! Copy constructor + /*! only usefull wenn build with subversion 1.5 or newer + */ + ConflictResult(const svn_wc_conflict_result_t*); + + const TQString& mergedFile()const + { + return m_MergedFile; + } + void setMergedFile(const TQString&aMergedfile); + + ConflictChoice choice()const + { + return m_choice; + } + void setChoice(ConflictChoice aValue); + + const svn_wc_conflict_result_t*result(const Pool&pool)const; + void assignResult(svn_wc_conflict_result_t**aResult,const Pool&pool)const; + + protected: + ConflictChoice m_choice; + //! Merged file + /*! will only used if m_choice is ChooseMerged + */ + TQString m_MergedFile; +}; + +} + +#endif diff --git a/src/svnqt/conflictresult.hpp b/src/svnqt/conflictresult.hpp deleted file mode 100644 index 917b79a..0000000 --- a/src/svnqt/conflictresult.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007 by Rajko Albrecht ral@alwins-world.de * - * http://tdesvn.alwins-world.de/ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef _CONFLICT_RESULT_HPP -#define _CONFLICT_RESULT_HPP - -struct svn_wc_conflict_result_t; - -#include "svnqt/pool.hpp" -#include "svnqt/svnqt_defines.hpp" -#include - -#include - -namespace svn { - -class SVNTQT_EXPORT ConflictResult -{ - public: - enum ConflictChoice { - //! let user make a call to resolve - ChoosePostpone, - ChooseBase, - ChooseTheirsFull, - ChooseMineFull, - ChooseTheirsConflict, - ChooseMineConflict, - ChooseMerged - }; - ConflictResult(); - //! Copy constructor - /*! only usefull wenn build with subversion 1.5 or newer - */ - ConflictResult(const svn_wc_conflict_result_t*); - - const TQString& mergedFile()const - { - return m_MergedFile; - } - void setMergedFile(const TQString&aMergedfile); - - ConflictChoice choice()const - { - return m_choice; - } - void setChoice(ConflictChoice aValue); - - const svn_wc_conflict_result_t*result(const Pool&pool)const; - void assignResult(svn_wc_conflict_result_t**aResult,const Pool&pool)const; - - protected: - ConflictChoice m_choice; - //! Merged file - /*! will only used if m_choice is ChooseMerged - */ - TQString m_MergedFile; -}; - -} - -#endif diff --git a/src/svnqt/context.cpp b/src/svnqt/context.cpp index 015d928..f0e0532 100644 --- a/src/svnqt/context.cpp +++ b/src/svnqt/context.cpp @@ -38,10 +38,10 @@ //#include "svn_utf.h" // svncpp -#include "apr.hpp" -#include "context.hpp" -#include "context_listener.hpp" -#include "contextdata.hpp" +#include "apr.h" +#include "context.h" +#include "context_listener.h" +#include "contextdata.h" namespace svn { diff --git a/src/svnqt/context.h b/src/svnqt/context.h new file mode 100644 index 0000000..0ccd71c --- /dev/null +++ b/src/svnqt/context.h @@ -0,0 +1,171 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_CONTEXT_HPP_ +#define _SVNCPP_CONTEXT_HPP_ + +#include "svnqt/svnqt_defines.h" + +// qt +#include + +// Subversion api +#include "svn_client.h" + +// svncpp +#include "svnqt/pool.h" +#include "svnqt/smart_pointer.h" + + +namespace svn +{ + // forward declarations + class ContextListener; + class ContextData; + + /** + * This class will hold the client context + * and replace the old notification and baton + * stuff + */ + class SVNTQT_EXPORT Context:public ref_count + { + public: + /** + * default constructor + * + * @param configDir location where the + * subversion api stores its + * configuration + */ + Context (const TQString & configDir=TQString()); + + /** + * copy constructor + * + * @param src + */ + Context (const Context &src); + + /** + * destructor + */ + virtual ~Context (); + + /** + * enable/disable authentication caching + * + * @param value true=enable/false=disable + */ + void setAuthCache (bool value); + + /** + * set username/password for authentication + */ + void setLogin (const TQString& username, const TQString& password); + + /** + * operator to get svn_client_ctx object + */ + operator svn_client_ctx_t * (); + + /** + * return the svn_client_ctx object + */ + svn_client_ctx_t * ctx (); + + /** + * this will be called at the beginning of an action. + * the log message will be reset. + */ + void reset (); + + /** + * set log message + * + * @param msg + */ + void setLogMessage (const TQString& msg); + + /** + * get log message + * + * @return log message + */ + const TQString& + getLogMessage () const; + + /** + * get username + * + * @return username + */ + const TQString& + getUsername () const; + + /** + * get password + * + * @return password + */ + const TQString& + getPassword () const; + + /** + * set the listener for the context. The listener will be + * called to poll authentication information and other + * information like this + * + * @param listener + */ + void + setListener (ContextListener * listener); + + /** + * get the listener + * + * @return the listener + */ + ContextListener * + getListener () const; + + private: + ContextData * m; + + /** + * disable assignment operator + */ + Context & operator = (const Context &); + }; + + typedef svn::smart_pointer ContextP; +} + +#endif diff --git a/src/svnqt/context.hpp b/src/svnqt/context.hpp deleted file mode 100644 index 9e16bb9..0000000 --- a/src/svnqt/context.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_CONTEXT_HPP_ -#define _SVNCPP_CONTEXT_HPP_ - -#include "svnqt/svnqt_defines.hpp" - -// qt -#include - -// Subversion api -#include "svn_client.h" - -// svncpp -#include "svnqt/pool.hpp" -#include "svnqt/smart_pointer.hpp" - - -namespace svn -{ - // forward declarations - class ContextListener; - class ContextData; - - /** - * This class will hold the client context - * and replace the old notification and baton - * stuff - */ - class SVNTQT_EXPORT Context:public ref_count - { - public: - /** - * default constructor - * - * @param configDir location where the - * subversion api stores its - * configuration - */ - Context (const TQString & configDir=TQString()); - - /** - * copy constructor - * - * @param src - */ - Context (const Context &src); - - /** - * destructor - */ - virtual ~Context (); - - /** - * enable/disable authentication caching - * - * @param value true=enable/false=disable - */ - void setAuthCache (bool value); - - /** - * set username/password for authentication - */ - void setLogin (const TQString& username, const TQString& password); - - /** - * operator to get svn_client_ctx object - */ - operator svn_client_ctx_t * (); - - /** - * return the svn_client_ctx object - */ - svn_client_ctx_t * ctx (); - - /** - * this will be called at the beginning of an action. - * the log message will be reset. - */ - void reset (); - - /** - * set log message - * - * @param msg - */ - void setLogMessage (const TQString& msg); - - /** - * get log message - * - * @return log message - */ - const TQString& - getLogMessage () const; - - /** - * get username - * - * @return username - */ - const TQString& - getUsername () const; - - /** - * get password - * - * @return password - */ - const TQString& - getPassword () const; - - /** - * set the listener for the context. The listener will be - * called to poll authentication information and other - * information like this - * - * @param listener - */ - void - setListener (ContextListener * listener); - - /** - * get the listener - * - * @return the listener - */ - ContextListener * - getListener () const; - - private: - ContextData * m; - - /** - * disable assignment operator - */ - Context & operator = (const Context &); - }; - - typedef svn::smart_pointer ContextP; -} - -#endif diff --git a/src/svnqt/context_listener.h b/src/svnqt/context_listener.h new file mode 100644 index 0000000..a0c9d4b --- /dev/null +++ b/src/svnqt/context_listener.h @@ -0,0 +1,266 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_CONTEXT_LISTENER_HPP_ +#define _SVNCPP_CONTEXT_LISTENER_HPP_ + +// svncpp +#include "pool.h" +#include "commititem.h" +#include "svnqt_defines.h" +// qt +#include +// Subversion api +#include + + +namespace svn +{ + class ConflictResult; + class ConflictDescription; + /** + * This is the interface that is used by @a Context + * for callbacks. + * To use this you will have to inherit from this + * interface and overwrite the virtual methods. + */ + class SVNTQT_EXPORT ContextListener + { + public: + /** + * empty destructor avoids a lot of compiler warnings + */ + virtual ~ContextListener(){} + /** + * this method will be called to retrieve + * authentication information. This will called until valid information were + * inserted or it returns false. + * + * @param username username set as default by subversion + * @param realm in which username/password will be used + * @param password target storage for password + * @param maySave in/out set false to not save + * @return continue action? + * @retval true continue + */ + virtual bool + contextGetLogin (const TQString & realm, + TQString & username, + TQString & password, + bool & maySave) = 0; + /** + * this method will be called to retrieve + * authentication information stored not by subversion. This + * will only called once! + * + * @param username username set as default by subversion + * @param realm in which username/password will be used + * @param password target storage for password + * @return continue action? should only in case of emergency return false. + * @retval true continue + */ + virtual bool + contextGetSavedLogin(const TQString & realm, + TQString & username, + TQString & password) = 0; + /** + * this method will be called to retrieve + * authentication information stored not persistent. This + * will only called once! + * + * @param username username set as default by subversion + * @param realm in which username/password will be used + * @param password target storage for password + * @return continue action? should only in case of emergency return false. + * @retval true continue + */ + virtual bool + contextGetCachedLogin(const TQString & realm, + TQString & username, + TQString & password) = 0; + + /** + * this method will be called to notify about + * the progress of an ongoing action + * + * @param path + * @param action + * @param kind + * @param mime_type + * @param content_state + * @param prop_state + * @param revision + */ + virtual void + contextNotify (const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision) = 0; + /** + * this method will be called to notify about + * the progress of an ongoing action + * + * @param action the action got notified about + * @since subversion 1.2 + */ + virtual void + contextNotify (const svn_wc_notify_t *action) = 0; + /** + * this method will be called periodically to allow + * the app to cancel long running operations + * + * @return cancel action? + * @retval true cancel + */ + virtual bool + contextCancel() = 0; + + /** + * this method will be called to retrieve + * a log message + * + * WORKAROUND FOR apr_xlate PROBLEM: + * STRINGS ALREADY HAVE TO BE UTF8!!! + * + * @param msg log message + * @return continue action? + * @retval true continue + */ + virtual bool + contextGetLogMessage (TQString & msg,const CommitItemList&) = 0; + + typedef enum + { + DONT_ACCEPT = 0, + ACCEPT_TEMPORARILY, + ACCEPT_PERMANENTLY + } SslServerTrustAnswer; + + + /** + * @see contextSslServerTrust + * @see svn_auth_cred_ssl_server_trust_t + */ + struct SslServerTrustData + { + public: + /** bit coded failures */ + const apr_uint32_t failures; + + /** certificate information */ + TQString hostname; + TQString fingerprint; + TQString validFrom; + TQString validUntil; + TQString issuerDName; + TQString realm; + bool maySave; + + SslServerTrustData (const apr_uint32_t failures_) + : failures (failures_), hostname (""), fingerprint (""), + validFrom (""), validUntil (""), issuerDName (""), + realm (""), maySave (true) + { + } + }; + + + /** + * this method is called if there is ssl server + * information, that has to be confirmed by the user + * + * @param data + * @param acceptedFailures + * @return @a SslServerTrustAnswer + */ + virtual SslServerTrustAnswer + contextSslServerTrustPrompt (const SslServerTrustData & data, + apr_uint32_t & acceptedFailures) = 0; + + /** + * this method is called to retrieve client side + * information + */ + virtual bool + contextSslClientCertPrompt (TQString & certFile) = 0; + + /** + * this method is called to retrieve the password + * for the client certificate + * + * @param password + * @param realm + * @param maySave + */ + virtual bool + contextSslClientCertPwPrompt (TQString & password, + const TQString & realm, + bool & maySave) = 0; + /** + * this method is called to retrieve the password + * for the client certificate from a local storage or such. it will called only once. + * + * @param password + * @param realm + */ + virtual bool + contextLoadSslClientCertPw(TQString&password,const TQString&realm)=0; + + virtual void + contextProgress(long long int current, long long int max) = 0; + + /** + * try to translate a text. In current implementation does + * nothing than returning the origin but may used to get an + * application specific translation. + * @param what text to translate + * @return translated text or origin. + */ + virtual TQString translate(const TQString&what){return what;} + + /** Callback for svn_wc_conflict_resolver_func_t in subversion 1.5 + * This method is only useful when build with subverion 1.5 or above. The default implementation sets + * result to ConflictResult::ChoosePostpone. Then conflicts while merge, update and switch results in an + * item with "conflict" status set. + * + * @param result The result where to store + * @param description description of conflict. + * @return true if result may used and operaion should continue. + * @sa svn_wc_conflict_description_t, svn_wc_conflict_result_t + * @since subversion 1.5 + */ + virtual bool contextConflictResolve(ConflictResult&result,const ConflictDescription&description); + }; +} + +#endif diff --git a/src/svnqt/context_listener.hpp b/src/svnqt/context_listener.hpp deleted file mode 100644 index 5be3c59..0000000 --- a/src/svnqt/context_listener.hpp +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_CONTEXT_LISTENER_HPP_ -#define _SVNCPP_CONTEXT_LISTENER_HPP_ - -// svncpp -#include "pool.hpp" -#include "commititem.hpp" -#include "svnqt_defines.hpp" -// qt -#include -// Subversion api -#include - - -namespace svn -{ - class ConflictResult; - class ConflictDescription; - /** - * This is the interface that is used by @a Context - * for callbacks. - * To use this you will have to inherit from this - * interface and overwrite the virtual methods. - */ - class SVNTQT_EXPORT ContextListener - { - public: - /** - * empty destructor avoids a lot of compiler warnings - */ - virtual ~ContextListener(){} - /** - * this method will be called to retrieve - * authentication information. This will called until valid information were - * inserted or it returns false. - * - * @param username username set as default by subversion - * @param realm in which username/password will be used - * @param password target storage for password - * @param maySave in/out set false to not save - * @return continue action? - * @retval true continue - */ - virtual bool - contextGetLogin (const TQString & realm, - TQString & username, - TQString & password, - bool & maySave) = 0; - /** - * this method will be called to retrieve - * authentication information stored not by subversion. This - * will only called once! - * - * @param username username set as default by subversion - * @param realm in which username/password will be used - * @param password target storage for password - * @return continue action? should only in case of emergency return false. - * @retval true continue - */ - virtual bool - contextGetSavedLogin(const TQString & realm, - TQString & username, - TQString & password) = 0; - /** - * this method will be called to retrieve - * authentication information stored not persistent. This - * will only called once! - * - * @param username username set as default by subversion - * @param realm in which username/password will be used - * @param password target storage for password - * @return continue action? should only in case of emergency return false. - * @retval true continue - */ - virtual bool - contextGetCachedLogin(const TQString & realm, - TQString & username, - TQString & password) = 0; - - /** - * this method will be called to notify about - * the progress of an ongoing action - * - * @param path - * @param action - * @param kind - * @param mime_type - * @param content_state - * @param prop_state - * @param revision - */ - virtual void - contextNotify (const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision) = 0; - /** - * this method will be called to notify about - * the progress of an ongoing action - * - * @param action the action got notified about - * @since subversion 1.2 - */ - virtual void - contextNotify (const svn_wc_notify_t *action) = 0; - /** - * this method will be called periodically to allow - * the app to cancel long running operations - * - * @return cancel action? - * @retval true cancel - */ - virtual bool - contextCancel() = 0; - - /** - * this method will be called to retrieve - * a log message - * - * WORKAROUND FOR apr_xlate PROBLEM: - * STRINGS ALREADY HAVE TO BE UTF8!!! - * - * @param msg log message - * @return continue action? - * @retval true continue - */ - virtual bool - contextGetLogMessage (TQString & msg,const CommitItemList&) = 0; - - typedef enum - { - DONT_ACCEPT = 0, - ACCEPT_TEMPORARILY, - ACCEPT_PERMANENTLY - } SslServerTrustAnswer; - - - /** - * @see contextSslServerTrust - * @see svn_auth_cred_ssl_server_trust_t - */ - struct SslServerTrustData - { - public: - /** bit coded failures */ - const apr_uint32_t failures; - - /** certificate information */ - TQString hostname; - TQString fingerprint; - TQString validFrom; - TQString validUntil; - TQString issuerDName; - TQString realm; - bool maySave; - - SslServerTrustData (const apr_uint32_t failures_) - : failures (failures_), hostname (""), fingerprint (""), - validFrom (""), validUntil (""), issuerDName (""), - realm (""), maySave (true) - { - } - }; - - - /** - * this method is called if there is ssl server - * information, that has to be confirmed by the user - * - * @param data - * @param acceptedFailures - * @return @a SslServerTrustAnswer - */ - virtual SslServerTrustAnswer - contextSslServerTrustPrompt (const SslServerTrustData & data, - apr_uint32_t & acceptedFailures) = 0; - - /** - * this method is called to retrieve client side - * information - */ - virtual bool - contextSslClientCertPrompt (TQString & certFile) = 0; - - /** - * this method is called to retrieve the password - * for the client certificate - * - * @param password - * @param realm - * @param maySave - */ - virtual bool - contextSslClientCertPwPrompt (TQString & password, - const TQString & realm, - bool & maySave) = 0; - /** - * this method is called to retrieve the password - * for the client certificate from a local storage or such. it will called only once. - * - * @param password - * @param realm - */ - virtual bool - contextLoadSslClientCertPw(TQString&password,const TQString&realm)=0; - - virtual void - contextProgress(long long int current, long long int max) = 0; - - /** - * try to translate a text. In current implementation does - * nothing than returning the origin but may used to get an - * application specific translation. - * @param what text to translate - * @return translated text or origin. - */ - virtual TQString translate(const TQString&what){return what;} - - /** Callback for svn_wc_conflict_resolver_func_t in subversion 1.5 - * This method is only useful when build with subverion 1.5 or above. The default implementation sets - * result to ConflictResult::ChoosePostpone. Then conflicts while merge, update and switch results in an - * item with "conflict" status set. - * - * @param result The result where to store - * @param description description of conflict. - * @return true if result may used and operaion should continue. - * @sa svn_wc_conflict_description_t, svn_wc_conflict_result_t - * @since subversion 1.5 - */ - virtual bool contextConflictResolve(ConflictResult&result,const ConflictDescription&description); - }; -} - -#endif diff --git a/src/svnqt/contextdata.cpp b/src/svnqt/contextdata.cpp index 59d724a..b670598 100644 --- a/src/svnqt/contextdata.cpp +++ b/src/svnqt/contextdata.cpp @@ -19,10 +19,10 @@ ***************************************************************************/ -#include "contextdata.hpp" -#include "context_listener.hpp" -#include "conflictresult.hpp" -#include "conflictdescription.hpp" +#include "contextdata.h" +#include "context_listener.h" +#include "conflictresult.h" +#include "conflictdescription.h" #include #include diff --git a/src/svnqt/contextdata.h b/src/svnqt/contextdata.h new file mode 100644 index 0000000..6d41326 --- /dev/null +++ b/src/svnqt/contextdata.h @@ -0,0 +1,338 @@ +/*************************************************************************** + * Copyright (C) 2005-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SVNCONTEXTDATA_HPP +#define SVNCONTEXTDATA_HPP + +#include "svnqt/pool.h" +#include "svnqt/apr.h" +#include "svnqt/commititem.h" +#include "svnqt/svnqt_defines.h" + +#include +#if (SVN_VER_MAJOR >= 1) && (SVN_VER_MINOR >= 4) +#include +#endif +#include + +struct svn_wc_conflict_result_t; +struct svn_wc_conflict_description_t; + +namespace svn { + + class ContextListener; +/** + @author Rajko Albrecht +*/ + +class SVNTQT_NOEXPORT ContextData{ +public: + ContextData(const TQString & configDir_); + ~ContextData(); + + // data methods + svn_client_ctx_t*ctx(); + const TQString&configDir()const; + void setListener (ContextListener * listener); + ContextListener * getListener () const; + void reset(); + + // svn methods + void setAuthCache(bool value); + /** @see Context::setLogin */ + void setLogin (const TQString& usr, const TQString& pwd); + /** @see Context::setLogMessage */ + void setLogMessage (const TQString& msg); + const TQString&getLogMessage ()const; + /** + * if the @a listener is set, use it to retrieve the log + * message using ContextListener::contextGetLogMessage. + * This return values is given back, then. + * + * if the @a listener is not set the its checked whether + * the log message has been set using @a setLogMessage + * yet. If not, return false otherwise true + * + * @param msg log message + * @retval false cancel + */ + bool retrieveLogMessage (TQString & msg,const CommitItemList&); + + /** + * if the @a listener is set call the method + * @a contextNotify + */ + void notify (const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision); + void notify (const svn_wc_notify_t *action); + /** + * if the @a listener is set call the method + * @a contextCancel + */ + bool cancel(); + const TQString& getUsername () const; + const TQString& getPassword () const; + + /** + * if the @a listener is set and no password has been + * set yet, use it to retrieve login and password using + * ContextListener::contextGetLogin. + * + * if the @a listener is not set, check if setLogin + * has been called yet. + * + * @return continue? + * @retval false cancel + */ + bool + retrieveLogin (const char * username_, + const char * realm, + bool &may_save); + /** + * if the @a listener is set and no password has been + * set yet, use it to retrieve login and password using + * ContextListener::contextGetSavedLogin. + * + * if the @a listener is not set, check if setLogin + * has been called yet. + * + * @return continue? + * @retval false cancel + */ + bool + retrieveSavedLogin(const char * username_, + const char * realm, + bool &may_save); + /** + * if the @a listener is set and no password has been + * set yet, use it to retrieve login and password using + * ContextListener::contextGetCachedLogin. + * + * if the @a listener is not set, check if setLogin + * has been called yet. + * + * @return continue? + * @retval false cancel + */ + bool + retrieveCachedLogin(const char * username_, + const char * realm, + bool &may_save); + +protected: + // static methods + /** + * the @a baton is interpreted as ContextData * + * Several checks are performed on the baton: + * - baton == 0? + * - baton->Data + * - listener set? + * + * @param baton + * @param data returned data if everything is OK + * @retval SVN_NO_ERROR if everything is fine + * @retval SVN_ERR_CANCELLED on invalid values + */ + static svn_error_t * + getContextData (void * baton, ContextData ** data); + + /** + * this function gets called by the subversion api function + * when a log message is needed. This is the case on a commit + * for example + */ + static svn_error_t * + onLogMsg (const char **log_msg, + const char **tmp_file, + apr_array_header_t * commit_items, + void *baton, + apr_pool_t * pool); + + /** + * this function gets called by the subversion api function + * when a log message is needed. This is the case on a commit + * for example + */ + static svn_error_t * + onLogMsg2 (const char **log_msg, + const char **tmp_file, + const apr_array_header_t * commit_items, + void *baton, + apr_pool_t * pool); + +#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5) || (SVN_VER_MAJOR > 2)) + /** + * this function gets called by the subversion api function + * when a log message is needed. This is the case on a commit + * for example + */ + static svn_error_t * + onLogMsg3 (const char **log_msg, + const char **tmp_file, + const apr_array_header_t * commit_items, + void *baton, + apr_pool_t * pool); +#endif + + /** + * this is the callback function for the subversion + * api functions to signal the progress of an action + */ + static void + onNotify (void * baton, + const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision); + /** + * this is the callback function for the subversion 1.2 + * api functions to signal the progress of an action + * + * @todo right now we forward only to @a onNotify, + * but maybe we should a notify2 to the listener + * @since subversion 1.2 + */ + static void + onNotify2(void*baton,const svn_wc_notify_t *action,apr_pool_t */*tpool*/); + /** + * this is the callback function for the subversion + * api functions to signal the progress of an action + * @param baton pointer to a ContextData instance + */ + static svn_error_t * onCancel (void * baton); + + /** + * @see svn_auth_simple_prompt_func_t + * this method is an alternate and called ONEs before onSimplePrompt. + * So we can try load password from other source. + */ + static svn_error_t * + onCachedPrompt(svn_auth_cred_simple_t **cred, + void *baton, + const char *realm, + const char *username, + svn_boolean_t _may_save, + apr_pool_t *pool); + + /** + * @see svn_auth_simple_prompt_func_t + * this method is an alternate and called ONEs before onSimplePrompt. + * So we can try load password from other source. + */ + static svn_error_t * + onSavedPrompt(svn_auth_cred_simple_t **cred, + void *baton, + const char *realm, + const char *username, + svn_boolean_t _may_save, + apr_pool_t *pool); + /** + * @see svn_auth_simple_prompt_func_t + */ + static svn_error_t * + onSimplePrompt (svn_auth_cred_simple_t **cred, + void *baton, + const char *realm, + const char *username, + svn_boolean_t _may_save, + apr_pool_t *pool); + /** + * @see svn_auth_ssl_server_trust_prompt_func_t + */ + static svn_error_t * + onSslServerTrustPrompt (svn_auth_cred_ssl_server_trust_t **cred, + void *baton, + const char *realm, + apr_uint32_t failures, + const svn_auth_ssl_server_cert_info_t *info, + svn_boolean_t may_save, + apr_pool_t *pool); + static svn_error_t * + onSslClientCertPrompt (svn_auth_cred_ssl_client_cert_t **cred, + void *baton, + apr_pool_t *pool); + /** + * @see svn_auth_ssl_client_cert_pw_prompt_func_t + */ + static svn_error_t * + onFirstSslClientCertPw ( + svn_auth_cred_ssl_client_cert_pw_t **cred, + void *baton, + const char *realm, + svn_boolean_t maySave, + apr_pool_t *pool); + + /** + * @see svn_auth_ssl_client_cert_pw_prompt_func_t + */ + static svn_error_t * + onSslClientCertPwPrompt ( + svn_auth_cred_ssl_client_cert_pw_t **cred, + void *baton, + const char *realm, + svn_boolean_t maySave, + apr_pool_t *pool); + + /** + * @see svn_client_ctx_t::progress_func + */ + static void onProgress(apr_off_t progress, apr_off_t total, void *baton, apr_pool_t *pool); + + /** + * @see svn_wc_conflict_resolver_func_t + * @since subversion 1.5 + */ + static svn_error_t* onWcConflictResolver(svn_wc_conflict_result_t**result,const svn_wc_conflict_description_t *description, void *baton, apr_pool_t *pool); + + // extra methods + svn_error_t * + generate_cancel_error(); + +#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5) || (SVN_VER_MAJOR > 2)) + /** read in mimetypes map + * @since subversion 1.5 + */ + void initMimeTypes(); +#endif +protected: + Apr apr; + + ContextListener * listener; + bool logIsSet; + int m_promptCounter; + Pool pool; + svn_client_ctx_t*m_ctx; + TQString username; + TQString password; + TQString logMessage; + TQString m_ConfigDir; + +}; + +} + +#endif diff --git a/src/svnqt/contextdata.hpp b/src/svnqt/contextdata.hpp deleted file mode 100644 index e38c6f2..0000000 --- a/src/svnqt/contextdata.hpp +++ /dev/null @@ -1,338 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef SVNCONTEXTDATA_HPP -#define SVNCONTEXTDATA_HPP - -#include "svnqt/pool.hpp" -#include "svnqt/apr.hpp" -#include "svnqt/commititem.hpp" -#include "svnqt/svnqt_defines.hpp" - -#include -#if (SVN_VER_MAJOR >= 1) && (SVN_VER_MINOR >= 4) -#include -#endif -#include - -struct svn_wc_conflict_result_t; -struct svn_wc_conflict_description_t; - -namespace svn { - - class ContextListener; -/** - @author Rajko Albrecht -*/ - -class SVNTQT_NOEXPORT ContextData{ -public: - ContextData(const TQString & configDir_); - ~ContextData(); - - // data methods - svn_client_ctx_t*ctx(); - const TQString&configDir()const; - void setListener (ContextListener * listener); - ContextListener * getListener () const; - void reset(); - - // svn methods - void setAuthCache(bool value); - /** @see Context::setLogin */ - void setLogin (const TQString& usr, const TQString& pwd); - /** @see Context::setLogMessage */ - void setLogMessage (const TQString& msg); - const TQString&getLogMessage ()const; - /** - * if the @a listener is set, use it to retrieve the log - * message using ContextListener::contextGetLogMessage. - * This return values is given back, then. - * - * if the @a listener is not set the its checked whether - * the log message has been set using @a setLogMessage - * yet. If not, return false otherwise true - * - * @param msg log message - * @retval false cancel - */ - bool retrieveLogMessage (TQString & msg,const CommitItemList&); - - /** - * if the @a listener is set call the method - * @a contextNotify - */ - void notify (const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision); - void notify (const svn_wc_notify_t *action); - /** - * if the @a listener is set call the method - * @a contextCancel - */ - bool cancel(); - const TQString& getUsername () const; - const TQString& getPassword () const; - - /** - * if the @a listener is set and no password has been - * set yet, use it to retrieve login and password using - * ContextListener::contextGetLogin. - * - * if the @a listener is not set, check if setLogin - * has been called yet. - * - * @return continue? - * @retval false cancel - */ - bool - retrieveLogin (const char * username_, - const char * realm, - bool &may_save); - /** - * if the @a listener is set and no password has been - * set yet, use it to retrieve login and password using - * ContextListener::contextGetSavedLogin. - * - * if the @a listener is not set, check if setLogin - * has been called yet. - * - * @return continue? - * @retval false cancel - */ - bool - retrieveSavedLogin(const char * username_, - const char * realm, - bool &may_save); - /** - * if the @a listener is set and no password has been - * set yet, use it to retrieve login and password using - * ContextListener::contextGetCachedLogin. - * - * if the @a listener is not set, check if setLogin - * has been called yet. - * - * @return continue? - * @retval false cancel - */ - bool - retrieveCachedLogin(const char * username_, - const char * realm, - bool &may_save); - -protected: - // static methods - /** - * the @a baton is interpreted as ContextData * - * Several checks are performed on the baton: - * - baton == 0? - * - baton->Data - * - listener set? - * - * @param baton - * @param data returned data if everything is OK - * @retval SVN_NO_ERROR if everything is fine - * @retval SVN_ERR_CANCELLED on invalid values - */ - static svn_error_t * - getContextData (void * baton, ContextData ** data); - - /** - * this function gets called by the subversion api function - * when a log message is needed. This is the case on a commit - * for example - */ - static svn_error_t * - onLogMsg (const char **log_msg, - const char **tmp_file, - apr_array_header_t * commit_items, - void *baton, - apr_pool_t * pool); - - /** - * this function gets called by the subversion api function - * when a log message is needed. This is the case on a commit - * for example - */ - static svn_error_t * - onLogMsg2 (const char **log_msg, - const char **tmp_file, - const apr_array_header_t * commit_items, - void *baton, - apr_pool_t * pool); - -#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5) || (SVN_VER_MAJOR > 2)) - /** - * this function gets called by the subversion api function - * when a log message is needed. This is the case on a commit - * for example - */ - static svn_error_t * - onLogMsg3 (const char **log_msg, - const char **tmp_file, - const apr_array_header_t * commit_items, - void *baton, - apr_pool_t * pool); -#endif - - /** - * this is the callback function for the subversion - * api functions to signal the progress of an action - */ - static void - onNotify (void * baton, - const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision); - /** - * this is the callback function for the subversion 1.2 - * api functions to signal the progress of an action - * - * @todo right now we forward only to @a onNotify, - * but maybe we should a notify2 to the listener - * @since subversion 1.2 - */ - static void - onNotify2(void*baton,const svn_wc_notify_t *action,apr_pool_t */*tpool*/); - /** - * this is the callback function for the subversion - * api functions to signal the progress of an action - * @param baton pointer to a ContextData instance - */ - static svn_error_t * onCancel (void * baton); - - /** - * @see svn_auth_simple_prompt_func_t - * this method is an alternate and called ONEs before onSimplePrompt. - * So we can try load password from other source. - */ - static svn_error_t * - onCachedPrompt(svn_auth_cred_simple_t **cred, - void *baton, - const char *realm, - const char *username, - svn_boolean_t _may_save, - apr_pool_t *pool); - - /** - * @see svn_auth_simple_prompt_func_t - * this method is an alternate and called ONEs before onSimplePrompt. - * So we can try load password from other source. - */ - static svn_error_t * - onSavedPrompt(svn_auth_cred_simple_t **cred, - void *baton, - const char *realm, - const char *username, - svn_boolean_t _may_save, - apr_pool_t *pool); - /** - * @see svn_auth_simple_prompt_func_t - */ - static svn_error_t * - onSimplePrompt (svn_auth_cred_simple_t **cred, - void *baton, - const char *realm, - const char *username, - svn_boolean_t _may_save, - apr_pool_t *pool); - /** - * @see svn_auth_ssl_server_trust_prompt_func_t - */ - static svn_error_t * - onSslServerTrustPrompt (svn_auth_cred_ssl_server_trust_t **cred, - void *baton, - const char *realm, - apr_uint32_t failures, - const svn_auth_ssl_server_cert_info_t *info, - svn_boolean_t may_save, - apr_pool_t *pool); - static svn_error_t * - onSslClientCertPrompt (svn_auth_cred_ssl_client_cert_t **cred, - void *baton, - apr_pool_t *pool); - /** - * @see svn_auth_ssl_client_cert_pw_prompt_func_t - */ - static svn_error_t * - onFirstSslClientCertPw ( - svn_auth_cred_ssl_client_cert_pw_t **cred, - void *baton, - const char *realm, - svn_boolean_t maySave, - apr_pool_t *pool); - - /** - * @see svn_auth_ssl_client_cert_pw_prompt_func_t - */ - static svn_error_t * - onSslClientCertPwPrompt ( - svn_auth_cred_ssl_client_cert_pw_t **cred, - void *baton, - const char *realm, - svn_boolean_t maySave, - apr_pool_t *pool); - - /** - * @see svn_client_ctx_t::progress_func - */ - static void onProgress(apr_off_t progress, apr_off_t total, void *baton, apr_pool_t *pool); - - /** - * @see svn_wc_conflict_resolver_func_t - * @since subversion 1.5 - */ - static svn_error_t* onWcConflictResolver(svn_wc_conflict_result_t**result,const svn_wc_conflict_description_t *description, void *baton, apr_pool_t *pool); - - // extra methods - svn_error_t * - generate_cancel_error(); - -#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5) || (SVN_VER_MAJOR > 2)) - /** read in mimetypes map - * @since subversion 1.5 - */ - void initMimeTypes(); -#endif -protected: - Apr apr; - - ContextListener * listener; - bool logIsSet; - int m_promptCounter; - Pool pool; - svn_client_ctx_t*m_ctx; - TQString username; - TQString password; - TQString logMessage; - TQString m_ConfigDir; - -}; - -} - -#endif diff --git a/src/svnqt/datetime.cpp b/src/svnqt/datetime.cpp index 51625b3..6c0c269 100644 --- a/src/svnqt/datetime.cpp +++ b/src/svnqt/datetime.cpp @@ -32,7 +32,7 @@ #include "apr_date.h" // svncpp -#include "datetime.hpp" +#include "datetime.h" namespace svn diff --git a/src/svnqt/datetime.h b/src/svnqt/datetime.h new file mode 100644 index 0000000..bc740dd --- /dev/null +++ b/src/svnqt/datetime.h @@ -0,0 +1,161 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_DATETIME_HPP_ +#define _SVNCPP_DATETIME_HPP_ + +#include "svnqt/svnqt_defines.h" + +#include + +// subversion api +#include "svn_types.h" + + +namespace svn +{ + /** + * Class that encapsulates apr_time_t. + * + * @see apr_time_t + */ + class SVNTQT_EXPORT DateTime + { + private: + TQDateTime m_time; + + public: + + /** + * Default Constructor + */ + DateTime (); + + /** + * Constructor + * + * @param time number of microseconds since 00:00:00 january 1, 1970 UTC + */ + DateTime (const apr_time_t time); + + /** + * Constructor + * + * @param dt TQDateTime class + */ + DateTime(const TQDateTime&dt); + + /** + * Copy constructor + * + * @param dateTime Source + */ + DateTime (const DateTime & dateTime); + + /** + * @param dateTime Source + */ + const DateTime & + operator =(const DateTime & dateTime); + + /** + * @param dateTime Comparator + */ + bool + operator ==(const DateTime & dateTime); + /** + * @param dateTime Comparator + */ + bool + operator !=(const DateTime & dateTime); + + bool + operator<(const DateTime&dateTime)const; + bool + operator>(const DateTime&dateTime)const; + bool + operator!=(const DateTime&dateTime)const; + bool + operator==(const DateTime&dateTime)const; + bool + operator<=(const DateTime&dateTime)const; + bool + operator>=(const DateTime&dateTime)const; + + + /** + * @return Is a valid (non-zero) date + */ + bool + IsValid () const; + + /** + * @return APR apr_time_t + */ + apr_time_t + GetAPRTimeT () const; + + /** + * @return TQDateTime object + */ + operator const TQDateTime&()const; + + /** + * @return TQDateTime object + */ + const TQDateTime&toTQDateTime()const; + + /** + * @param format format string + * @return formatted string + * @see TQDateTime::toString + */ + TQString toString(const TQString&format)const; + + /** + * Set from date string of the form below, using apr_date_parse_rfc + * + *
+     *     Sun, 06 Nov 1994 08:49:37 GMT
+     * 
+ * + * @see apr_date_parse_rfc + * @return Successfully parsed + */ + bool + SetRFC822Date (const char* date); + + void setAprTime(apr_time_t aTime); + unsigned int toTime_t()const; + void setTime_t(unsigned int sec); + }; +} + +#endif diff --git a/src/svnqt/datetime.hpp b/src/svnqt/datetime.hpp deleted file mode 100644 index cd8f994..0000000 --- a/src/svnqt/datetime.hpp +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_DATETIME_HPP_ -#define _SVNCPP_DATETIME_HPP_ - -#include "svnqt/svnqt_defines.hpp" - -#include - -// subversion api -#include "svn_types.h" - - -namespace svn -{ - /** - * Class that encapsulates apr_time_t. - * - * @see apr_time_t - */ - class SVNTQT_EXPORT DateTime - { - private: - TQDateTime m_time; - - public: - - /** - * Default Constructor - */ - DateTime (); - - /** - * Constructor - * - * @param time number of microseconds since 00:00:00 january 1, 1970 UTC - */ - DateTime (const apr_time_t time); - - /** - * Constructor - * - * @param dt TQDateTime class - */ - DateTime(const TQDateTime&dt); - - /** - * Copy constructor - * - * @param dateTime Source - */ - DateTime (const DateTime & dateTime); - - /** - * @param dateTime Source - */ - const DateTime & - operator =(const DateTime & dateTime); - - /** - * @param dateTime Comparator - */ - bool - operator ==(const DateTime & dateTime); - /** - * @param dateTime Comparator - */ - bool - operator !=(const DateTime & dateTime); - - bool - operator<(const DateTime&dateTime)const; - bool - operator>(const DateTime&dateTime)const; - bool - operator!=(const DateTime&dateTime)const; - bool - operator==(const DateTime&dateTime)const; - bool - operator<=(const DateTime&dateTime)const; - bool - operator>=(const DateTime&dateTime)const; - - - /** - * @return Is a valid (non-zero) date - */ - bool - IsValid () const; - - /** - * @return APR apr_time_t - */ - apr_time_t - GetAPRTimeT () const; - - /** - * @return TQDateTime object - */ - operator const TQDateTime&()const; - - /** - * @return TQDateTime object - */ - const TQDateTime&toTQDateTime()const; - - /** - * @param format format string - * @return formatted string - * @see TQDateTime::toString - */ - TQString toString(const TQString&format)const; - - /** - * Set from date string of the form below, using apr_date_parse_rfc - * - *
-     *     Sun, 06 Nov 1994 08:49:37 GMT
-     * 
- * - * @see apr_date_parse_rfc - * @return Successfully parsed - */ - bool - SetRFC822Date (const char* date); - - void setAprTime(apr_time_t aTime); - unsigned int toTime_t()const; - void setTime_t(unsigned int sec); - }; -} - -#endif diff --git a/src/svnqt/diff_data.cpp b/src/svnqt/diff_data.cpp index 756e771..0559a8e 100644 --- a/src/svnqt/diff_data.cpp +++ b/src/svnqt/diff_data.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "diff_data.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/exception.hpp" +#include "diff_data.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/exception.h" #include diff --git a/src/svnqt/diff_data.h b/src/svnqt/diff_data.h new file mode 100644 index 0000000..e0eb757 --- /dev/null +++ b/src/svnqt/diff_data.h @@ -0,0 +1,71 @@ +/*************************************************************************** + * Copyright (C) 2008 by Rajko Albrecht ral@alwins-world.de * + * http://tdesvn.alwins-world.de/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef __DIFF_DATA +#define __DIFF_DATA + +#include "svnqt/svnqt_defines.h" +#include "svnqt/pool.h" +#include "path.h" +#include "revision.h" + +#include + +#include + +struct apr_file_t; + +namespace svn +{ + class Path; + + class SVNTQT_NOEXPORT DiffData + { + protected: + Pool m_Pool; + Path m_tmpPath; + apr_file_t*m_outFile; + apr_file_t*m_errFile; + const char*m_outFileName; + const char*m_errFileName; + + Path m_p1,m_p2; + Revision m_r1,m_r2; + + bool m_working_copy_present,m_url_is_present; + + void init(); + void clean(); + void close(); + + public: + DiffData(const Path&aTmpPath,const Path&,const Revision&,const Path&,const Revision&); + virtual ~DiffData(); + + apr_file_t*outFile(){return m_outFile;} + apr_file_t*errFile(){return m_errFile;} + const Revision& r1()const{return m_r1;} + const Revision& r2()const{return m_r2;} + + TQByteArray content(); + }; +} + +#endif diff --git a/src/svnqt/diff_data.hpp b/src/svnqt/diff_data.hpp deleted file mode 100644 index 92664b7..0000000 --- a/src/svnqt/diff_data.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Rajko Albrecht ral@alwins-world.de * - * http://tdesvn.alwins-world.de/ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef __DIFF_DATA -#define __DIFF_DATA - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/pool.hpp" -#include "path.hpp" -#include "revision.hpp" - -#include - -#include - -struct apr_file_t; - -namespace svn -{ - class Path; - - class SVNTQT_NOEXPORT DiffData - { - protected: - Pool m_Pool; - Path m_tmpPath; - apr_file_t*m_outFile; - apr_file_t*m_errFile; - const char*m_outFileName; - const char*m_errFileName; - - Path m_p1,m_p2; - Revision m_r1,m_r2; - - bool m_working_copy_present,m_url_is_present; - - void init(); - void clean(); - void close(); - - public: - DiffData(const Path&aTmpPath,const Path&,const Revision&,const Path&,const Revision&); - virtual ~DiffData(); - - apr_file_t*outFile(){return m_outFile;} - apr_file_t*errFile(){return m_errFile;} - const Revision& r1()const{return m_r1;} - const Revision& r2()const{return m_r2;} - - TQByteArray content(); - }; -} - -#endif diff --git a/src/svnqt/diffoptions.cpp b/src/svnqt/diffoptions.cpp index 68681d9..499ff22 100644 --- a/src/svnqt/diffoptions.cpp +++ b/src/svnqt/diffoptions.cpp @@ -18,9 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "diffoptions.hpp" -#include "stringarray.hpp" -#include "pool.hpp" +#include "diffoptions.h" +#include "stringarray.h" +#include "pool.h" #include diff --git a/src/svnqt/diffoptions.h b/src/svnqt/diffoptions.h new file mode 100644 index 0000000..fc72461 --- /dev/null +++ b/src/svnqt/diffoptions.h @@ -0,0 +1,79 @@ +/*************************************************************************** + * Copyright (C) 2007 by Rajko Albrecht ral@alwins-world.de * + * http://tdesvn.alwins-world.de/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _DIFF_OPTIONS_HPP +#define _DIFF_OPTIONS_HPP + +#include "svnqt/svnqt_defines.h" + +namespace svn { + class Pool; + struct DiffOptionsData; +} + +struct svn_diff_file_options_t; +class TQStringList; + +namespace svn +{ + /** c++ wrapper for svn_diffoptions_t + * + * This is needed until svnqt stops support for subversion prior 1.4 + */ + class SVNTQT_EXPORT DiffOptions + { + public: + enum IgnoreSpace { + IgnoreSpaceNone, + IgnoreSpaceChange, + IgnoreSpaceAll + }; + protected: + DiffOptionsData* m_data; + void init(const svn_diff_file_options_t*options); + + public: + DiffOptions(); + /** Initialize options with values depending on options. + * Supported types are: + * - --ignore-space-change, -b + * - --ignore-all-space, -w + * - --ignore-eol-style + * - --unified, -u (for compatibility, does nothing). + * @sa svn_diff_file_options_parse + */ + DiffOptions(const TQStringList&options); + + /** Initialize options with values depending on options. + * Only if build against subversion 1.4 or newer. + */ + DiffOptions(const svn_diff_file_options_t*options); + + /** copy operator + */ + DiffOptions(const DiffOptions&old); + + ~DiffOptions(); + + svn_diff_file_options_t*options(const Pool&pool)const; + }; +} + +#endif diff --git a/src/svnqt/diffoptions.hpp b/src/svnqt/diffoptions.hpp deleted file mode 100644 index 17e9a98..0000000 --- a/src/svnqt/diffoptions.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007 by Rajko Albrecht ral@alwins-world.de * - * http://tdesvn.alwins-world.de/ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef _DIFF_OPTIONS_HPP -#define _DIFF_OPTIONS_HPP - -#include "svnqt/svnqt_defines.hpp" - -namespace svn { - class Pool; - struct DiffOptionsData; -} - -struct svn_diff_file_options_t; -class TQStringList; - -namespace svn -{ - /** c++ wrapper for svn_diffoptions_t - * - * This is needed until svnqt stops support for subversion prior 1.4 - */ - class SVNTQT_EXPORT DiffOptions - { - public: - enum IgnoreSpace { - IgnoreSpaceNone, - IgnoreSpaceChange, - IgnoreSpaceAll - }; - protected: - DiffOptionsData* m_data; - void init(const svn_diff_file_options_t*options); - - public: - DiffOptions(); - /** Initialize options with values depending on options. - * Supported types are: - * - --ignore-space-change, -b - * - --ignore-all-space, -w - * - --ignore-eol-style - * - --unified, -u (for compatibility, does nothing). - * @sa svn_diff_file_options_parse - */ - DiffOptions(const TQStringList&options); - - /** Initialize options with values depending on options. - * Only if build against subversion 1.4 or newer. - */ - DiffOptions(const svn_diff_file_options_t*options); - - /** copy operator - */ - DiffOptions(const DiffOptions&old); - - ~DiffOptions(); - - svn_diff_file_options_t*options(const Pool&pool)const; - }; -} - -#endif diff --git a/src/svnqt/dirent.cpp b/src/svnqt/dirent.cpp index f20ed23..c732ed8 100644 --- a/src/svnqt/dirent.cpp +++ b/src/svnqt/dirent.cpp @@ -29,9 +29,9 @@ */ // svncpp -#include "svnqt/dirent.hpp" -#include "svnqt/lock_entry.hpp" -#include "svnqt/svnqt_defines.hpp" +#include "svnqt/dirent.h" +#include "svnqt/lock_entry.h" +#include "svnqt/svnqt_defines.h" #include diff --git a/src/svnqt/dirent.h b/src/svnqt/dirent.h new file mode 100644 index 0000000..b74807a --- /dev/null +++ b/src/svnqt/dirent.h @@ -0,0 +1,126 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_DIRENT_HPP_ +#define _SVNCPP_DIRENT_HPP_ + +#include "svnqt/svnqt_defines.h" +#include "svnqt/lock_entry.h" +#include "svnqt/datetime.h" + +// subversion api +#include "svn_client.h" + +#include + +namespace svn +{ + class DirEntry_Data; + + class SVNTQT_EXPORT DirEntry + { + public: + /** + * default constructor + */ + DirEntry (); + + /** + * constructor for existing @a svn_dirent_t entries + */ + DirEntry (const TQString& name, const svn_dirent_t * dirEntry); + /** + * constructor for existing @a svn_dirent_t entries + */ + DirEntry (const TQString& name, const svn_dirent_t * dirEntry,const svn_lock_t*lockEntry); + + DirEntry (const TQString& name, const svn_dirent_t * dirEntry,const LockEntry&lockEntry); + /** + * copy constructor + */ + DirEntry (const DirEntry & src); + + /** + * destructor + */ + ~DirEntry (); + + /** + * assignment operator + */ + DirEntry & + operator = (const DirEntry &); + + const TQString& + name () const; + + svn_node_kind_t + kind () const; + + TQLONG + size () const; + + bool + hasProps () const; + + svn_revnum_t + createdRev () const; + + const DateTime& + time () const; + + const TQString& + lastAuthor () const; + + //! The assigned lock entry + /*! + * returns the assigned lock entry if set + * \return a valid or an empty lock + */ + const LockEntry& + lockEntry() const; + + //! initialize and convert the internal lock entry + /*! + * This method should not needed to call outside the lib, it may just used + * inside svn::Client::ls. + * \param aLock the subversion lock description to convert. + */ + void + setLock(const svn_lock_t*aLock); + + + private: + DirEntry_Data * m; + + }; +} + +#endif diff --git a/src/svnqt/dirent.hpp b/src/svnqt/dirent.hpp deleted file mode 100644 index df5be78..0000000 --- a/src/svnqt/dirent.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_DIRENT_HPP_ -#define _SVNCPP_DIRENT_HPP_ - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/lock_entry.hpp" -#include "svnqt/datetime.hpp" - -// subversion api -#include "svn_client.h" - -#include - -namespace svn -{ - class DirEntry_Data; - - class SVNTQT_EXPORT DirEntry - { - public: - /** - * default constructor - */ - DirEntry (); - - /** - * constructor for existing @a svn_dirent_t entries - */ - DirEntry (const TQString& name, const svn_dirent_t * dirEntry); - /** - * constructor for existing @a svn_dirent_t entries - */ - DirEntry (const TQString& name, const svn_dirent_t * dirEntry,const svn_lock_t*lockEntry); - - DirEntry (const TQString& name, const svn_dirent_t * dirEntry,const LockEntry&lockEntry); - /** - * copy constructor - */ - DirEntry (const DirEntry & src); - - /** - * destructor - */ - ~DirEntry (); - - /** - * assignment operator - */ - DirEntry & - operator = (const DirEntry &); - - const TQString& - name () const; - - svn_node_kind_t - kind () const; - - TQLONG - size () const; - - bool - hasProps () const; - - svn_revnum_t - createdRev () const; - - const DateTime& - time () const; - - const TQString& - lastAuthor () const; - - //! The assigned lock entry - /*! - * returns the assigned lock entry if set - * \return a valid or an empty lock - */ - const LockEntry& - lockEntry() const; - - //! initialize and convert the internal lock entry - /*! - * This method should not needed to call outside the lib, it may just used - * inside svn::Client::ls. - * \param aLock the subversion lock description to convert. - */ - void - setLock(const svn_lock_t*aLock); - - - private: - DirEntry_Data * m; - - }; -} - -#endif diff --git a/src/svnqt/entry.cpp b/src/svnqt/entry.cpp index 67090dc..e31c76f 100644 --- a/src/svnqt/entry.cpp +++ b/src/svnqt/entry.cpp @@ -29,7 +29,7 @@ */ // svncpp -#include "entry.hpp" +#include "entry.h" namespace svn { diff --git a/src/svnqt/entry.h b/src/svnqt/entry.h new file mode 100644 index 0000000..cca6f43 --- /dev/null +++ b/src/svnqt/entry.h @@ -0,0 +1,240 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ +#ifndef _SVNCPP_ENTRY_HPP_ +#define _SVNCPP_ENTRY_HPP_ + +// svncpp +#include "svnqt/pool.h" +#include "svnqt/lock_entry.h" +#include "svnqt/dirent.h" +#include "svnqt/info_entry.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/svnqttypes.h" + +// subversion api +#include "svn_wc.h" + + +#include + +namespace svn +{ + class Entry_private; + /** + * C++ API for Subversion. + * This class wraps around @a svn_wc_entry_t. + */ + class SVNTQT_EXPORT Entry + { + public: + /** + * default constructor. if @a src is set, + * copy its contents. + * + * If @a src is not set (=0) this will be + * a non-versioned entry. This can be checked + * later with @a isValid (). + * + * @param src another entry to copy from + */ + Entry (const svn_wc_entry_t * src = 0); + + /** + * copy constructor + */ + Entry (const Entry & src); + + /** + * converting constructr + */ + Entry (const TQString&url,const DirEntryPtr&src); + /** + * converting constructr + */ + Entry (const TQString&url,const InfoEntry&src); + + /** + * destructor + */ + virtual ~Entry (); + + /** + * returns whether this is a valid=versioned + * entry. + * + * @return is entry valid + * @retval true valid entry + * @retval false invalid or unversioned entry + */ + bool isValid () const; + /** + * @return entry's name + */ + const TQString& + name () const; + /** + * @return base revision + */ + svn_revnum_t + revision () const; + /** + * @return url in repository + */ + const TQString& + url () const; + + /** + * @return canonical repository url + */ + const TQString& + repos () const; + /** + * @return repository uuid + */ + const TQString& + uuid () const; + /** + * @return node kind (file, dir, ...) + */ + svn_node_kind_t + kind () const; + /** + * @return scheduling (add, delete, replace) + */ + svn_wc_schedule_t + schedule () const; + /** + * @return TRUE if copied + */ + bool + isCopied () const; + /** + * @return true if deleted + */ + bool + isDeleted () const; + /** + * @return true if deleted + */ + bool + isAbsent () const; + /** + * @return copyfrom location + */ + const TQString& + copyfromUrl () const; + /** + * @return copyfrom revision + */ + svn_revnum_t + copyfromRev () const; + /** + * @return old version of conflicted file + */ + const TQString& + conflictOld () const; + /** + * @return new version of conflicted file + */ + const TQString& + conflictNew () const; + /** + * @return working version of conflicted file + */ + const TQString& + conflictWrk () const; + /** + * @return property reject file + */ + const TQString& + prejfile () const; + /** + * @return last up-to-date time for text contents + * @retval 0 no information available + */ + const DateTime& + textTime () const; + /** + * @return last up-to-date time for properties + * @retval 0 no information available + */ + const DateTime& + propTime()const; + + /** + * @return base64 encoded checksum + * @retval NULL for backwards compatibility + */ + const TQString& + checksum () const; + + /** + * @return last revision this was changed + */ + svn_revnum_t + cmtRev () const; + + /** + * @return last date this was changed + */ + const DateTime& + cmtDate () const; + + /** + * @return last commit author of this file + */ + const TQString& + cmtAuthor () const; + + /** + * @return lock for that entry + * @since subversion 1.2 + */ + const LockEntry& + lockEntry()const; + + /** + * @return true if entry is marked as dir + */ + bool isDir()const; + /** + * assignment operator + */ + Entry & + operator = (const Entry &); + bool isFile()const; + + private: + Entry_private*m_Data; + }; + +} + +#endif diff --git a/src/svnqt/entry.hpp b/src/svnqt/entry.hpp deleted file mode 100644 index 44e92c3..0000000 --- a/src/svnqt/entry.hpp +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ -#ifndef _SVNCPP_ENTRY_HPP_ -#define _SVNCPP_ENTRY_HPP_ - -// svncpp -#include "svnqt/pool.hpp" -#include "svnqt/lock_entry.hpp" -#include "svnqt/dirent.hpp" -#include "svnqt/info_entry.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/svnqttypes.hpp" - -// subversion api -#include "svn_wc.h" - - -#include - -namespace svn -{ - class Entry_private; - /** - * C++ API for Subversion. - * This class wraps around @a svn_wc_entry_t. - */ - class SVNTQT_EXPORT Entry - { - public: - /** - * default constructor. if @a src is set, - * copy its contents. - * - * If @a src is not set (=0) this will be - * a non-versioned entry. This can be checked - * later with @a isValid (). - * - * @param src another entry to copy from - */ - Entry (const svn_wc_entry_t * src = 0); - - /** - * copy constructor - */ - Entry (const Entry & src); - - /** - * converting constructr - */ - Entry (const TQString&url,const DirEntryPtr&src); - /** - * converting constructr - */ - Entry (const TQString&url,const InfoEntry&src); - - /** - * destructor - */ - virtual ~Entry (); - - /** - * returns whether this is a valid=versioned - * entry. - * - * @return is entry valid - * @retval true valid entry - * @retval false invalid or unversioned entry - */ - bool isValid () const; - /** - * @return entry's name - */ - const TQString& - name () const; - /** - * @return base revision - */ - svn_revnum_t - revision () const; - /** - * @return url in repository - */ - const TQString& - url () const; - - /** - * @return canonical repository url - */ - const TQString& - repos () const; - /** - * @return repository uuid - */ - const TQString& - uuid () const; - /** - * @return node kind (file, dir, ...) - */ - svn_node_kind_t - kind () const; - /** - * @return scheduling (add, delete, replace) - */ - svn_wc_schedule_t - schedule () const; - /** - * @return TRUE if copied - */ - bool - isCopied () const; - /** - * @return true if deleted - */ - bool - isDeleted () const; - /** - * @return true if deleted - */ - bool - isAbsent () const; - /** - * @return copyfrom location - */ - const TQString& - copyfromUrl () const; - /** - * @return copyfrom revision - */ - svn_revnum_t - copyfromRev () const; - /** - * @return old version of conflicted file - */ - const TQString& - conflictOld () const; - /** - * @return new version of conflicted file - */ - const TQString& - conflictNew () const; - /** - * @return working version of conflicted file - */ - const TQString& - conflictWrk () const; - /** - * @return property reject file - */ - const TQString& - prejfile () const; - /** - * @return last up-to-date time for text contents - * @retval 0 no information available - */ - const DateTime& - textTime () const; - /** - * @return last up-to-date time for properties - * @retval 0 no information available - */ - const DateTime& - propTime()const; - - /** - * @return base64 encoded checksum - * @retval NULL for backwards compatibility - */ - const TQString& - checksum () const; - - /** - * @return last revision this was changed - */ - svn_revnum_t - cmtRev () const; - - /** - * @return last date this was changed - */ - const DateTime& - cmtDate () const; - - /** - * @return last commit author of this file - */ - const TQString& - cmtAuthor () const; - - /** - * @return lock for that entry - * @since subversion 1.2 - */ - const LockEntry& - lockEntry()const; - - /** - * @return true if entry is marked as dir - */ - bool isDir()const; - /** - * assignment operator - */ - Entry & - operator = (const Entry &); - bool isFile()const; - - private: - Entry_private*m_Data; - }; - -} - -#endif diff --git a/src/svnqt/exception.cpp b/src/svnqt/exception.cpp index c08ef3b..49a773e 100644 --- a/src/svnqt/exception.cpp +++ b/src/svnqt/exception.cpp @@ -30,8 +30,8 @@ // svncpp -#include "exception.hpp" -#include "svnqt/svnqt_defines.hpp" +#include "exception.h" +#include "svnqt/svnqt_defines.h" #include diff --git a/src/svnqt/exception.h b/src/svnqt/exception.h new file mode 100644 index 0000000..3f202da --- /dev/null +++ b/src/svnqt/exception.h @@ -0,0 +1,133 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_EXCEPTION_H_ +#define _SVNCPP_EXCEPTION_H_ + +#include "svnqt/svnqt_defines.h" +// subversion api +#include "svn_client.h" +#include + +namespace svn +{ + + /** + * Generic exception class. + */ + class SVNTQT_EXPORT Exception + { + public: + /** + * Constructor. Assigns the exception reason. + */ + Exception (const char * message) throw (); + Exception (const TQString&message) throw(); + + virtual ~Exception () throw (); + + /** + * @return the exception message. + */ + virtual const TQString& msg() const; + + /** + * @return the outermost error code. + */ + apr_status_t apr_err () const; + + static TQString error2msg(svn_error_t*error); + + protected: + struct Data; + Data * m; + void setMessage(const TQString&); + + private: + + Exception (const Exception &) throw (); + + Exception () throw (); + + Exception & operator = (const Exception &); + + }; + + /** + * Subversion client exception class. + */ + class SVNTQT_EXPORT ClientException : public Exception + { + public: + /** + * Constructor. Sets the error template and an optional message. + * @param error the error to display. This will get cleared inside with svn_error_clear + * so it isn't usable after that! + */ + ClientException (svn_error_t * error) throw (); + + + /** + * Constructor that takes only an apr errorcode + */ + ClientException (apr_status_t status) throw (); + + /** + * Constructor + */ + ClientException (const char*msg) throw (); + + /** + * Constructor + */ + ClientException (const TQString&message) throw(); + + /** + * Copy constructor + */ + ClientException (const ClientException & src) throw (); + + virtual ~ClientException () throw (); + + private: + ClientException () throw (); + + ClientException & operator = (ClientException &); + static TQString getBackTrace(); + + void init(); + /// backtrace from constructor; + TQString m_backTraceConstr; + + }; + +} + +#endif diff --git a/src/svnqt/exception.hpp b/src/svnqt/exception.hpp deleted file mode 100644 index 8f589f0..0000000 --- a/src/svnqt/exception.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_EXCEPTION_H_ -#define _SVNCPP_EXCEPTION_H_ - -#include "svnqt/svnqt_defines.hpp" -// subversion api -#include "svn_client.h" -#include - -namespace svn -{ - - /** - * Generic exception class. - */ - class SVNTQT_EXPORT Exception - { - public: - /** - * Constructor. Assigns the exception reason. - */ - Exception (const char * message) throw (); - Exception (const TQString&message) throw(); - - virtual ~Exception () throw (); - - /** - * @return the exception message. - */ - virtual const TQString& msg() const; - - /** - * @return the outermost error code. - */ - apr_status_t apr_err () const; - - static TQString error2msg(svn_error_t*error); - - protected: - struct Data; - Data * m; - void setMessage(const TQString&); - - private: - - Exception (const Exception &) throw (); - - Exception () throw (); - - Exception & operator = (const Exception &); - - }; - - /** - * Subversion client exception class. - */ - class SVNTQT_EXPORT ClientException : public Exception - { - public: - /** - * Constructor. Sets the error template and an optional message. - * @param error the error to display. This will get cleared inside with svn_error_clear - * so it isn't usable after that! - */ - ClientException (svn_error_t * error) throw (); - - - /** - * Constructor that takes only an apr errorcode - */ - ClientException (apr_status_t status) throw (); - - /** - * Constructor - */ - ClientException (const char*msg) throw (); - - /** - * Constructor - */ - ClientException (const TQString&message) throw(); - - /** - * Copy constructor - */ - ClientException (const ClientException & src) throw (); - - virtual ~ClientException () throw (); - - private: - ClientException () throw (); - - ClientException & operator = (ClientException &); - static TQString getBackTrace(); - - void init(); - /// backtrace from constructor; - TQString m_backTraceConstr; - - }; - -} - -#endif diff --git a/src/svnqt/helper.h b/src/svnqt/helper.h new file mode 100644 index 0000000..440fed3 --- /dev/null +++ b/src/svnqt/helper.h @@ -0,0 +1,98 @@ + +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef __HELPER_HPP +#define __HELPER_HPP + +#include "svnqttypes.h" +#include "revision.h" +#include + +#include + +namespace svn +{ + namespace internal + { + class DepthToSvn + { +#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1) + protected: + svn_depth_t _value; + public: + DepthToSvn(const svn::Depth&val):_value(svn_depth_unknown) + { + switch (val) { + case DepthUnknown: + _value = svn_depth_unknown; + break; + case DepthExclude: + _value = svn_depth_exclude; + break; + case DepthEmpty: + _value = svn_depth_empty; + break; + case DepthFiles: + _value = svn_depth_files; + break; + case DepthImmediates: + _value = svn_depth_immediates; + break; + case DepthInfinity: + default: + _value = svn_depth_infinity; + break; + } + } + + operator svn_depth_t () + { + return _value; + } +#endif + }; + + class RevisionRangesToHash + { +#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1) + protected: + RevisionRanges m_ranges; + public: + RevisionRangesToHash(const RevisionRanges&_input):m_ranges(_input){} + + apr_array_header_t*array(const Pool&pool) + { + apr_array_header_t*ranges=apr_array_make(pool,m_ranges.size(),sizeof(svn_opt_revision_range_t *)); + svn_opt_revision_range_t *range; + + for (unsigned long j=0;jstart= *m_ranges[j].first.revision(); + range->end = *m_ranges[j].second.revision(); + APR_ARRAY_PUSH(ranges,svn_opt_revision_range_t *) = range; + } + return ranges; + } +#endif + }; + } +} +#endif diff --git a/src/svnqt/helper.hpp b/src/svnqt/helper.hpp deleted file mode 100644 index fca54d1..0000000 --- a/src/svnqt/helper.hpp +++ /dev/null @@ -1,98 +0,0 @@ - -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef __HELPER_HPP -#define __HELPER_HPP - -#include "svnqttypes.hpp" -#include "revision.hpp" -#include - -#include - -namespace svn -{ - namespace internal - { - class DepthToSvn - { -#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1) - protected: - svn_depth_t _value; - public: - DepthToSvn(const svn::Depth&val):_value(svn_depth_unknown) - { - switch (val) { - case DepthUnknown: - _value = svn_depth_unknown; - break; - case DepthExclude: - _value = svn_depth_exclude; - break; - case DepthEmpty: - _value = svn_depth_empty; - break; - case DepthFiles: - _value = svn_depth_files; - break; - case DepthImmediates: - _value = svn_depth_immediates; - break; - case DepthInfinity: - default: - _value = svn_depth_infinity; - break; - } - } - - operator svn_depth_t () - { - return _value; - } -#endif - }; - - class RevisionRangesToHash - { -#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1) - protected: - RevisionRanges m_ranges; - public: - RevisionRangesToHash(const RevisionRanges&_input):m_ranges(_input){} - - apr_array_header_t*array(const Pool&pool) - { - apr_array_header_t*ranges=apr_array_make(pool,m_ranges.size(),sizeof(svn_opt_revision_range_t *)); - svn_opt_revision_range_t *range; - - for (unsigned long j=0;jstart= *m_ranges[j].first.revision(); - range->end = *m_ranges[j].second.revision(); - APR_ARRAY_PUSH(ranges,svn_opt_revision_range_t *) = range; - } - return ranges; - } -#endif - }; - } -} -#endif diff --git a/src/svnqt/info_entry.cpp b/src/svnqt/info_entry.cpp index 6f76735..574d39f 100644 --- a/src/svnqt/info_entry.cpp +++ b/src/svnqt/info_entry.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "svnqt/info_entry.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/pool.hpp" +#include "svnqt/info_entry.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/pool.h" #include #include diff --git a/src/svnqt/info_entry.h b/src/svnqt/info_entry.h new file mode 100644 index 0000000..4ac06d0 --- /dev/null +++ b/src/svnqt/info_entry.h @@ -0,0 +1,118 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef __INFO_ENTRY_H +#define __INFO_ENTRY_H + +#include +#include +#include +#include + +#include + +struct svn_info_t; + +namespace svn { + class SVNTQT_EXPORT InfoEntry + { +public: + InfoEntry(); + InfoEntry(const svn_info_t*,const char*path); + InfoEntry(const svn_info_t*,const TQString&path); + InfoEntry(const InfoEntry&); + ~InfoEntry(); + + void init(const svn_info_t*,const char*path); + void init(const svn_info_t*,const TQString&path); + + DateTime cmtDate()const; + DateTime textTime()const; + DateTime propTime()const; + bool hasWc()const; + /** + * @return lock for that entry + * @since subversion 1.2 + */ + const LockEntry&lockEntry()const; + /** + * @return last commit author of this file + */ + const TQString&cmtAuthor () const; + const TQString&Name()const; + + const TQString& checksum()const; + const TQString& conflictNew()const; + const TQString& conflictOld()const; + const TQString& conflictWrk()const; + const TQString& copyfromUrl()const; + const TQString& prejfile()const; + const TQString& reposRoot()const; + const TQString& url()const; + const TQString& uuid()const; + svn_node_kind_t kind()const; + const Revision& cmtRev()const; + const Revision& copyfromRev()const; + const Revision& revision()const; + svn_wc_schedule_t Schedule()const; + + TQLONG size()const; + TQLONG working_size()const; + const TQByteArray&changeList()const; + svn::Depth depth()const; + + const TQString&prettyUrl()const; + + bool isDir()const; + TQString prettyUrl(const char*)const; + +protected: + DateTime m_last_changed_date; + DateTime m_text_time; + DateTime m_prop_time; + bool m_hasWc; + LockEntry m_Lock; + TQString m_name; + TQString m_checksum; + TQString m_conflict_new; + TQString m_conflict_old; + TQString m_conflict_wrk; + TQString m_copyfrom_url; + TQString m_last_author; + TQString m_prejfile; + TQString m_repos_root; + TQString m_url; + TQString m_pUrl; + TQString m_UUID; + svn_node_kind_t m_kind; + Revision m_copy_from_rev; + Revision m_last_changed_rev; + Revision m_revision; + svn_wc_schedule_t m_schedule; + + TQLONG m_size; + TQLONG m_working_size; + TQByteArray m_changeList; + svn::Depth m_depth; + +protected: + void init(); + }; +} +#endif diff --git a/src/svnqt/info_entry.hpp b/src/svnqt/info_entry.hpp deleted file mode 100644 index be86639..0000000 --- a/src/svnqt/info_entry.hpp +++ /dev/null @@ -1,118 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef __INFO_ENTRY_H -#define __INFO_ENTRY_H - -#include -#include -#include -#include - -#include - -struct svn_info_t; - -namespace svn { - class SVNTQT_EXPORT InfoEntry - { -public: - InfoEntry(); - InfoEntry(const svn_info_t*,const char*path); - InfoEntry(const svn_info_t*,const TQString&path); - InfoEntry(const InfoEntry&); - ~InfoEntry(); - - void init(const svn_info_t*,const char*path); - void init(const svn_info_t*,const TQString&path); - - DateTime cmtDate()const; - DateTime textTime()const; - DateTime propTime()const; - bool hasWc()const; - /** - * @return lock for that entry - * @since subversion 1.2 - */ - const LockEntry&lockEntry()const; - /** - * @return last commit author of this file - */ - const TQString&cmtAuthor () const; - const TQString&Name()const; - - const TQString& checksum()const; - const TQString& conflictNew()const; - const TQString& conflictOld()const; - const TQString& conflictWrk()const; - const TQString& copyfromUrl()const; - const TQString& prejfile()const; - const TQString& reposRoot()const; - const TQString& url()const; - const TQString& uuid()const; - svn_node_kind_t kind()const; - const Revision& cmtRev()const; - const Revision& copyfromRev()const; - const Revision& revision()const; - svn_wc_schedule_t Schedule()const; - - TQLONG size()const; - TQLONG working_size()const; - const TQByteArray&changeList()const; - svn::Depth depth()const; - - const TQString&prettyUrl()const; - - bool isDir()const; - TQString prettyUrl(const char*)const; - -protected: - DateTime m_last_changed_date; - DateTime m_text_time; - DateTime m_prop_time; - bool m_hasWc; - LockEntry m_Lock; - TQString m_name; - TQString m_checksum; - TQString m_conflict_new; - TQString m_conflict_old; - TQString m_conflict_wrk; - TQString m_copyfrom_url; - TQString m_last_author; - TQString m_prejfile; - TQString m_repos_root; - TQString m_url; - TQString m_pUrl; - TQString m_UUID; - svn_node_kind_t m_kind; - Revision m_copy_from_rev; - Revision m_last_changed_rev; - Revision m_revision; - svn_wc_schedule_t m_schedule; - - TQLONG m_size; - TQLONG m_working_size; - TQByteArray m_changeList; - svn::Depth m_depth; - -protected: - void init(); - }; -} -#endif diff --git a/src/svnqt/lock_entry.cpp b/src/svnqt/lock_entry.cpp index bd8bf2a..5ecd42a 100644 --- a/src/svnqt/lock_entry.cpp +++ b/src/svnqt/lock_entry.cpp @@ -29,8 +29,8 @@ */ // svncpp -#include "lock_entry.hpp" -#include "pool.hpp" +#include "lock_entry.h" +#include "pool.h" // subversion api #include "svn_time.h" diff --git a/src/svnqt/lock_entry.h b/src/svnqt/lock_entry.h new file mode 100644 index 0000000..ec2e88f --- /dev/null +++ b/src/svnqt/lock_entry.h @@ -0,0 +1,84 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_LOCK_ENTRY_H_ +#define _SVNCPP_LOCK_ENTRY_H_ + +#include "svnqt/svnqt_defines.h" +#include "svnqt/datetime.h" + +#include + +// apr +#include "apr_time.h" + +// subversion api +#include "svn_types.h" +#include "svn_wc.h" + +namespace svn +{ + class SVNTQT_EXPORT LockEntry + { + public: + LockEntry (); + + LockEntry (const apr_time_t lock_time, + const apr_time_t expiration_time, + const char * lock_owner, + const char * lock_comment, + const char * lock_token); + + void init(const svn_wc_entry_t * src); + + void init(const apr_time_t lock_time, + const apr_time_t expiration_time, + const char * lock_owner, + const char * lock_comment, + const char * lock_token); + void init(const svn_lock_t*); + const TQString&Comment()const; + const TQString&Owner()const; + const TQString&Token()const; + const DateTime&Date()const; + const DateTime&Expiration()const; + bool Locked()const; + + protected: + DateTime date; + DateTime exp; + TQString owner; + TQString comment; + TQString token; + bool locked; + }; +} + +#endif diff --git a/src/svnqt/lock_entry.hpp b/src/svnqt/lock_entry.hpp deleted file mode 100644 index f33c10b..0000000 --- a/src/svnqt/lock_entry.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_LOCK_ENTRY_H_ -#define _SVNCPP_LOCK_ENTRY_H_ - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/datetime.hpp" - -#include - -// apr -#include "apr_time.h" - -// subversion api -#include "svn_types.h" -#include "svn_wc.h" - -namespace svn -{ - class SVNTQT_EXPORT LockEntry - { - public: - LockEntry (); - - LockEntry (const apr_time_t lock_time, - const apr_time_t expiration_time, - const char * lock_owner, - const char * lock_comment, - const char * lock_token); - - void init(const svn_wc_entry_t * src); - - void init(const apr_time_t lock_time, - const apr_time_t expiration_time, - const char * lock_owner, - const char * lock_comment, - const char * lock_token); - void init(const svn_lock_t*); - const TQString&Comment()const; - const TQString&Owner()const; - const TQString&Token()const; - const DateTime&Date()const; - const DateTime&Expiration()const; - bool Locked()const; - - protected: - DateTime date; - DateTime exp; - TQString owner; - TQString comment; - TQString token; - bool locked; - }; -} - -#endif diff --git a/src/svnqt/log_entry.cpp b/src/svnqt/log_entry.cpp index 720642d..347a958 100644 --- a/src/svnqt/log_entry.cpp +++ b/src/svnqt/log_entry.cpp @@ -28,8 +28,8 @@ * ==================================================================== */ // svncpp -#include "log_entry.hpp" -#include "pool.hpp" +#include "log_entry.h" +#include "pool.h" // subversion api #include "svn_time.h" diff --git a/src/svnqt/log_entry.h b/src/svnqt/log_entry.h new file mode 100644 index 0000000..05ec1d2 --- /dev/null +++ b/src/svnqt/log_entry.h @@ -0,0 +1,120 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_LOG_ENTRY_H_ +#define _SVNCPP_LOG_ENTRY_H_ + +#include "svnqt/svnqt_defines.h" +#include "svnqt/datetime.h" + +//TQt +#include + +#include +#include +#include +#include + +// apr +#include "apr_time.h" + +// subversion api +#include "svn_types.h" +#include "svn_version.h" + +namespace svn +{ + + class SVNTQT_EXPORT LogChangePathEntry + { + public: + LogChangePathEntry (const char *path_, + char action_, + const char *copyFromPath_, + const svn_revnum_t copyFromRevision_); + + LogChangePathEntry (const TQString &path_, + char action_, + const TQString ©FromPath_, + const svn_revnum_t copyFromRevision_); + + LogChangePathEntry (const TQString &path_, + char action_, + const TQString ©FromPath_, + const svn_revnum_t copyFromRevision_, + const TQString ©ToPath_, + const svn_revnum_t copyToRevision_); + + LogChangePathEntry(); + + TQString path; + char action; + TQString copyFromPath; + //! future use or useful in backends + TQString copyToPath; + + TQLONG copyFromRevision; + //! future use or useful in backends + TQLONG copyToRevision; + }; + + typedef TQValueList LogChangePathEntries; + + class SVNTQT_EXPORT LogEntry + { + public: + LogEntry (); + + LogEntry (const svn_revnum_t revision, + const char * author, + const char * date, + const char * message); +#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1) + LogEntry(svn_log_entry_t*); +#endif + void setDate(const char*date); + + //! if -1 the entry is a fake entry and not real usable! + TQLONG revision; + TQLONG date; + TQString author; + TQString message; + LogChangePathEntries changedPaths; + TQLIST m_MergedInRevisions; + }; +} + +SVNTQT_EXPORT TQDataStream &operator<<(TQDataStream&s,const svn::LogEntry&r); +SVNTQT_EXPORT TQDataStream &operator<<(TQDataStream&s,const svn::LogChangePathEntry&r); + +SVNTQT_EXPORT TQDataStream &operator>>(TQDataStream&s,svn::LogEntry&r); +SVNTQT_EXPORT TQDataStream &operator>>(TQDataStream&s,svn::LogChangePathEntry&r); + +#endif diff --git a/src/svnqt/log_entry.hpp b/src/svnqt/log_entry.hpp deleted file mode 100644 index 925e2c5..0000000 --- a/src/svnqt/log_entry.hpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_LOG_ENTRY_H_ -#define _SVNCPP_LOG_ENTRY_H_ - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/datetime.hpp" - -//TQt -#include - -#include -#include -#include -#include - -// apr -#include "apr_time.h" - -// subversion api -#include "svn_types.h" -#include "svn_version.h" - -namespace svn -{ - - class SVNTQT_EXPORT LogChangePathEntry - { - public: - LogChangePathEntry (const char *path_, - char action_, - const char *copyFromPath_, - const svn_revnum_t copyFromRevision_); - - LogChangePathEntry (const TQString &path_, - char action_, - const TQString ©FromPath_, - const svn_revnum_t copyFromRevision_); - - LogChangePathEntry (const TQString &path_, - char action_, - const TQString ©FromPath_, - const svn_revnum_t copyFromRevision_, - const TQString ©ToPath_, - const svn_revnum_t copyToRevision_); - - LogChangePathEntry(); - - TQString path; - char action; - TQString copyFromPath; - //! future use or useful in backends - TQString copyToPath; - - TQLONG copyFromRevision; - //! future use or useful in backends - TQLONG copyToRevision; - }; - - typedef TQValueList LogChangePathEntries; - - class SVNTQT_EXPORT LogEntry - { - public: - LogEntry (); - - LogEntry (const svn_revnum_t revision, - const char * author, - const char * date, - const char * message); -#if ((SVN_VER_MAJOR == 1) && (SVN_VER_MINOR >= 5)) || (SVN_VER_MAJOR > 1) - LogEntry(svn_log_entry_t*); -#endif - void setDate(const char*date); - - //! if -1 the entry is a fake entry and not real usable! - TQLONG revision; - TQLONG date; - TQString author; - TQString message; - LogChangePathEntries changedPaths; - TQLIST m_MergedInRevisions; - }; -} - -SVNTQT_EXPORT TQDataStream &operator<<(TQDataStream&s,const svn::LogEntry&r); -SVNTQT_EXPORT TQDataStream &operator<<(TQDataStream&s,const svn::LogChangePathEntry&r); - -SVNTQT_EXPORT TQDataStream &operator>>(TQDataStream&s,svn::LogEntry&r); -SVNTQT_EXPORT TQDataStream &operator>>(TQDataStream&s,svn::LogChangePathEntry&r); - -#endif diff --git a/src/svnqt/path.cpp b/src/svnqt/path.cpp index 2b6d40a..81b07f2 100644 --- a/src/svnqt/path.cpp +++ b/src/svnqt/path.cpp @@ -36,12 +36,12 @@ #include "apr_file_io.h" // svncpp -#include "svnqt/path.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/url.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/revision.hpp" -#include "svnqt/exception.hpp" +#include "svnqt/path.h" +#include "svnqt/pool.h" +#include "svnqt/url.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/revision.h" +#include "svnqt/exception.h" #include diff --git a/src/svnqt/path.h b/src/svnqt/path.h new file mode 100644 index 0000000..279f41d --- /dev/null +++ b/src/svnqt/path.h @@ -0,0 +1,195 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_PATH_HPP_ +#define _SVNCPP_PATH_HPP_ + +#include +#include "svnqt/svnqt_defines.h" +#include "svnqt/svnqttypes.h" + +namespace svn +{ + /** + * Encapsulation for Subversion Path handling + */ + class SVNTQT_EXPORT Path + { + private: + TQString m_path; + + /** + * initialize the class + * + * @param path Path string - when url this should NOT hold revision as @ parameter!!!!! (will filtered out) + */ + void init (const TQString& path); + + public: + /** + * Constructor that takes a string as parameter. + * The string is converted to subversion internal + * representation. The string is copied. + * + * @param path Path string - when url this should NOT hold revision as @ parameter!!!!! (will filtered out) + */ + Path (const TQString & path = TQString()); + + /** + * Constructor + * + * @see Path::Path (const TQString &) + * @param path Path string - when url this should NOT hold revision as @ parameter!!!!! (will filtered out) + */ + Path (const char * path); + + /** + * Copy constructor + * + * @param path Path to be copied + */ + Path (const Path & path); + + /** + * Assignment operator + */ + Path& operator=(const Path&); + + /** + * @return Path string + */ + const TQString & + path () const; + + /** + * @return Path string + */ + operator const TQString&()const; + + /** + * @return Path as pretty url + */ + TQString prettyPath()const; + + /** + * @return Path string as c string + */ + const TQByteArray cstr() const; + + /** + * check whether a path is set. Right now + * this checks only if the string is non- + * empty. + * + * @return true if there is a path set + */ + bool + isset() const; + + + /** + * adds a new URL component to the path + * + * @param component new component to add + */ + void + addComponent (const char * component); + + + /** + * adds a new URL component to the path + * + * @param component new component to add + */ + void + addComponent (const TQString & component); + + /** Reduce path to its parent folder. + * If the path length is 1 (eg., only "/") it will cleared so + * path length will get zero. + * @sa svn_path_remove_component + */ + void + removeLast(); + + + /** + * split path in its components + * + * @param dirpath directory/path component + * @param basename filename + */ + void + split (TQString & dirpath, TQString & basename) const; + + + /** + * split path in its components including + * file extension + * + * @param dir directory component + * @param filename filename + * @param ext extension (including leading dot ".") + */ + void + split (TQString & dir, TQString & filename, TQString & ext) const; + + + /** + * returns the temporary directory + */ + static Path + getTempDir (); + + /** Parse a string for a peg revision + * @param pathorurl url to parse + * @param _path target to store the cleaned url + * @param _peg target where to store the peg url. + * @throw svn::ClientException on errors + */ + static void + parsePeg(const TQString&pathorurl,Path&_path,svn::Revision&_peg); + + + /** return the length of the path-string */ + unsigned int + length () const; + + + /** returns the path with native separators */ + TQString + native () const; + + /** returns if the path is a valid url, eg. points to a remote */ + bool isUrl()const; + }; +} + +#endif diff --git a/src/svnqt/path.hpp b/src/svnqt/path.hpp deleted file mode 100644 index a04ade8..0000000 --- a/src/svnqt/path.hpp +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_PATH_HPP_ -#define _SVNCPP_PATH_HPP_ - -#include -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/svnqttypes.hpp" - -namespace svn -{ - /** - * Encapsulation for Subversion Path handling - */ - class SVNTQT_EXPORT Path - { - private: - TQString m_path; - - /** - * initialize the class - * - * @param path Path string - when url this should NOT hold revision as @ parameter!!!!! (will filtered out) - */ - void init (const TQString& path); - - public: - /** - * Constructor that takes a string as parameter. - * The string is converted to subversion internal - * representation. The string is copied. - * - * @param path Path string - when url this should NOT hold revision as @ parameter!!!!! (will filtered out) - */ - Path (const TQString & path = TQString()); - - /** - * Constructor - * - * @see Path::Path (const TQString &) - * @param path Path string - when url this should NOT hold revision as @ parameter!!!!! (will filtered out) - */ - Path (const char * path); - - /** - * Copy constructor - * - * @param path Path to be copied - */ - Path (const Path & path); - - /** - * Assignment operator - */ - Path& operator=(const Path&); - - /** - * @return Path string - */ - const TQString & - path () const; - - /** - * @return Path string - */ - operator const TQString&()const; - - /** - * @return Path as pretty url - */ - TQString prettyPath()const; - - /** - * @return Path string as c string - */ - const TQByteArray cstr() const; - - /** - * check whether a path is set. Right now - * this checks only if the string is non- - * empty. - * - * @return true if there is a path set - */ - bool - isset() const; - - - /** - * adds a new URL component to the path - * - * @param component new component to add - */ - void - addComponent (const char * component); - - - /** - * adds a new URL component to the path - * - * @param component new component to add - */ - void - addComponent (const TQString & component); - - /** Reduce path to its parent folder. - * If the path length is 1 (eg., only "/") it will cleared so - * path length will get zero. - * @sa svn_path_remove_component - */ - void - removeLast(); - - - /** - * split path in its components - * - * @param dirpath directory/path component - * @param basename filename - */ - void - split (TQString & dirpath, TQString & basename) const; - - - /** - * split path in its components including - * file extension - * - * @param dir directory component - * @param filename filename - * @param ext extension (including leading dot ".") - */ - void - split (TQString & dir, TQString & filename, TQString & ext) const; - - - /** - * returns the temporary directory - */ - static Path - getTempDir (); - - /** Parse a string for a peg revision - * @param pathorurl url to parse - * @param _path target to store the cleaned url - * @param _peg target where to store the peg url. - * @throw svn::ClientException on errors - */ - static void - parsePeg(const TQString&pathorurl,Path&_path,svn::Revision&_peg); - - - /** return the length of the path-string */ - unsigned int - length () const; - - - /** returns the path with native separators */ - TQString - native () const; - - /** returns if the path is a valid url, eg. points to a remote */ - bool isUrl()const; - }; -} - -#endif diff --git a/src/svnqt/pool.cpp b/src/svnqt/pool.cpp index 3416317..004c2d7 100644 --- a/src/svnqt/pool.cpp +++ b/src/svnqt/pool.cpp @@ -29,7 +29,7 @@ */ // svncpp -#include "pool.hpp" +#include "pool.h" namespace svn diff --git a/src/svnqt/pool.h b/src/svnqt/pool.h new file mode 100644 index 0000000..34255df --- /dev/null +++ b/src/svnqt/pool.h @@ -0,0 +1,86 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_POOL_H_ +#define _SVNCPP_POOL_H_ + +// subversion api +#include "svn_pools.h" + + +namespace svn +{ + /** + * Class for encapsulation of apr/subversion pools + */ + class Pool + { + public: + /** + * creates a subpool new pool to an existing pool + * + * @param parent NULL -> global pool + */ + Pool (apr_pool_t * parent = (apr_pool_t *)0); + + virtual ~ Pool (); + + /** + * @return apr handle to the pool + */ + apr_pool_t * + pool () const; + + /** + * operator to return apr handle to the pool + */ + operator apr_pool_t * () const + { + return m_pool; + } + + /** + * release pool and create a new one + */ + void renew (); + private: + apr_pool_t * m_parent; + apr_pool_t * m_pool; + + Pool& operator=(const Pool&); + + Pool (const Pool &); + + static bool s_initialized; + static apr_pool_t * pool_create (apr_pool_t * parent); + }; +} + +#endif diff --git a/src/svnqt/pool.hpp b/src/svnqt/pool.hpp deleted file mode 100644 index 34255df..0000000 --- a/src/svnqt/pool.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_POOL_H_ -#define _SVNCPP_POOL_H_ - -// subversion api -#include "svn_pools.h" - - -namespace svn -{ - /** - * Class for encapsulation of apr/subversion pools - */ - class Pool - { - public: - /** - * creates a subpool new pool to an existing pool - * - * @param parent NULL -> global pool - */ - Pool (apr_pool_t * parent = (apr_pool_t *)0); - - virtual ~ Pool (); - - /** - * @return apr handle to the pool - */ - apr_pool_t * - pool () const; - - /** - * operator to return apr handle to the pool - */ - operator apr_pool_t * () const - { - return m_pool; - } - - /** - * release pool and create a new one - */ - void renew (); - private: - apr_pool_t * m_parent; - apr_pool_t * m_pool; - - Pool& operator=(const Pool&); - - Pool (const Pool &); - - static bool s_initialized; - static apr_pool_t * pool_create (apr_pool_t * parent); - }; -} - -#endif diff --git a/src/svnqt/repository.cpp b/src/svnqt/repository.cpp index 327340b..9bb2a4f 100644 --- a/src/svnqt/repository.cpp +++ b/src/svnqt/repository.cpp @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "repository.hpp" -#include "repositorydata.hpp" +#include "repository.h" +#include "repositorydata.h" namespace svn { diff --git a/src/svnqt/repository.h b/src/svnqt/repository.h new file mode 100644 index 0000000..05913b2 --- /dev/null +++ b/src/svnqt/repository.h @@ -0,0 +1,119 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SVNREPOSITORY_H +#define SVNREPOSITORY_H + +// Ignore MSVC 7, 2005 & 2008 compiler warning: C++ exception specification +#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1550 +#pragma warning (disable: 4290) +#endif + +#include "svnqt/exception.h" +#include "svnqt/revision.h" +#include "svnqt/svnqt_defines.h" + +#include + +namespace svn { + +namespace repository { + +class RepositoryData; +class RepositoryListener; + +//! wrapper class for subversions administrative repository functions +/*! + \author Rajko Albrecht +*/ +class SVNTQT_EXPORT Repository{ +public: + enum LOAD_UUID { + UUID_DEFAULT_ACTION = 0, + UUID_IGNORE_ACTION = 1, + UUID_FORCE_ACTION = 2 + }; + //! constructor + /*! + * \param aListener callback object, the object will NOT take the ownership. + */ + Repository(svn::repository::RepositoryListener*aListener); + //! destructor + virtual ~Repository(); + + //! open a local repository path for maintainance + /*! + Assigns a repository with that object. If a path was opened before it will closed. + \param path Path to a local repository, must not be an url + \exception ClientException will be thrown in case of an error + */ + void Open(const TQString&path) throw (ClientException); + //! Creates and open a new repository + /*! + * Creates a new repository in path with type fstype. If create succeeded open and assigns with the object. + * If a repository was opened before it will closed. + * \param path the path where to create the new repository. Must not be an url. + * \param fstype type of repository ("fsfs" or "bdb"). If wrong is set fsfs is the default. + * \param _bdbnosync disable fsync at transaction commit [Berkeley DB] + * \param _bdbautologremove enable automatic log file removal [Berkeley DB] + * \param _pre_1_4_compat Create repository compatibel to version earlier than 1.4 (only used with subversion 1.4) + */ + void CreateOpen(const TQString&path, const TQString&fstype, bool _bdbnosync = false, + bool _bdbautologremove = true, bool _pre_1_4_compat=false, bool _pre_1_5_compat=false) throw (ClientException); + //! dump content of repository to a file + /*! + The repository must opend before. Progress message go trough the assigned svn::repository::RepositoryListener object. + The revision parameter must be numbers, no constant values like svn::Revision::HEAD. + \param output where to output the content + \param start Begin on revision. If revision == -1 than start with first entry. + \param end End with revision. If revision == -1 than end with current head. + \param incremental dump incrementally + \param use_deltas use deltas in dump output + \exception ClientException will be thrown in case of an error + */ + void dump(const TQString&output,const svn::Revision&start,const svn::Revision&end, bool incremental, bool use_deltas)throw (ClientException); + //! load a dump into repository + /*! + The repository must opened before. Progress message go trough the assigned svn::repository::RepositoryListener object. + \param dump Dumpfile to load + \param uuida what to do with UUIDs + \param parentFolder put content of dumpstream within folder in repository, if empty put into root-folder. + \param usePre use pre-commit-hook + \param usePost use post-commit-hook + \exception ClientException will be thrown in case of an error + */ + void loaddump(const TQString&dump,LOAD_UUID uuida, const TQString&parentFolder, bool usePre, bool usePost)throw (ClientException); + //! copy a repository to a new location + /*! + \param src the repository path to copy + \param dest where to copy + \param cleanlogs remove redundand log files from source + \exception ClientException will be thrown in case of an error + */ + static void hotcopy(const TQString&src,const TQString&dest,bool cleanlogs)throw (ClientException); + +private: + RepositoryData*m_Data; +}; + +} + +} + +#endif diff --git a/src/svnqt/repository.hpp b/src/svnqt/repository.hpp deleted file mode 100644 index 7f79f52..0000000 --- a/src/svnqt/repository.hpp +++ /dev/null @@ -1,119 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef SVNREPOSITORY_H -#define SVNREPOSITORY_H - -// Ignore MSVC 7, 2005 & 2008 compiler warning: C++ exception specification -#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1550 -#pragma warning (disable: 4290) -#endif - -#include "svnqt/exception.hpp" -#include "svnqt/revision.hpp" -#include "svnqt/svnqt_defines.hpp" - -#include - -namespace svn { - -namespace repository { - -class RepositoryData; -class RepositoryListener; - -//! wrapper class for subversions administrative repository functions -/*! - \author Rajko Albrecht -*/ -class SVNTQT_EXPORT Repository{ -public: - enum LOAD_UUID { - UUID_DEFAULT_ACTION = 0, - UUID_IGNORE_ACTION = 1, - UUID_FORCE_ACTION = 2 - }; - //! constructor - /*! - * \param aListener callback object, the object will NOT take the ownership. - */ - Repository(svn::repository::RepositoryListener*aListener); - //! destructor - virtual ~Repository(); - - //! open a local repository path for maintainance - /*! - Assigns a repository with that object. If a path was opened before it will closed. - \param path Path to a local repository, must not be an url - \exception ClientException will be thrown in case of an error - */ - void Open(const TQString&path) throw (ClientException); - //! Creates and open a new repository - /*! - * Creates a new repository in path with type fstype. If create succeeded open and assigns with the object. - * If a repository was opened before it will closed. - * \param path the path where to create the new repository. Must not be an url. - * \param fstype type of repository ("fsfs" or "bdb"). If wrong is set fsfs is the default. - * \param _bdbnosync disable fsync at transaction commit [Berkeley DB] - * \param _bdbautologremove enable automatic log file removal [Berkeley DB] - * \param _pre_1_4_compat Create repository compatibel to version earlier than 1.4 (only used with subversion 1.4) - */ - void CreateOpen(const TQString&path, const TQString&fstype, bool _bdbnosync = false, - bool _bdbautologremove = true, bool _pre_1_4_compat=false, bool _pre_1_5_compat=false) throw (ClientException); - //! dump content of repository to a file - /*! - The repository must opend before. Progress message go trough the assigned svn::repository::RepositoryListener object. - The revision parameter must be numbers, no constant values like svn::Revision::HEAD. - \param output where to output the content - \param start Begin on revision. If revision == -1 than start with first entry. - \param end End with revision. If revision == -1 than end with current head. - \param incremental dump incrementally - \param use_deltas use deltas in dump output - \exception ClientException will be thrown in case of an error - */ - void dump(const TQString&output,const svn::Revision&start,const svn::Revision&end, bool incremental, bool use_deltas)throw (ClientException); - //! load a dump into repository - /*! - The repository must opened before. Progress message go trough the assigned svn::repository::RepositoryListener object. - \param dump Dumpfile to load - \param uuida what to do with UUIDs - \param parentFolder put content of dumpstream within folder in repository, if empty put into root-folder. - \param usePre use pre-commit-hook - \param usePost use post-commit-hook - \exception ClientException will be thrown in case of an error - */ - void loaddump(const TQString&dump,LOAD_UUID uuida, const TQString&parentFolder, bool usePre, bool usePost)throw (ClientException); - //! copy a repository to a new location - /*! - \param src the repository path to copy - \param dest where to copy - \param cleanlogs remove redundand log files from source - \exception ClientException will be thrown in case of an error - */ - static void hotcopy(const TQString&src,const TQString&dest,bool cleanlogs)throw (ClientException); - -private: - RepositoryData*m_Data; -}; - -} - -} - -#endif diff --git a/src/svnqt/repositorydata.cpp b/src/svnqt/repositorydata.cpp index 4e6f2ba..320139f 100644 --- a/src/svnqt/repositorydata.cpp +++ b/src/svnqt/repositorydata.cpp @@ -17,11 +17,11 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "svnqt/repositorydata.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/exception.hpp" -#include "svnqt/repositorylistener.hpp" -#include "svnqt/svnfilestream.hpp" +#include "svnqt/repositorydata.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/exception.h" +#include "svnqt/repositorylistener.h" +#include "svnqt/svnfilestream.h" #include #include diff --git a/src/svnqt/repositorydata.h b/src/svnqt/repositorydata.h new file mode 100644 index 0000000..0efb891 --- /dev/null +++ b/src/svnqt/repositorydata.h @@ -0,0 +1,73 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SVNREPOSITORYDATA_H +#define SVNREPOSITORYDATA_H + +#include "svnqt/pool.h" +#include "svnqt/revision.h" +#include "svnqt/apr.h" +#include "svnqt/svnqt_defines.h" + +#include + +#include +#include + +namespace svn { + +namespace repository { + +class Repository; +class RepositoryListener; +/** + @author Rajko Albrecht +*/ +class SVNTQT_NOEXPORT RepositoryData{ + friend class Repository; + +public: + RepositoryData(RepositoryListener*); + + virtual ~RepositoryData(); + void Close(); + svn_error_t * Open(const TQString&); + svn_error_t * CreateOpen(const TQString&path, const TQString&fstype, bool _bdbnosync = false, + bool _bdbautologremove = true, bool _pre_1_4_compat=false, bool _pre_1_5_compat=false); + + void reposFsWarning(const TQString&msg); + svn_error_t* dump(const TQString&output,const svn::Revision&start,const svn::Revision&end, bool incremental, bool use_deltas); + svn_error_t* loaddump(const TQString&dump,svn_repos_load_uuid uuida, const TQString&parentFolder, bool usePre, bool usePost); + static svn_error_t* hotcopy(const TQString&src,const TQString&dest,bool cleanlogs); + +protected: + Pool m_Pool; + svn_repos_t*m_Repository; + RepositoryListener*m_Listener; + +private: + static void warning_func(void *baton, svn_error_t *err); + static svn_error_t*cancel_func(void*baton); +}; + +} + +} + +#endif diff --git a/src/svnqt/repositorydata.hpp b/src/svnqt/repositorydata.hpp deleted file mode 100644 index 5abe2ca..0000000 --- a/src/svnqt/repositorydata.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef SVNREPOSITORYDATA_H -#define SVNREPOSITORYDATA_H - -#include "svnqt/pool.hpp" -#include "svnqt/revision.hpp" -#include "svnqt/apr.hpp" -#include "svnqt/svnqt_defines.hpp" - -#include - -#include -#include - -namespace svn { - -namespace repository { - -class Repository; -class RepositoryListener; -/** - @author Rajko Albrecht -*/ -class SVNTQT_NOEXPORT RepositoryData{ - friend class Repository; - -public: - RepositoryData(RepositoryListener*); - - virtual ~RepositoryData(); - void Close(); - svn_error_t * Open(const TQString&); - svn_error_t * CreateOpen(const TQString&path, const TQString&fstype, bool _bdbnosync = false, - bool _bdbautologremove = true, bool _pre_1_4_compat=false, bool _pre_1_5_compat=false); - - void reposFsWarning(const TQString&msg); - svn_error_t* dump(const TQString&output,const svn::Revision&start,const svn::Revision&end, bool incremental, bool use_deltas); - svn_error_t* loaddump(const TQString&dump,svn_repos_load_uuid uuida, const TQString&parentFolder, bool usePre, bool usePost); - static svn_error_t* hotcopy(const TQString&src,const TQString&dest,bool cleanlogs); - -protected: - Pool m_Pool; - svn_repos_t*m_Repository; - RepositoryListener*m_Listener; - -private: - static void warning_func(void *baton, svn_error_t *err); - static svn_error_t*cancel_func(void*baton); -}; - -} - -} - -#endif diff --git a/src/svnqt/repositorylistener.cpp b/src/svnqt/repositorylistener.cpp index 9c809a8..90b0be7 100644 --- a/src/svnqt/repositorylistener.cpp +++ b/src/svnqt/repositorylistener.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "repositorylistener.hpp" +#include "repositorylistener.h" namespace svn { diff --git a/src/svnqt/repositorylistener.h b/src/svnqt/repositorylistener.h new file mode 100644 index 0000000..a2b357a --- /dev/null +++ b/src/svnqt/repositorylistener.h @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef REPOSITORYLISTENER_HPP +#define REPOSITORYLISTENER_HPP + +/** + @author Rajko Albrecht +*/ + +#include "svnqt/svnqt_defines.h" +#include + +namespace svn { + +namespace repository { + +//! class for callbacks on repository operations +class SVNTQT_EXPORT RepositoryListener{ + +public: + //! constructor + RepositoryListener(); + //! destructor + virtual ~RepositoryListener(); + + //! sends a warning or informative message + virtual void sendWarning(const TQString&)=0; + //! sends an error message + virtual void sendError(const TQString&)=0; + //! check if running operation should cancelled + virtual bool isCanceld() =0; + +}; + +} + +} + +#endif diff --git a/src/svnqt/repositorylistener.hpp b/src/svnqt/repositorylistener.hpp deleted file mode 100644 index b5e7d7c..0000000 --- a/src/svnqt/repositorylistener.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef REPOSITORYLISTENER_HPP -#define REPOSITORYLISTENER_HPP - -/** - @author Rajko Albrecht -*/ - -#include "svnqt/svnqt_defines.hpp" -#include - -namespace svn { - -namespace repository { - -//! class for callbacks on repository operations -class SVNTQT_EXPORT RepositoryListener{ - -public: - //! constructor - RepositoryListener(); - //! destructor - virtual ~RepositoryListener(); - - //! sends a warning or informative message - virtual void sendWarning(const TQString&)=0; - //! sends an error message - virtual void sendError(const TQString&)=0; - //! check if running operation should cancelled - virtual bool isCanceld() =0; - -}; - -} - -} - -#endif diff --git a/src/svnqt/revision.cpp b/src/svnqt/revision.cpp index 9c8a66e..95245d9 100644 --- a/src/svnqt/revision.cpp +++ b/src/svnqt/revision.cpp @@ -30,8 +30,8 @@ // svncpp -#include "revision.hpp" -#include "pool.hpp" +#include "revision.h" +#include "pool.h" // qt #include "tqdatetime.h" diff --git a/src/svnqt/revision.h b/src/svnqt/revision.h new file mode 100644 index 0000000..2f46855 --- /dev/null +++ b/src/svnqt/revision.h @@ -0,0 +1,213 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_REVISION_HPP_ +#define _SVNCPP_REVISION_HPP_ + +// svncpp +#include +#include + +// qt +#include +#include +#include + +// subversion api +#include "svn_types.h" +#include "svn_opt.h" + +namespace svn +{ + /** + * Class that encapsulates svn_opt_revnum_t. + * + * @see svn_opt_revnum_t + */ + class SVNTQT_EXPORT Revision + { + private: + svn_opt_revision_t m_revision; + + void + init (const svn_opt_revision_t * revision); + + void + assign(const TQString&); + + void + assign(const TQDateTime&); + + public: + static const svn_opt_revision_kind START; + static const svn_opt_revision_kind BASE; + static const svn_opt_revision_kind HEAD; + static const svn_opt_revision_kind WORKING; + static const svn_opt_revision_kind UNDEFINED; + static const svn_opt_revision_kind PREV; + + static const svn_opt_revision_kind DATE; + static const svn_opt_revision_kind NUMBER; + + /** + * Constructor + * + * @param revision revision information + */ + Revision (const svn_opt_revision_t * revision); + + /** + * Constructor + * + * @param revnum revision number + */ + Revision (const svn_revnum_t revnum); + + /** + * Constructor + * @param revnum a revision number + * @param revstring a revision string + * + * The revision string MUST uppercase, it may some of "HEAD", "BASE", "WORKING", "COMMITED", "PREV", + * or a date in form {YYYY-MM-DD}. + */ + Revision (const int revnum, const TQString&revstring); + + /** + * Constructor + * @param revstring a revision string + * + * The revision string MUST uppercase, it may some of "HEAD", "BASE", "WORKING", "COMMITED", "PREV", + * or a date in form {YYYY-MM-DD}. + */ + Revision (const TQString&revstring); + + /** + * Constructor + * + * @param kind + */ + Revision (const svn_opt_revision_kind kind = svn_opt_revision_unspecified); + + /** + * Constructor + * + * @param dateTime DateTime wrapper for apr_time_t + * @todo change it to referenced parameter (requires interface upgrade of lib) + */ + Revision (const DateTime dateTime); + /** + * Constructor + * + * @param dateTime TQDateTime type + */ + Revision (const TQDateTime&dateTime); + + /** + * Copy constructor + * + * @param revision Source + */ + Revision (const Revision & revision); + + /** + * @return revision information + */ + const svn_opt_revision_t * + revision () const; + + /** + * @see revision (). Same function + * but with operator overloading + */ + operator svn_opt_revision_t * () + { + return &m_revision; + } + + /** + * @see revision (). Same function + * but with operator overloading + */ + operator const svn_opt_revision_t*()const + { + return &m_revision; + } + + /** + * @return revision numver + */ + svn_revnum_t + revnum () const; + + /** + * @return revision kind + */ + svn_opt_revision_kind + kind () const; + + operator TQString ()const; + TQString toString()const; + + bool isRemote()const; + + /** + * @return date + */ + apr_time_t + date () const; + + bool operator==(const Revision&)const; + bool operator!=(const svn_opt_revision_kind)const; + bool operator==(const svn_opt_revision_kind)const; + bool operator==(int)const; + + bool operator!()const; + bool operator!(); + operator bool()const; + operator bool(); + + /** + * assignment operator + * @param what a simple revision string (not s:e but s) + * @return object itself + */ + Revision& operator=(const TQString&what); + + }; +} + +inline TQTextStream& operator<<(TQTextStream&s,svn::Revision&r) +{ + s << r.toString(); + return s; +} + +#endif diff --git a/src/svnqt/revision.hpp b/src/svnqt/revision.hpp deleted file mode 100644 index 86e47ac..0000000 --- a/src/svnqt/revision.hpp +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_REVISION_HPP_ -#define _SVNCPP_REVISION_HPP_ - -// svncpp -#include -#include - -// qt -#include -#include -#include - -// subversion api -#include "svn_types.h" -#include "svn_opt.h" - -namespace svn -{ - /** - * Class that encapsulates svn_opt_revnum_t. - * - * @see svn_opt_revnum_t - */ - class SVNTQT_EXPORT Revision - { - private: - svn_opt_revision_t m_revision; - - void - init (const svn_opt_revision_t * revision); - - void - assign(const TQString&); - - void - assign(const TQDateTime&); - - public: - static const svn_opt_revision_kind START; - static const svn_opt_revision_kind BASE; - static const svn_opt_revision_kind HEAD; - static const svn_opt_revision_kind WORKING; - static const svn_opt_revision_kind UNDEFINED; - static const svn_opt_revision_kind PREV; - - static const svn_opt_revision_kind DATE; - static const svn_opt_revision_kind NUMBER; - - /** - * Constructor - * - * @param revision revision information - */ - Revision (const svn_opt_revision_t * revision); - - /** - * Constructor - * - * @param revnum revision number - */ - Revision (const svn_revnum_t revnum); - - /** - * Constructor - * @param revnum a revision number - * @param revstring a revision string - * - * The revision string MUST uppercase, it may some of "HEAD", "BASE", "WORKING", "COMMITED", "PREV", - * or a date in form {YYYY-MM-DD}. - */ - Revision (const int revnum, const TQString&revstring); - - /** - * Constructor - * @param revstring a revision string - * - * The revision string MUST uppercase, it may some of "HEAD", "BASE", "WORKING", "COMMITED", "PREV", - * or a date in form {YYYY-MM-DD}. - */ - Revision (const TQString&revstring); - - /** - * Constructor - * - * @param kind - */ - Revision (const svn_opt_revision_kind kind = svn_opt_revision_unspecified); - - /** - * Constructor - * - * @param dateTime DateTime wrapper for apr_time_t - * @todo change it to referenced parameter (requires interface upgrade of lib) - */ - Revision (const DateTime dateTime); - /** - * Constructor - * - * @param dateTime TQDateTime type - */ - Revision (const TQDateTime&dateTime); - - /** - * Copy constructor - * - * @param revision Source - */ - Revision (const Revision & revision); - - /** - * @return revision information - */ - const svn_opt_revision_t * - revision () const; - - /** - * @see revision (). Same function - * but with operator overloading - */ - operator svn_opt_revision_t * () - { - return &m_revision; - } - - /** - * @see revision (). Same function - * but with operator overloading - */ - operator const svn_opt_revision_t*()const - { - return &m_revision; - } - - /** - * @return revision numver - */ - svn_revnum_t - revnum () const; - - /** - * @return revision kind - */ - svn_opt_revision_kind - kind () const; - - operator TQString ()const; - TQString toString()const; - - bool isRemote()const; - - /** - * @return date - */ - apr_time_t - date () const; - - bool operator==(const Revision&)const; - bool operator!=(const svn_opt_revision_kind)const; - bool operator==(const svn_opt_revision_kind)const; - bool operator==(int)const; - - bool operator!()const; - bool operator!(); - operator bool()const; - operator bool(); - - /** - * assignment operator - * @param what a simple revision string (not s:e but s) - * @return object itself - */ - Revision& operator=(const TQString&what); - - }; -} - -inline TQTextStream& operator<<(TQTextStream&s,svn::Revision&r) -{ - s << r.toString(); - return s; -} - -#endif diff --git a/src/svnqt/shared_pointer.h b/src/svnqt/shared_pointer.h new file mode 100644 index 0000000..fa9aa2f --- /dev/null +++ b/src/svnqt/shared_pointer.h @@ -0,0 +1,193 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef SVNTQT_SHARED_POINTER_HPP +#define SVNTQT_SHARED_POINTER_HPP + +#include "svnqt/smart_pointer.h" + +/*! + * \file shared_pointer.h + * \brief shared pointer adapter + * \sa smart_pointer.h + */ + +namespace svn +{ + +template class SharedPointer; + +/*! + * Data container for svn::SharedPointer + */ +template class SharedPointerData:public ref_count +{ + friend class SharedPointer; +protected: + //! The protected pointer + T*data; +public: + //! Constructor + /*! + * Take ownership of pointer dt + * \param dt the data to wrap + **/ + SharedPointerData(T*dt){ + data = dt; + } + //! Destructor + /*! + * Release content data + */ + ~SharedPointerData() { + delete data; + } +}; + +//! Shared pointer adapater +/*! + * Implements a thread safe reference counter around any pointer. + * This class takes ownership of data, eg., last reference will delete + * the data it inspects. + */ +template class SharedPointer +{ + typedef SharedPointerData Data; + Data*data; + + //! count down reference of data and release if it was the last share + void unref(){ + if (data) { + data->Decr(); + if (!data->Shared()) { + delete data; + } + data = 0; + } + } +public: + //! empty constructor + SharedPointer():data(0){} + //! copy constructor + /*! + * \param p Data to increase reference for + */ + SharedPointer(const SharedPointer& p) + { + if ( (data = p.data) ) data->Incr(); + } + //! assignment constructor + /*! + * Take ownership of data pointer t + * \param t data pointer to store inside + */ + SharedPointer(T*t) + { + data = new Data(t);data->Incr(); + } + //! destructor + /*! + * decrease reference, if reference == 0 release data + */ + ~SharedPointer() + { + unref(); + } + + //! assignment operator + /*! + * \param p Data to increase reference for + */ + SharedPointer &operator=(const SharedPointer&p) + { + // we always have a reference to the data + if (data==p.data) return *this; + unref(); + if ((data=p.data)) data->Incr(); + return *this; + } + //! assignment operator + /*! + * \param p Data to increase reference for + */ + SharedPointer &operator=(T*p) + { + if (data && data->data==p) { + return *this; + } + unref(); + data = new Data(p); + data->Incr(); + return *this; + } + + //! access operator + /*! + * Use this operator with care! + * \return pointer to wrapped data + */ + operator T*()const {return data->data;} + //! access operator + /*! + * \return reference to wrapped data + */ + T& operator*() {return *data->data;} + //! access operator + /*! + * \return const reference to wrapped data + */ + const T& operator*()const{return *data->data;} + //! access operator + /*! + * \return pointer to wrapped data + */ + T*operator->() {return data->data;} + //! access operator + /*! + * \return const pointer to wrapped data + */ + const T*operator->()const{return data->data;} + + //! Bool operator + /*! + * \return true if content set and not a null-pointer, otherwise false + */ + operator bool () const { return (data != 0 && data->data != 0); } + //! Bool operator + /*! + * \return true if content set and not a null-pointer, otherwise false + */ + operator bool () { return ( data != 0 && data->data != 0 );} + + //! Negation operator + /*! + * \return true if content not set or a null-pointer, otherwise false + */ + bool operator! () const { return (data == 0 || data->data == 0); } + //! Negation operator + /*! + * \return true if content not set or a null-pointer, otherwise false + */ + bool operator! () { return (data == 0 || data->data == 0); } +}; + +} + +#endif diff --git a/src/svnqt/shared_pointer.hpp b/src/svnqt/shared_pointer.hpp deleted file mode 100644 index 4e5ca5b..0000000 --- a/src/svnqt/shared_pointer.hpp +++ /dev/null @@ -1,193 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef SVNTQT_SHARED_POINTER_HPP -#define SVNTQT_SHARED_POINTER_HPP - -#include "svnqt/smart_pointer.hpp" - -/*! - * \file shared_pointer.hpp - * \brief shared pointer adapter - * \sa smart_pointer.hpp - */ - -namespace svn -{ - -template class SharedPointer; - -/*! - * Data container for svn::SharedPointer - */ -template class SharedPointerData:public ref_count -{ - friend class SharedPointer; -protected: - //! The protected pointer - T*data; -public: - //! Constructor - /*! - * Take ownership of pointer dt - * \param dt the data to wrap - **/ - SharedPointerData(T*dt){ - data = dt; - } - //! Destructor - /*! - * Release content data - */ - ~SharedPointerData() { - delete data; - } -}; - -//! Shared pointer adapater -/*! - * Implements a thread safe reference counter around any pointer. - * This class takes ownership of data, eg., last reference will delete - * the data it inspects. - */ -template class SharedPointer -{ - typedef SharedPointerData Data; - Data*data; - - //! count down reference of data and release if it was the last share - void unref(){ - if (data) { - data->Decr(); - if (!data->Shared()) { - delete data; - } - data = 0; - } - } -public: - //! empty constructor - SharedPointer():data(0){} - //! copy constructor - /*! - * \param p Data to increase reference for - */ - SharedPointer(const SharedPointer& p) - { - if ( (data = p.data) ) data->Incr(); - } - //! assignment constructor - /*! - * Take ownership of data pointer t - * \param t data pointer to store inside - */ - SharedPointer(T*t) - { - data = new Data(t);data->Incr(); - } - //! destructor - /*! - * decrease reference, if reference == 0 release data - */ - ~SharedPointer() - { - unref(); - } - - //! assignment operator - /*! - * \param p Data to increase reference for - */ - SharedPointer &operator=(const SharedPointer&p) - { - // we always have a reference to the data - if (data==p.data) return *this; - unref(); - if ((data=p.data)) data->Incr(); - return *this; - } - //! assignment operator - /*! - * \param p Data to increase reference for - */ - SharedPointer &operator=(T*p) - { - if (data && data->data==p) { - return *this; - } - unref(); - data = new Data(p); - data->Incr(); - return *this; - } - - //! access operator - /*! - * Use this operator with care! - * \return pointer to wrapped data - */ - operator T*()const {return data->data;} - //! access operator - /*! - * \return reference to wrapped data - */ - T& operator*() {return *data->data;} - //! access operator - /*! - * \return const reference to wrapped data - */ - const T& operator*()const{return *data->data;} - //! access operator - /*! - * \return pointer to wrapped data - */ - T*operator->() {return data->data;} - //! access operator - /*! - * \return const pointer to wrapped data - */ - const T*operator->()const{return data->data;} - - //! Bool operator - /*! - * \return true if content set and not a null-pointer, otherwise false - */ - operator bool () const { return (data != 0 && data->data != 0); } - //! Bool operator - /*! - * \return true if content set and not a null-pointer, otherwise false - */ - operator bool () { return ( data != 0 && data->data != 0 );} - - //! Negation operator - /*! - * \return true if content not set or a null-pointer, otherwise false - */ - bool operator! () const { return (data == 0 || data->data == 0); } - //! Negation operator - /*! - * \return true if content not set or a null-pointer, otherwise false - */ - bool operator! () { return (data == 0 || data->data == 0); } -}; - -} - -#endif diff --git a/src/svnqt/smart_pointer.h b/src/svnqt/smart_pointer.h new file mode 100644 index 0000000..5d6dd63 --- /dev/null +++ b/src/svnqt/smart_pointer.h @@ -0,0 +1,146 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef _smart_pointer_hpp +#define _smart_pointer_hpp + +#if defined TQT_THREAD_SUPPORT +#include "tqmutex.h" +#endif + +#include "svnqt/svnqt_defines.h" + +/*! + * \file smart_pointer.h + * \brief smart pointer and reference counter + * \author Rajko Albrecht + * + */ + +namespace svn +{ + +//! simple reference counter class +class ref_count { +protected: + //! reference count member + long m_RefCount; +#ifdef TQT_THREAD_SUPPORT + TQMutex m_RefcountMutex; +#endif +public: + //! first reference must be added after "new" via Pointer() + ref_count() : m_RefCount(0) +#ifdef TQT_THREAD_SUPPORT + ,m_RefcountMutex() +#endif + {} + virtual ~ref_count() {} + //! add a reference + void Incr() { +#ifdef TQT_THREAD_SUPPORT + TQMutexLocker a(&m_RefcountMutex); +#endif + ++m_RefCount; + } + //! delete a reference + bool Decr() { +#ifdef TQT_THREAD_SUPPORT + TQMutexLocker a(&m_RefcountMutex); +#endif + --m_RefCount; + return Shared(); + } + //! is it referenced + bool Shared() { return (m_RefCount > 0); } +}; + +//! reference counting wrapper class +template class smart_pointer { + //! pointer to object + /*! + * this object must contain Incr(), Decr() and Shared() + * methode as public members. The best way is, that it will be a child + * class of RefCount + */ + T *ptr; +public: + //! standart constructor + smart_pointer() { ptr = 0; } + //! standart destructor + /*! + * release the reference, if it were the last reference, destroys + * ptr + */ + ~smart_pointer() + { + if (ptr && !ptr->Decr()) { + delete ptr; + } + } + //! construction + smart_pointer(T* t) { if ( (ptr = t) ) ptr->Incr(); } + //! Pointer copy + smart_pointer(const smart_pointer& p) + { if ( (ptr = p.ptr) ) ptr->Incr(); } + //! pointer copy by assignment + smart_pointer& operator= (const smart_pointer& p) + { + // already same: nothing to do + if (ptr == p.ptr) return *this; + // decouple reference + if ( ptr && !ptr->Decr()) delete ptr; + // establish new reference + if ( (ptr = p.ptr) ) ptr->Incr(); + return *this; + } + smart_pointer& operator= (T*p) + { + if (ptr==p)return *this; + if (ptr && !ptr->Decr()) delete ptr; + if ( (ptr=p) ) ptr->Incr(); + return *this; + } + + //! cast to conventional pointer + operator T* () const { return ptr; } + + //! deref: fails for 0 pointer + T& operator* () {return *ptr; } + //! deref: fails for 0 pointer + const T& operator* ()const {return *ptr; } + + //! deref with method call + T* operator-> () {return ptr; } + //! deref with const method call + const T* operator-> ()const {return ptr; } + + //! supports "if (pointer)" + operator bool () const { return (ptr != 0); } + //! "if (pointer)" as non const + operator bool () { return ptr != 0;} + + //! support if (!pointer)" + bool operator! () const { return (ptr == 0); } + //! support if (!pointer)" as non const + bool operator! () { return (ptr == 0); } +}; + +} // namespace svn +#endif diff --git a/src/svnqt/smart_pointer.hpp b/src/svnqt/smart_pointer.hpp deleted file mode 100644 index f579160..0000000 --- a/src/svnqt/smart_pointer.hpp +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef _smart_pointer_hpp -#define _smart_pointer_hpp - -#if defined TQT_THREAD_SUPPORT -#include "tqmutex.h" -#endif - -#include "svnqt/svnqt_defines.hpp" - -/*! - * \file smart_pointer.h - * \brief smart pointer and reference counter - * \author Rajko Albrecht - * - */ - -namespace svn -{ - -//! simple reference counter class -class ref_count { -protected: - //! reference count member - long m_RefCount; -#ifdef TQT_THREAD_SUPPORT - TQMutex m_RefcountMutex; -#endif -public: - //! first reference must be added after "new" via Pointer() - ref_count() : m_RefCount(0) -#ifdef TQT_THREAD_SUPPORT - ,m_RefcountMutex() -#endif - {} - virtual ~ref_count() {} - //! add a reference - void Incr() { -#ifdef TQT_THREAD_SUPPORT - TQMutexLocker a(&m_RefcountMutex); -#endif - ++m_RefCount; - } - //! delete a reference - bool Decr() { -#ifdef TQT_THREAD_SUPPORT - TQMutexLocker a(&m_RefcountMutex); -#endif - --m_RefCount; - return Shared(); - } - //! is it referenced - bool Shared() { return (m_RefCount > 0); } -}; - -//! reference counting wrapper class -template class smart_pointer { - //! pointer to object - /*! - * this object must contain Incr(), Decr() and Shared() - * methode as public members. The best way is, that it will be a child - * class of RefCount - */ - T *ptr; -public: - //! standart constructor - smart_pointer() { ptr = 0; } - //! standart destructor - /*! - * release the reference, if it were the last reference, destroys - * ptr - */ - ~smart_pointer() - { - if (ptr && !ptr->Decr()) { - delete ptr; - } - } - //! construction - smart_pointer(T* t) { if ( (ptr = t) ) ptr->Incr(); } - //! Pointer copy - smart_pointer(const smart_pointer& p) - { if ( (ptr = p.ptr) ) ptr->Incr(); } - //! pointer copy by assignment - smart_pointer& operator= (const smart_pointer& p) - { - // already same: nothing to do - if (ptr == p.ptr) return *this; - // decouple reference - if ( ptr && !ptr->Decr()) delete ptr; - // establish new reference - if ( (ptr = p.ptr) ) ptr->Incr(); - return *this; - } - smart_pointer& operator= (T*p) - { - if (ptr==p)return *this; - if (ptr && !ptr->Decr()) delete ptr; - if ( (ptr=p) ) ptr->Incr(); - return *this; - } - - //! cast to conventional pointer - operator T* () const { return ptr; } - - //! deref: fails for 0 pointer - T& operator* () {return *ptr; } - //! deref: fails for 0 pointer - const T& operator* ()const {return *ptr; } - - //! deref with method call - T* operator-> () {return ptr; } - //! deref with const method call - const T* operator-> ()const {return ptr; } - - //! supports "if (pointer)" - operator bool () const { return (ptr != 0); } - //! "if (pointer)" as non const - operator bool () { return ptr != 0;} - - //! support if (!pointer)" - bool operator! () const { return (ptr == 0); } - //! support if (!pointer)" as non const - bool operator! () { return (ptr == 0); } -}; - -} // namespace svn -#endif diff --git a/src/svnqt/status.cpp b/src/svnqt/status.cpp index c5e47a3..57993b8 100644 --- a/src/svnqt/status.cpp +++ b/src/svnqt/status.cpp @@ -29,10 +29,10 @@ */ // svncpp -#include "status.hpp" -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/path.hpp" -#include "svnqt/url.hpp" +#include "status.h" +#include "svnqt/svnqt_defines.h" +#include "svnqt/path.h" +#include "svnqt/url.h" #include "svn_path.h" diff --git a/src/svnqt/status.h b/src/svnqt/status.h new file mode 100644 index 0000000..79191d3 --- /dev/null +++ b/src/svnqt/status.h @@ -0,0 +1,182 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ +#ifndef _SVNCPP_STATUS_HPP_ +#define _SVNCPP_STATUS_HPP_ + +// subversion api +#include "svn_wc.h" + +// svncpp +#include "svnqt/svnqttypes.h" +#include "svnqt/entry.h" +#include "svnqt/pool.h" +#include "svnqt/lock_entry.h" +#include "svnqt/dirent.h" +#include "svnqt/info_entry.h" +#include "svnqt/svnqt_defines.h" + +namespace svn +{ + /** + * Subversion status API. This class wraps around + * @a svn_wc_status_t. + * + * @see svn_wc.h + * @see svn_wc_status_t + */ + class Status_private; + + class SVNTQT_EXPORT Status + { + public: + /** + * copy constructor + */ + Status (const Status & src); + + /** + * default constructor + * + * @param path path for this status entry + * @param status status entry + */ + Status (const TQString&path=TQString(), svn_wc_status2_t * status = NULL); + /** + * default constructor + * + * @param path path for this status entry + * @param status status entry + */ + Status (const char*path, svn_wc_status2_t * status = NULL); + /** + * converting constructor + */ + Status(const TQString&path,const DirEntryPtr&src); + /** + * converting constructor + */ + Status(const TQString&path,const InfoEntry&src); + + /** + * destructor + */ + virtual ~Status (); + + /** + * @return path of status entry + */ + const TQString& + path () const; + + /** + * @return entry for this path + * @retval entry.isValid () = false item is not versioned + */ + const Entry& + entry () const; + /** + * @return file status property enum of the "textual" component. + */ + svn_wc_status_kind + textStatus () const; + + /** + * @return file status property enum of the "property" component. + */ + svn_wc_status_kind + propStatus () const; + + /** + * @retval TRUE if under version control + */ + bool + isVersioned () const; + + /** + * @retval TRUE if under version control and not ignored + */ + bool + isRealVersioned()const; + + /** + * @retval TRUE if under version control and local modified + */ + bool + isModified()const; + + /** + * @retval TRUE if locked + */ + bool + isLocked () const; + + /** + * @retval TRUE if copied + */ + bool + isCopied () const; + + /** + * @retval TRUE if switched + */ + bool + isSwitched () const; + /** + * @return the entry's text status in the repository + */ + svn_wc_status_kind + reposTextStatus () const; + /** + * @return the entry's prop status in the repository + */ + svn_wc_status_kind + reposPropStatus () const; + + const LockEntry& + lockEntry () const; + + bool + validReposStatus()const; + + bool + validLocalStatus()const; + + + /** + * assignment operator + */ + Status & + operator = (const Status &); + private: + Status_private*m_Data; + }; +} + +#endif diff --git a/src/svnqt/status.hpp b/src/svnqt/status.hpp deleted file mode 100644 index 4bf0c71..0000000 --- a/src/svnqt/status.hpp +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ -#ifndef _SVNCPP_STATUS_HPP_ -#define _SVNCPP_STATUS_HPP_ - -// subversion api -#include "svn_wc.h" - -// svncpp -#include "svnqt/svnqttypes.hpp" -#include "svnqt/entry.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/lock_entry.hpp" -#include "svnqt/dirent.hpp" -#include "svnqt/info_entry.hpp" -#include "svnqt/svnqt_defines.hpp" - -namespace svn -{ - /** - * Subversion status API. This class wraps around - * @a svn_wc_status_t. - * - * @see svn_wc.hpp - * @see svn_wc_status_t - */ - class Status_private; - - class SVNTQT_EXPORT Status - { - public: - /** - * copy constructor - */ - Status (const Status & src); - - /** - * default constructor - * - * @param path path for this status entry - * @param status status entry - */ - Status (const TQString&path=TQString(), svn_wc_status2_t * status = NULL); - /** - * default constructor - * - * @param path path for this status entry - * @param status status entry - */ - Status (const char*path, svn_wc_status2_t * status = NULL); - /** - * converting constructor - */ - Status(const TQString&path,const DirEntryPtr&src); - /** - * converting constructor - */ - Status(const TQString&path,const InfoEntry&src); - - /** - * destructor - */ - virtual ~Status (); - - /** - * @return path of status entry - */ - const TQString& - path () const; - - /** - * @return entry for this path - * @retval entry.isValid () = false item is not versioned - */ - const Entry& - entry () const; - /** - * @return file status property enum of the "textual" component. - */ - svn_wc_status_kind - textStatus () const; - - /** - * @return file status property enum of the "property" component. - */ - svn_wc_status_kind - propStatus () const; - - /** - * @retval TRUE if under version control - */ - bool - isVersioned () const; - - /** - * @retval TRUE if under version control and not ignored - */ - bool - isRealVersioned()const; - - /** - * @retval TRUE if under version control and local modified - */ - bool - isModified()const; - - /** - * @retval TRUE if locked - */ - bool - isLocked () const; - - /** - * @retval TRUE if copied - */ - bool - isCopied () const; - - /** - * @retval TRUE if switched - */ - bool - isSwitched () const; - /** - * @return the entry's text status in the repository - */ - svn_wc_status_kind - reposTextStatus () const; - /** - * @return the entry's prop status in the repository - */ - svn_wc_status_kind - reposPropStatus () const; - - const LockEntry& - lockEntry () const; - - bool - validReposStatus()const; - - bool - validLocalStatus()const; - - - /** - * assignment operator - */ - Status & - operator = (const Status &); - private: - Status_private*m_Data; - }; -} - -#endif diff --git a/src/svnqt/stringarray.cpp b/src/svnqt/stringarray.cpp index 7be5039..db6209e 100644 --- a/src/svnqt/stringarray.cpp +++ b/src/svnqt/stringarray.cpp @@ -18,8 +18,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "svnqt/stringarray.hpp" -#include "svnqt/pool.hpp" +#include "svnqt/stringarray.h" +#include "svnqt/pool.h" #include // apr api diff --git a/src/svnqt/stringarray.h b/src/svnqt/stringarray.h new file mode 100644 index 0000000..5310d68 --- /dev/null +++ b/src/svnqt/stringarray.h @@ -0,0 +1,68 @@ +/*************************************************************************** + * Copyright (C) 2006-2008 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _STRING_ARRAY_HPP +#define _STRING_ARRAY_HPP + +#include "svnqt/svnqt_defines.h" +#include "svnqt/svnqttypes.h" + +#include +#include + +// apr api +#include "apr_tables.h" + +namespace svn +{ + // forward declarations + class Pool; + + /** Handle array of const char * in a c++ like way */ + class SVNTQT_EXPORT StringArray + { + protected: + TQStringList m_content; + bool m_isNull; + + public: + StringArray(); + StringArray(const TQStringList&); + StringArray(const apr_array_header_t * apr_targets); + size_t size()const; + const TQString& operator[](size_t which); + /** + * Returns an apr array containing char*. + * + * @param pool Pool used for conversion + */ + apr_array_header_t * array (const Pool & pool) const; + /** content of array + * @return const reference to data, may used for searches. + */ + const TQStringList& data() const {return m_content;} + + /** if array should return 0 instead of empty array */ + bool isNull()const; + void setNull(bool _n); + }; +} + +#endif diff --git a/src/svnqt/stringarray.hpp b/src/svnqt/stringarray.hpp deleted file mode 100644 index 3f2c3d5..0000000 --- a/src/svnqt/stringarray.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2008 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef _STRING_ARRAY_HPP -#define _STRING_ARRAY_HPP - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/svnqttypes.hpp" - -#include -#include - -// apr api -#include "apr_tables.h" - -namespace svn -{ - // forward declarations - class Pool; - - /** Handle array of const char * in a c++ like way */ - class SVNTQT_EXPORT StringArray - { - protected: - TQStringList m_content; - bool m_isNull; - - public: - StringArray(); - StringArray(const TQStringList&); - StringArray(const apr_array_header_t * apr_targets); - size_t size()const; - const TQString& operator[](size_t which); - /** - * Returns an apr array containing char*. - * - * @param pool Pool used for conversion - */ - apr_array_header_t * array (const Pool & pool) const; - /** content of array - * @return const reference to data, may used for searches. - */ - const TQStringList& data() const {return m_content;} - - /** if array should return 0 instead of empty array */ - bool isNull()const; - void setNull(bool _n); - }; -} - -#endif diff --git a/src/svnqt/svnfilestream.cpp b/src/svnqt/svnfilestream.cpp index b160003..32aaa66 100644 --- a/src/svnqt/svnfilestream.cpp +++ b/src/svnqt/svnfilestream.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "svnfilestream.hpp" +#include "svnfilestream.h" #include diff --git a/src/svnqt/svnfilestream.h b/src/svnqt/svnfilestream.h new file mode 100644 index 0000000..cd46b65 --- /dev/null +++ b/src/svnqt/svnfilestream.h @@ -0,0 +1,69 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SVN_STREAMSVNFILESTREAM_HPP +#define SVN_STREAMSVNFILESTREAM_HPP + +#include "svnstream.h" + +namespace svn { + +namespace stream { + +class SvnFileStream_private; + +/** + @author Rajko Albrecht + @short Writeonly filestream +*/ +class SVNTQT_EXPORT SvnFileOStream : public SvnStream +{ +public: + SvnFileOStream(const TQString&fn,svn_client_ctx_t*ctx=0); + + virtual ~SvnFileOStream(); + + virtual bool isOk() const; + virtual long write(const char* data, const unsigned long max); +private: + SvnFileStream_private*m_FileData; +}; + +/** + @author Rajko Albrecht + @short Readonly filestream +*/ +class SVNTQT_EXPORT SvnFileIStream : public SvnStream +{ +public: + SvnFileIStream(const TQString&fn,svn_client_ctx_t*ctx=0); + + virtual ~SvnFileIStream(); + virtual bool isOk() const; + virtual long read(char* data, const unsigned long max); + +private: + SvnFileStream_private*m_FileData; +}; + +} + +} + +#endif diff --git a/src/svnqt/svnfilestream.hpp b/src/svnqt/svnfilestream.hpp deleted file mode 100644 index e3a9201..0000000 --- a/src/svnqt/svnfilestream.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef SVN_STREAMSVNFILESTREAM_HPP -#define SVN_STREAMSVNFILESTREAM_HPP - -#include "svnstream.hpp" - -namespace svn { - -namespace stream { - -class SvnFileStream_private; - -/** - @author Rajko Albrecht - @short Writeonly filestream -*/ -class SVNTQT_EXPORT SvnFileOStream : public SvnStream -{ -public: - SvnFileOStream(const TQString&fn,svn_client_ctx_t*ctx=0); - - virtual ~SvnFileOStream(); - - virtual bool isOk() const; - virtual long write(const char* data, const unsigned long max); -private: - SvnFileStream_private*m_FileData; -}; - -/** - @author Rajko Albrecht - @short Readonly filestream -*/ -class SVNTQT_EXPORT SvnFileIStream : public SvnStream -{ -public: - SvnFileIStream(const TQString&fn,svn_client_ctx_t*ctx=0); - - virtual ~SvnFileIStream(); - virtual bool isOk() const; - virtual long read(char* data, const unsigned long max); - -private: - SvnFileStream_private*m_FileData; -}; - -} - -} - -#endif diff --git a/src/svnqt/svnqt_defines.h.in b/src/svnqt/svnqt_defines.h.in new file mode 100644 index 0000000..7d35ad7 --- /dev/null +++ b/src/svnqt/svnqt_defines.h.in @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2005-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _SVNTQT_DEFINES_H +#define _SVNTQT_DEFINES_H + +/* defines if we setup against a compiler with working "-fvisibility=hidden" */ +#define SVNTQT_EXPORT @_SVNQT_EXPORT@ +#define SVNTQT_NOEXPORT @_SVNQT_NOEXPORT@ + +/* cmake trick: so we make sure that the define in installs + is always set as in library used at build time + */ +#define TOUTF8 @TOUTF8@ +#define FROMUTF8 @FROMUTF8@ +#define TQLIST @QLIST@ +#define TOASCII @TOASCII@ +#define HOMEDIR @HOMEDIR@ +#define TQLONG @QLONG@ + +#define SVNTQT_SIZE_UNKNOWN TQLONG(-1) + +/* the difference between qt3 and qt4 is too much... :( */ +class TQSqlDatabase; +typedef @QDATABASE@ TQDataBase; +#endif diff --git a/src/svnqt/svnqt_defines.hpp.in b/src/svnqt/svnqt_defines.hpp.in deleted file mode 100644 index 7d35ad7..0000000 --- a/src/svnqt/svnqt_defines.hpp.in +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef _SVNTQT_DEFINES_H -#define _SVNTQT_DEFINES_H - -/* defines if we setup against a compiler with working "-fvisibility=hidden" */ -#define SVNTQT_EXPORT @_SVNQT_EXPORT@ -#define SVNTQT_NOEXPORT @_SVNQT_NOEXPORT@ - -/* cmake trick: so we make sure that the define in installs - is always set as in library used at build time - */ -#define TOUTF8 @TOUTF8@ -#define FROMUTF8 @FROMUTF8@ -#define TQLIST @QLIST@ -#define TOASCII @TOASCII@ -#define HOMEDIR @HOMEDIR@ -#define TQLONG @QLONG@ - -#define SVNTQT_SIZE_UNKNOWN TQLONG(-1) - -/* the difference between qt3 and qt4 is too much... :( */ -class TQSqlDatabase; -typedef @QDATABASE@ TQDataBase; -#endif diff --git a/src/svnqt/svnqttypes.h b/src/svnqt/svnqttypes.h new file mode 100644 index 0000000..080c76b --- /dev/null +++ b/src/svnqt/svnqttypes.h @@ -0,0 +1,100 @@ +/*************************************************************************** + * Copyright (C) 2007 by Rajko Albrecht ral@alwins-world.de * + * http://tdesvn.alwins-world.de/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef _SVNTQT_TYPES_HPP +#define _SVNTQT_TYPES_HPP + +#include "svnqt/svnqt_defines.h" +#include "svnqt/shared_pointer.h" + +// qt +#include + +#include +#include +#include +#include + +namespace svn +{ + // forward declarations + class AnnotateLine; + class Context; + class DirEntry; + class InfoEntry; + class LogEntry; + class Revision; + class Status; + class Targets; + class Path; + class StringArray; + + typedef TQLIST AnnotatedFile; + + typedef SharedPointer DirEntryPtr; + typedef TQLIST DirEntries; + typedef TQLIST InfoEntries; + /// simple list of log entries + typedef TQLIST LogEntries; + /// shared_pointer for LogEntriesMap + typedef SharedPointer LogEntriesPtr; + + /// map of logentries - key is revision + typedef TQMap LogEntriesMap; + /// shared_pointer for LogEntriesMap + typedef SharedPointer LogEntriesMapPtr; + + typedef SharedPointer StatusPtr; + typedef TQLIST StatusEntries; + typedef TQLIST Revisions; + + /** Range of Revision */ + typedef TQPair RevisionRange; + /** list of revision ranges */ + typedef TQLIST RevisionRanges; + + /// map of property names to values + typedef TQMap PropertiesMap; + /// pair of path, PropertiesMap + typedef TQPair PathPropertiesMapEntry; + /// vector of path, Properties pairs + typedef TQLIST PathPropertiesMapList; + /// shared pointer for properties + typedef SharedPointer PathPropertiesMapListPtr; + + typedef TQLIST Pathes; + + //! Mapper enum for svn_depth_t + /*! + * Until subversion prior 1.5 is supported by this lib we must hide the svn_depth_t enum from interface. + * \since subversion 1.5 / svnqt 1.0 + * \sa svn_depth_t + */ + enum Depth { + DepthUnknown, + DepthExclude, + DepthEmpty, + DepthFiles, + DepthImmediates, + DepthInfinity + }; +} + +#endif diff --git a/src/svnqt/svnqttypes.hpp b/src/svnqt/svnqttypes.hpp deleted file mode 100644 index 5d16658..0000000 --- a/src/svnqt/svnqttypes.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007 by Rajko Albrecht ral@alwins-world.de * - * http://tdesvn.alwins-world.de/ * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef _SVNTQT_TYPES_HPP -#define _SVNTQT_TYPES_HPP - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/shared_pointer.hpp" - -// qt -#include - -#include -#include -#include -#include - -namespace svn -{ - // forward declarations - class AnnotateLine; - class Context; - class DirEntry; - class InfoEntry; - class LogEntry; - class Revision; - class Status; - class Targets; - class Path; - class StringArray; - - typedef TQLIST AnnotatedFile; - - typedef SharedPointer DirEntryPtr; - typedef TQLIST DirEntries; - typedef TQLIST InfoEntries; - /// simple list of log entries - typedef TQLIST LogEntries; - /// shared_pointer for LogEntriesMap - typedef SharedPointer LogEntriesPtr; - - /// map of logentries - key is revision - typedef TQMap LogEntriesMap; - /// shared_pointer for LogEntriesMap - typedef SharedPointer LogEntriesMapPtr; - - typedef SharedPointer StatusPtr; - typedef TQLIST StatusEntries; - typedef TQLIST Revisions; - - /** Range of Revision */ - typedef TQPair RevisionRange; - /** list of revision ranges */ - typedef TQLIST RevisionRanges; - - /// map of property names to values - typedef TQMap PropertiesMap; - /// pair of path, PropertiesMap - typedef TQPair PathPropertiesMapEntry; - /// vector of path, Properties pairs - typedef TQLIST PathPropertiesMapList; - /// shared pointer for properties - typedef SharedPointer PathPropertiesMapListPtr; - - typedef TQLIST Pathes; - - //! Mapper enum for svn_depth_t - /*! - * Until subversion prior 1.5 is supported by this lib we must hide the svn_depth_t enum from interface. - * \since subversion 1.5 / svnqt 1.0 - * \sa svn_depth_t - */ - enum Depth { - DepthUnknown, - DepthExclude, - DepthEmpty, - DepthFiles, - DepthImmediates, - DepthInfinity - }; -} - -#endif diff --git a/src/svnqt/svnstream.cpp b/src/svnqt/svnstream.cpp index 53d115e..657e51b 100644 --- a/src/svnqt/svnstream.cpp +++ b/src/svnqt/svnstream.cpp @@ -17,9 +17,9 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "svnqt/svnstream.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/apr.hpp" +#include "svnqt/svnstream.h" +#include "svnqt/pool.h" +#include "svnqt/apr.h" // Subversion api #include "svn_client.h" diff --git a/src/svnqt/svnstream.h b/src/svnqt/svnstream.h new file mode 100644 index 0000000..e71034b --- /dev/null +++ b/src/svnqt/svnstream.h @@ -0,0 +1,163 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SVNSVNSTREAM_HPP +#define SVNSVNSTREAM_HPP + +#include "svnqt/svnqt_defines.h" + +#include + +#include +struct svn_client_ctx_t; + +namespace svn { + +namespace stream { +class SvnStream_private; + +/** + @author Rajko Albrecht + @short wrapper class around the svn_stream_t structure +*/ +class SVNTQT_EXPORT SvnStream{ + friend class SvnStream_private; +public: + //! Constructor + /*! + * Setup a svn_stream_t and holds a required pool. The stream will freed + * when deleting this object. + * \param readit set readable + * \param writeit set writable + * \param ctx a client context for calls to cancel_func inside. you should this only set with functions not using it itself + * like svn_client_cat2: + */ + SvnStream(bool readit, bool writeit, svn_client_ctx_t * ctx = 0); + //! frees all structures and releases memory pool. + virtual ~SvnStream(); + + //! operator returning transparent a svn_stream_t structure + /*! + \return a svn_stream_t structure for use with subversion api. + */ + operator svn_stream_t* ()const; + + //! write operation + /*! + Write data FROM subversion to the class behind. Eg., data comes from + subversion-api and this method has to do something with it (printing on a window, writing to a file) + This implementation always returns -1 (eg, error), must reimplemented for real usage. + \param data the data to written + \param max maximum data to write + \return should return the amount of data real written, in case of error must return -1 + \sa setError(int ioError), setError(const TQString&error), read(char*data,const unsigned long max) + */ + virtual long write(const char*data,const unsigned long max); + //! read operation + /*! implements the wrapper for svn_stream_read, eg. data are read FROM class (eg, file, string or whatever) + into subversion-api. This implementation always returns -1 (eg, error), must reimplemented for real usage. + \param data target array where to store the read + \param max maximum byte count to read + \return amount of data read or -1 in case of error + \sa setError(int ioError), setError(const TQString&error), write(const char*data,const unsigned long max) + */ + virtual long read(char*data,const unsigned long max); + + //! returns the error set + /*! + \return a human readable message about the reason the last operation failed. + */ + virtual const TQString& lastError()const; + //! is that stream usable + /*! + Gives information about if the stream object is usable. May if the file is real open or such. + \return true if stream is usable, false if not. + */ + virtual bool isOk()const = 0; + + svn_client_ctx_t * context(); + +protected: + //! set a human readable errormessage + /*! + This message may printed to the user and will checked if one of the stream-operations failed. So should set from + write and/or read if them will return -1 (for error) + \param error the errormessage assigned. + */ + virtual void setError(const TQString&error)const; + //! set the internal error + /*! \param ioError error code from TQIODevide::status + */ + + virtual void setError(int ioError)const; + +protected: + int cancelElapsed()const; + void cancelTimeReset(); + +private: + SvnStream_private*m_Data; + /* disable default contructor */ + SvnStream(); +}; + +class SvnByteStream_private; + +//! a class let subversion print into a TQByteArray +class SVNTQT_EXPORT SvnByteStream:public SvnStream +{ +public: + //! constructor + /*! + creates internal buffer + * \param ctx a client context for calls to cancel_func inside. you should this only set with functions not using it itself + * like svn_client_cat2: + */ + SvnByteStream(svn_client_ctx_t * ctx = 0); + //! release internal buffer + virtual ~SvnByteStream(); + //! fill internal buffer with data + /*! + stores the data written into the internal buffer. + \param data data to store + \param max length of data to store + \return data real stored or -1 if error. + */ + virtual long write(const char*data,const unsigned long max); + + //! return the data stored + /*! + \return the internal stored data + */ + TQByteArray content()const; + //! checks if the buffer is usable. + /*! + * \return true if data may written, false if not, in that case a errormessage will set. + */ + virtual bool isOk()const; + +private: + SvnByteStream_private*m_ByteData; +}; + +} // namespace stream + +} // namespace svn + +#endif diff --git a/src/svnqt/svnstream.hpp b/src/svnqt/svnstream.hpp deleted file mode 100644 index 6a14640..0000000 --- a/src/svnqt/svnstream.hpp +++ /dev/null @@ -1,163 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef SVNSVNSTREAM_HPP -#define SVNSVNSTREAM_HPP - -#include "svnqt/svnqt_defines.hpp" - -#include - -#include -struct svn_client_ctx_t; - -namespace svn { - -namespace stream { -class SvnStream_private; - -/** - @author Rajko Albrecht - @short wrapper class around the svn_stream_t structure -*/ -class SVNTQT_EXPORT SvnStream{ - friend class SvnStream_private; -public: - //! Constructor - /*! - * Setup a svn_stream_t and holds a required pool. The stream will freed - * when deleting this object. - * \param readit set readable - * \param writeit set writable - * \param ctx a client context for calls to cancel_func inside. you should this only set with functions not using it itself - * like svn_client_cat2: - */ - SvnStream(bool readit, bool writeit, svn_client_ctx_t * ctx = 0); - //! frees all structures and releases memory pool. - virtual ~SvnStream(); - - //! operator returning transparent a svn_stream_t structure - /*! - \return a svn_stream_t structure for use with subversion api. - */ - operator svn_stream_t* ()const; - - //! write operation - /*! - Write data FROM subversion to the class behind. Eg., data comes from - subversion-api and this method has to do something with it (printing on a window, writing to a file) - This implementation always returns -1 (eg, error), must reimplemented for real usage. - \param data the data to written - \param max maximum data to write - \return should return the amount of data real written, in case of error must return -1 - \sa setError(int ioError), setError(const TQString&error), read(char*data,const unsigned long max) - */ - virtual long write(const char*data,const unsigned long max); - //! read operation - /*! implements the wrapper for svn_stream_read, eg. data are read FROM class (eg, file, string or whatever) - into subversion-api. This implementation always returns -1 (eg, error), must reimplemented for real usage. - \param data target array where to store the read - \param max maximum byte count to read - \return amount of data read or -1 in case of error - \sa setError(int ioError), setError(const TQString&error), write(const char*data,const unsigned long max) - */ - virtual long read(char*data,const unsigned long max); - - //! returns the error set - /*! - \return a human readable message about the reason the last operation failed. - */ - virtual const TQString& lastError()const; - //! is that stream usable - /*! - Gives information about if the stream object is usable. May if the file is real open or such. - \return true if stream is usable, false if not. - */ - virtual bool isOk()const = 0; - - svn_client_ctx_t * context(); - -protected: - //! set a human readable errormessage - /*! - This message may printed to the user and will checked if one of the stream-operations failed. So should set from - write and/or read if them will return -1 (for error) - \param error the errormessage assigned. - */ - virtual void setError(const TQString&error)const; - //! set the internal error - /*! \param ioError error code from TQIODevide::status - */ - - virtual void setError(int ioError)const; - -protected: - int cancelElapsed()const; - void cancelTimeReset(); - -private: - SvnStream_private*m_Data; - /* disable default contructor */ - SvnStream(); -}; - -class SvnByteStream_private; - -//! a class let subversion print into a TQByteArray -class SVNTQT_EXPORT SvnByteStream:public SvnStream -{ -public: - //! constructor - /*! - creates internal buffer - * \param ctx a client context for calls to cancel_func inside. you should this only set with functions not using it itself - * like svn_client_cat2: - */ - SvnByteStream(svn_client_ctx_t * ctx = 0); - //! release internal buffer - virtual ~SvnByteStream(); - //! fill internal buffer with data - /*! - stores the data written into the internal buffer. - \param data data to store - \param max length of data to store - \return data real stored or -1 if error. - */ - virtual long write(const char*data,const unsigned long max); - - //! return the data stored - /*! - \return the internal stored data - */ - TQByteArray content()const; - //! checks if the buffer is usable. - /*! - * \return true if data may written, false if not, in that case a errormessage will set. - */ - virtual bool isOk()const; - -private: - SvnByteStream_private*m_ByteData; -}; - -} // namespace stream - -} // namespace svn - -#endif diff --git a/src/svnqt/targets.cpp b/src/svnqt/targets.cpp index 35b8ea0..e9a2d5f 100644 --- a/src/svnqt/targets.cpp +++ b/src/svnqt/targets.cpp @@ -36,10 +36,10 @@ #include "apr_strings.h" // svncpp -#include "svnqt/targets.hpp" -#include "svnqt/path.hpp" -#include "svnqt/pool.hpp" -#include "svnqt/svnqt_defines.hpp" +#include "svnqt/targets.h" +#include "svnqt/path.h" +#include "svnqt/pool.h" +#include "svnqt/svnqt_defines.h" #include diff --git a/src/svnqt/targets.h b/src/svnqt/targets.h new file mode 100644 index 0000000..9ef63db --- /dev/null +++ b/src/svnqt/targets.h @@ -0,0 +1,159 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_TARGETS_HPP_ +#define _SVNCPP_TARGETS_HPP_ + +#include "svnqt/svnqt_defines.h" +#include "svnqt/svnqttypes.h" + +#include +#include + +// apr api +#include "apr_tables.h" + +class TQStringList; + +namespace svn +{ + // forward declarations + class Pool; + + /** + * Encapsulation for Subversion target arrays handling + */ + class SVNTQT_EXPORT Targets + { + public: + /** + * Constructor + * + * @param targets vector of paths + */ + Targets (const Pathes & targets); + + /** + * Constructor + * @param path a single paths + */ + Targets (const Path & targets); + + /** + * Constructor from an APR array containing + * char *. + * + * @param targets APR array header + */ + Targets (const apr_array_header_t * targets); + + /** + * Constructor. Initializes list with just + * one entry + * + * @param target + */ + Targets (const TQString& target = TQString()); + /** + * Constructor. Initializes list with just + * one entry + * + * @param target + */ + Targets (const char * target); + /** + * Constructor. Convert stringlist into target list. + * @param targets + */ + Targets(const TQStringList&targets); + + /** + * Copy Constructor + * + * @param targets Source + */ + Targets (const Targets & targets); + + /** + * Destructor + */ + virtual ~Targets (); + + /** + * Returns an apr array containing + * char *. + * + * @param pool Pool used for conversion + */ + apr_array_header_t * + array (const Pool & pool) const; + + /** + * Returns a vector of paths + * + * @return vector of paths + */ + const Pathes & + targets() const; + + /** + * @return the number of targets + */ + size_t size () const; + + /** + * operator to return the vector + * + * @return vector with targets + */ + operator const Pathes & () const + { + return m_targets; + } + + const Path& operator [](size_t which)const; + /** + * returns one single target. + * the first in the vector, if no parameter given if there are more + * than one. if there is no target or parameter > then stored pathes returns + * an empty path + * \param which which item we want + * @return single path + */ + const Path + target(unsigned int which = 0) const; + + + private: + Pathes m_targets; + }; +} + +#endif diff --git a/src/svnqt/targets.hpp b/src/svnqt/targets.hpp deleted file mode 100644 index a7afbbb..0000000 --- a/src/svnqt/targets.hpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_TARGETS_HPP_ -#define _SVNCPP_TARGETS_HPP_ - -#include "svnqt/svnqt_defines.hpp" -#include "svnqt/svnqttypes.hpp" - -#include -#include - -// apr api -#include "apr_tables.h" - -class TQStringList; - -namespace svn -{ - // forward declarations - class Pool; - - /** - * Encapsulation for Subversion target arrays handling - */ - class SVNTQT_EXPORT Targets - { - public: - /** - * Constructor - * - * @param targets vector of paths - */ - Targets (const Pathes & targets); - - /** - * Constructor - * @param path a single paths - */ - Targets (const Path & targets); - - /** - * Constructor from an APR array containing - * char *. - * - * @param targets APR array header - */ - Targets (const apr_array_header_t * targets); - - /** - * Constructor. Initializes list with just - * one entry - * - * @param target - */ - Targets (const TQString& target = TQString()); - /** - * Constructor. Initializes list with just - * one entry - * - * @param target - */ - Targets (const char * target); - /** - * Constructor. Convert stringlist into target list. - * @param targets - */ - Targets(const TQStringList&targets); - - /** - * Copy Constructor - * - * @param targets Source - */ - Targets (const Targets & targets); - - /** - * Destructor - */ - virtual ~Targets (); - - /** - * Returns an apr array containing - * char *. - * - * @param pool Pool used for conversion - */ - apr_array_header_t * - array (const Pool & pool) const; - - /** - * Returns a vector of paths - * - * @return vector of paths - */ - const Pathes & - targets() const; - - /** - * @return the number of targets - */ - size_t size () const; - - /** - * operator to return the vector - * - * @return vector with targets - */ - operator const Pathes & () const - { - return m_targets; - } - - const Path& operator [](size_t which)const; - /** - * returns one single target. - * the first in the vector, if no parameter given if there are more - * than one. if there is no target or parameter > then stored pathes returns - * an empty path - * \param which which item we want - * @return single path - */ - const Path - target(unsigned int which = 0) const; - - - private: - Pathes m_targets; - }; -} - -#endif diff --git a/src/svnqt/testmain.cpp b/src/svnqt/testmain.cpp index fd46e9b..0795001 100644 --- a/src/svnqt/testmain.cpp +++ b/src/svnqt/testmain.cpp @@ -17,10 +17,10 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "client.hpp" -#include "repository.hpp" -#include "context.hpp" -#include "datetime.hpp" +#include "client.h" +#include "repository.h" +#include "context.h" +#include "datetime.h" #include diff --git a/src/svnqt/tests/ckpath.cpp b/src/svnqt/tests/ckpath.cpp index 64a57ca..697e153 100644 --- a/src/svnqt/tests/ckpath.cpp +++ b/src/svnqt/tests/ckpath.cpp @@ -1,4 +1,4 @@ -#include "src/svnqt/path.hpp" +#include "src/svnqt/path.h" #include int main(int,char**) diff --git a/src/svnqt/tests/crepo.cpp b/src/svnqt/tests/crepo.cpp index fa43d90..b07c09a 100644 --- a/src/svnqt/tests/crepo.cpp +++ b/src/svnqt/tests/crepo.cpp @@ -1,8 +1,8 @@ -#include "src/svnqt/client.hpp" +#include "src/svnqt/client.h" #include "src/svnqt/tests/testconfig.h" -#include "src/svnqt/repository.hpp" -#include "src/svnqt/repositorylistener.hpp" -#include "src/svnqt/targets.hpp" +#include "src/svnqt/repository.h" +#include "src/svnqt/repositorylistener.h" +#include "src/svnqt/targets.h" #include "testlistener.h" diff --git a/src/svnqt/tests/lsdir.cpp b/src/svnqt/tests/lsdir.cpp index f3a2f6f..9edbc25 100644 --- a/src/svnqt/tests/lsdir.cpp +++ b/src/svnqt/tests/lsdir.cpp @@ -1,8 +1,8 @@ -#include "src/svnqt/client.hpp" +#include "src/svnqt/client.h" #include "src/svnqt/tests/testconfig.h" -#include "src/svnqt/status.hpp" -#include "src/svnqt/svnqttypes.hpp" +#include "src/svnqt/status.h" +#include "src/svnqt/svnqttypes.h" #include int main(int,char**) diff --git a/src/svnqt/tests/testlistener.h b/src/svnqt/tests/testlistener.h index 3efa96d..8d1300a 100644 --- a/src/svnqt/tests/testlistener.h +++ b/src/svnqt/tests/testlistener.h @@ -1,7 +1,7 @@ #ifndef _TESTLISTENER_ #define _TESTLISTENER_ -#include "src/svnqt/context_listener.hpp" +#include "src/svnqt/context_listener.h" class TestListener:public svn::ContextListener { diff --git a/src/svnqt/url.cpp b/src/svnqt/url.cpp index df8bd9b..c147c84 100644 --- a/src/svnqt/url.cpp +++ b/src/svnqt/url.cpp @@ -33,8 +33,8 @@ // svncpp -#include "pool.hpp" -#include "url.hpp" +#include "pool.h" +#include "url.h" #include #include diff --git a/src/svnqt/url.h b/src/svnqt/url.h new file mode 100644 index 0000000..06bf78e --- /dev/null +++ b/src/svnqt/url.h @@ -0,0 +1,86 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_URL_H_ +#define _SVNCPP_URL_H_ + +#include "svnqt/svnqt_defines.h" + +// qt +#include + +#include +#include + +namespace svn +{ + class SVNTQT_EXPORT Url + { + public: + /** Constructor */ + Url (); + + /** Destructor */ + virtual ~Url (); + + /** + * Checks if @a url is valid + * + * Example of a valid URL: + * http://svn.collab.net/repos/svn + * Example of an invalid URL: + * /home/foo/bar + */ + static bool + isValid (const TQString& url); + + /** + * Checks if @a url points to a local filesystem. + * + * @return true if url is accessed local without network. + */ + static bool + isLocal(const TQString& url); + + static TQString + transformProtokoll(const TQString&); + + /** + * returns a vector with url schemas that are + * supported by svn + * + * @return vector with entries like "file:", "http:" + */ + static TQValueList + supportedSchemas (); + }; +} + +#endif diff --git a/src/svnqt/url.hpp b/src/svnqt/url.hpp deleted file mode 100644 index 80d22ae..0000000 --- a/src/svnqt/url.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_URL_H_ -#define _SVNCPP_URL_H_ - -#include "svnqt/svnqt_defines.hpp" - -// qt -#include - -#include -#include - -namespace svn -{ - class SVNTQT_EXPORT Url - { - public: - /** Constructor */ - Url (); - - /** Destructor */ - virtual ~Url (); - - /** - * Checks if @a url is valid - * - * Example of a valid URL: - * http://svn.collab.net/repos/svn - * Example of an invalid URL: - * /home/foo/bar - */ - static bool - isValid (const TQString& url); - - /** - * Checks if @a url points to a local filesystem. - * - * @return true if url is accessed local without network. - */ - static bool - isLocal(const TQString& url); - - static TQString - transformProtokoll(const TQString&); - - /** - * returns a vector with url schemas that are - * supported by svn - * - * @return vector with entries like "file:", "http:" - */ - static TQValueList - supportedSchemas (); - }; -} - -#endif diff --git a/src/svnqt/version_check.cpp b/src/svnqt/version_check.cpp index ceb8e49..fa63a00 100644 --- a/src/svnqt/version_check.cpp +++ b/src/svnqt/version_check.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include "version_check.hpp" +#include "version_check.h" #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/src/svnqt/version_check.h b/src/svnqt/version_check.h new file mode 100644 index 0000000..f6129ac --- /dev/null +++ b/src/svnqt/version_check.h @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef __VERSION_CHECK_HPP +#define __VERSION_CHECK_HPP + +#include "svnqt/svnqt_defines.h" + +class TQString; + +namespace svn { + class SVNTQT_EXPORT Version { + + public: + Version(){} + ~Version(){} + + static bool client_version_compatible(); + static const TQString linked_version(); + static const TQString running_version(); + + static int version_major(); + static int version_minor(); + }; +} + +#endif diff --git a/src/svnqt/version_check.hpp b/src/svnqt/version_check.hpp deleted file mode 100644 index a16f233..0000000 --- a/src/svnqt/version_check.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef __VERSION_CHECK_HPP -#define __VERSION_CHECK_HPP - -#include "svnqt/svnqt_defines.hpp" - -class TQString; - -namespace svn { - class SVNTQT_EXPORT Version { - - public: - Version(){} - ~Version(){} - - static bool client_version_compatible(); - static const TQString linked_version(); - static const TQString running_version(); - - static int version_major(); - static int version_minor(); - }; -} - -#endif diff --git a/src/svnqt/wc.cpp b/src/svnqt/wc.cpp index bc41097..8ed0514 100644 --- a/src/svnqt/wc.cpp +++ b/src/svnqt/wc.cpp @@ -32,10 +32,10 @@ #include "svn_wc.h" // svncpp -#include "exception.hpp" -#include "path.hpp" -#include "pool.hpp" -#include "wc.hpp" +#include "exception.h" +#include "path.h" +#include "pool.h" +#include "wc.h" namespace svn { diff --git a/src/svnqt/wc.h b/src/svnqt/wc.h new file mode 100644 index 0000000..fa41c2d --- /dev/null +++ b/src/svnqt/wc.h @@ -0,0 +1,91 @@ +/* + * Port for usage with qt-framework and development for tdesvn + * (C) 2005-2007 by Rajko Albrecht + * http://tdesvn.alwins-world.de + */ +/* + * ==================================================================== + * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 library (in the file LGPL.txt); if not, + * write to the Free Software Foundation, Inc., 51 Franklin St, + * Fifth Floor, Boston, MA 02110-1301 USA + * + * This software consists of voluntary contributions made by many + * individuals. For exact contribution history, see the revision + * history and logs, available at http://rapidsvn.tigris.org/. + * ==================================================================== + */ + +#ifndef _SVNCPP_WC_HPP_ +#define _SVNCPP_WC_HPP_ + +// Ignore MSVC 7, 2005 & 2008 compiler warning: C++ exception specification +#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1550 +#pragma warning (disable: 4290) +#endif + +// svncpp +#include "svnqt/exception.h" +#include "svnqt/revision.h" +#include "svnqt/svnqt_defines.h" + +#include + +namespace svn +{ + /** + * Class that deals with a working copy + */ + class SVNTQT_EXPORT Wc + { + public: + /** + * check if Path is a valid working directory + * + * @param dir path to a directory + * @return true=valid working copy + */ + static bool + checkWc (const TQString& dir); + + /** + * ensure that an administrative area exists for @a dir, so that @a dir + * is a working copy subdir based on @a url at @a revision. + * + * @param dir path to a directory + * @param uuid + * @param url corresponding url + * @param revision expected working copy revision + */ + static void + ensureAdm (const TQString& dir, const TQString& uuid, + const TQString& url, const Revision & revision) throw (ClientException); + + /** + * retrieve the url of a given working copy item + * @param path the working copy item to check + * @return the repository url of @a path + */ + static TQString getUrl(const TQString&path) throw (ClientException); + static TQString getRepos(const TQString&path) throw (ClientException); + static const char * ADM_DIR_NAME; + + private: + static const svn_wc_entry_t *getEntry( const TQString &path ) throw ( ClientException ); + + }; +} + +#endif diff --git a/src/svnqt/wc.hpp b/src/svnqt/wc.hpp deleted file mode 100644 index 33f15a2..0000000 --- a/src/svnqt/wc.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Port for usage with qt-framework and development for tdesvn - * (C) 2005-2007 by Rajko Albrecht - * http://tdesvn.alwins-world.de - */ -/* - * ==================================================================== - * Copyright (c) 2002-2005 The RapidSvn Group. All rights reserved. - * - * This library 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 2.1 of the License, or (at your option) any later version. - * - * This library 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 library (in the file LGPL.txt); if not, - * write to the Free Software Foundation, Inc., 51 Franklin St, - * Fifth Floor, Boston, MA 02110-1301 USA - * - * This software consists of voluntary contributions made by many - * individuals. For exact contribution history, see the revision - * history and logs, available at http://rapidsvn.tigris.org/. - * ==================================================================== - */ - -#ifndef _SVNCPP_WC_HPP_ -#define _SVNCPP_WC_HPP_ - -// Ignore MSVC 7, 2005 & 2008 compiler warning: C++ exception specification -#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1550 -#pragma warning (disable: 4290) -#endif - -// svncpp -#include "svnqt/exception.hpp" -#include "svnqt/revision.hpp" -#include "svnqt/svnqt_defines.hpp" - -#include - -namespace svn -{ - /** - * Class that deals with a working copy - */ - class SVNTQT_EXPORT Wc - { - public: - /** - * check if Path is a valid working directory - * - * @param dir path to a directory - * @return true=valid working copy - */ - static bool - checkWc (const TQString& dir); - - /** - * ensure that an administrative area exists for @a dir, so that @a dir - * is a working copy subdir based on @a url at @a revision. - * - * @param dir path to a directory - * @param uuid - * @param url corresponding url - * @param revision expected working copy revision - */ - static void - ensureAdm (const TQString& dir, const TQString& uuid, - const TQString& url, const Revision & revision) throw (ClientException); - - /** - * retrieve the url of a given working copy item - * @param path the working copy item to check - * @return the repository url of @a path - */ - static TQString getUrl(const TQString&path) throw (ClientException); - static TQString getRepos(const TQString&path) throw (ClientException); - static const char * ADM_DIR_NAME; - - private: - static const svn_wc_entry_t *getEntry( const TQString &path ) throw ( ClientException ); - - }; -} - -#endif diff --git a/src/tdeiosvn/tdeiobytestream.h b/src/tdeiosvn/tdeiobytestream.h index ebe1a91..34a8b46 100644 --- a/src/tdeiosvn/tdeiobytestream.h +++ b/src/tdeiosvn/tdeiobytestream.h @@ -20,7 +20,7 @@ #ifndef TDEIOBYTESTREAM_H #define TDEIOBYTESTREAM_H -#include "svnstream.hpp" +#include "svnstream.h" #include #include diff --git a/src/tdeiosvn/tdeiolistener.h b/src/tdeiosvn/tdeiolistener.h index 6663239..eda598d 100644 --- a/src/tdeiosvn/tdeiolistener.h +++ b/src/tdeiosvn/tdeiolistener.h @@ -20,7 +20,7 @@ #ifndef TDEIOLISTENER_H #define TDEIOLISTENER_H -#include "context_listener.hpp" +#include "context_listener.h" #include "pwstorage.h" namespace TDEIO { diff --git a/src/tdeiosvn/tdeiosvn.cpp b/src/tdeiosvn/tdeiosvn.cpp index 97c293a..2f35ee9 100644 --- a/src/tdeiosvn/tdeiosvn.cpp +++ b/src/tdeiosvn/tdeiosvn.cpp @@ -21,12 +21,12 @@ #include "tdeiosvn.h" #include "tdeiolistener.h" -#include "svnqttypes.hpp" -#include "dirent.hpp" -#include "url.hpp" -#include "status.hpp" -#include "targets.hpp" -#include "info_entry.hpp" +#include "svnqttypes.h" +#include "dirent.h" +#include "url.h" +#include "status.h" +#include "targets.h" +#include "info_entry.h" #include "tdesvnsettings.h" #include "sub2qt.h" #include "sshagent.h" diff --git a/src/tdesvn_events.h b/src/tdesvn_events.h index 021add1..d2ada3e 100644 --- a/src/tdesvn_events.h +++ b/src/tdesvn_events.h @@ -2,7 +2,7 @@ #define __TDESVN_EVENTS_H #include -#include "src/svnqt/svnqt_defines.hpp" +#include "src/svnqt/svnqt_defines.h" class FillCacheStatusEvent:public TQCustomEvent { diff --git a/src/tdesvn_part.cpp b/src/tdesvn_part.cpp index aca3898..1a9ed04 100644 --- a/src/tdesvn_part.cpp +++ b/src/tdesvn_part.cpp @@ -28,8 +28,8 @@ #include "cmdexecsettings_impl.h" #include "tdesvnview.h" #include "commandline_part.h" -#include "version_check.hpp" -#include "url.hpp" +#include "version_check.h" +#include "url.h" #include "helpers/ktranslateurl.h" #include "helpers/sshagent.h" diff --git a/src/tdesvnd/tdesvnd_dcop.cpp b/src/tdesvnd/tdesvnd_dcop.cpp index 6e58707..2bc7173 100644 --- a/src/tdesvnd/tdesvnd_dcop.cpp +++ b/src/tdesvnd/tdesvnd_dcop.cpp @@ -25,11 +25,11 @@ #include "logmsg_impl.h" #include "tdesvnsettings.h" #include "pwstorage.h" -#include "client.hpp" -#include "revision.hpp" -#include "status.hpp" -#include "context_listener.hpp" -#include "url.hpp" +#include "client.h" +#include "revision.h" +#include "status.h" +#include "context_listener.h" +#include "url.h" #include "ktranslateurl.h" #include diff --git a/src/tdesvnview.cpp b/src/tdesvnview.cpp index cfa690a..78849da 100644 --- a/src/tdesvnview.cpp +++ b/src/tdesvnview.cpp @@ -28,10 +28,10 @@ #include "svnfrontend/stopdlg.h" #include "svnfrontend/fronthelpers/propertylist.h" #include "tdesvnsettings.h" -#include "url.hpp" -#include "repository.hpp" -#include "version_check.hpp" -#include "svnqttypes.hpp" +#include "url.h" +#include "repository.h" +#include "version_check.h" +#include "svnqttypes.h" #include #include diff --git a/src/tdesvnview.h b/src/tdesvnview.h index 7c9690c..173bfbc 100644 --- a/src/tdesvnview.h +++ b/src/tdesvnview.h @@ -22,7 +22,7 @@ #ifndef _TDESVNVIEW_H_ #define _TDESVNVIEW_H_ -#include "repositorylistener.hpp" +#include "repositorylistener.h" #include #include -- cgit v1.2.3