[Grandmas-svn-commit] SF.net SVN: grandmas-svn: [77] trunk
Brought to you by:
matthiasmiller
From: <mat...@us...> - 2006-11-04 11:28:03
|
Revision: 77 http://svn.sourceforge.net/grandmas-svn/?rev=77&view=rev Author: matthiasmiller Date: 2006-11-04 03:27:56 -0800 (Sat, 04 Nov 2006) Log Message: ----------- move APR and SVN stub classes to the svn directory Modified Paths: -------------- trunk/grandmas_svn.pro trunk/include/svn/server_access.h trunk/src/main.cpp Added Paths: ----------- trunk/include/svn/pool.h trunk/src/svn/pool.cpp Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-11-03 22:40:28 UTC (rev 76) +++ trunk/grandmas_svn.pro 2006-11-04 11:27:56 UTC (rev 77) @@ -125,6 +125,7 @@ include/svn/modification.h \ include/svn/operation.h \ include/svn/operation_internal.h \ + include/svn/pool.h \ include/svn/revision.h \ include/svn/server_access.h \ src/grandmas_svn.h @@ -144,6 +145,7 @@ src/svn/file_access.cpp \ src/svn/operation.cpp \ src/svn/operation_internal.cpp \ + src/svn/pool.cpp \ src/svn/revision.cpp \ src/svn/server_access.cpp \ src/grandmas_svn.cpp \ Copied: trunk/include/svn/pool.h (from rev 74, trunk/templates/h) =================================================================== --- trunk/include/svn/pool.h (rev 0) +++ trunk/include/svn/pool.h 2006-11-04 11:27:56 UTC (rev 77) @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef SVN_POOL_H +#define SVN_POOL_H + +#include <QtGlobal> + +struct apr_pool_t; + +class AprPoolWrapper +{ +public: + AprPoolWrapper(); + ~AprPoolWrapper(); + apr_pool_t* getPool(); + +private: + Q_DISABLE_COPY(AprPoolWrapper); + + apr_pool_t* mPool; +}; + +#endif \ No newline at end of file Modified: trunk/include/svn/server_access.h =================================================================== --- trunk/include/svn/server_access.h 2006-11-03 22:40:28 UTC (rev 76) +++ trunk/include/svn/server_access.h 2006-11-04 11:27:56 UTC (rev 77) @@ -35,6 +35,20 @@ virtual bool shouldCancel()=0; }; +class SvnOperationStatusUnimpl : public SvnOperationStatus +{ +public: + virtual ~SvnOperationStatusUnimpl() {} + virtual void update(QString textToAdd) + { + Q_UNUSED(textToAdd); + } + virtual bool shouldCancel() + { + return false; + } +}; + class SvnAuthentication { public: @@ -56,6 +70,18 @@ QString mPassword; }; +class SvnAuthenticationUnimpl : public SvnAuthentication +{ +public: + virtual ~SvnAuthenticationUnimpl() {} + virtual bool getAuthentication(QString& rUserName, QString& rPassword) + { + Q_UNUSED(rUserName); + Q_UNUSED(rPassword); + return false; + } +}; + class SvnOperationContext { public: Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-11-03 22:40:28 UTC (rev 76) +++ trunk/src/main.cpp 2006-11-04 11:27:56 UTC (rev 77) @@ -25,62 +25,12 @@ #include "../tests/tests.h" #endif -#include <apr_general.h> -#include <svn/modification.h> -#include <svn/server_access.h> +#include "svn/modification.h" +#include "svn/server_access.h" +#include "svn/pool.h" #include <iostream> -namespace -{ - class QSvnOperationStatus : public SvnOperationStatus - { - public: - virtual void update(QString textToAdd) - { - textToAdd = textToAdd; - } - - virtual bool shouldCancel() - { - return false; - } - }; - - class QSvnAuthentication : public SvnAuthentication - { - public: - virtual bool getAuthentication(QString& rUsername, QString& rPassword) - { - rUsername = ""; - rPassword = ""; - return false; - } - }; - - class AprPoolWrapper - { - public: - AprPoolWrapper() - { - apr_pool_create(&mPool, NULL); - } - ~AprPoolWrapper() - { - apr_pool_destroy(mPool); - mPool = NULL; - } - - apr_pool_t* getPool() - { - return mPool; - } - - private: - apr_pool_t* mPool; - }; -} - int main(int argc, char** argv) { if (apr_initialize() != APR_SUCCESS) @@ -88,8 +38,8 @@ AprPoolWrapper poolWrapper; - QSvnOperationStatus status; - QSvnAuthentication auth; + SvnOperationStatusUnimpl status; + SvnAuthenticationUnimpl auth; SvnOperationContext context(poolWrapper.getPool(), status, auth); GrandmasSVNApp app(argc, argv, &context); Copied: trunk/src/svn/pool.cpp (from rev 74, trunk/templates/cpp) =================================================================== --- trunk/src/svn/pool.cpp (rev 0) +++ trunk/src/svn/pool.cpp 2006-11-04 11:27:56 UTC (rev 77) @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "svn/pool.h" + +#include <apr_general.h> + +AprPoolWrapper::AprPoolWrapper() +{ + apr_pool_create(&mPool, NULL); +} + +AprPoolWrapper::~AprPoolWrapper() +{ + apr_pool_destroy(mPool); + mPool = NULL; +} + +apr_pool_t* AprPoolWrapper::getPool() +{ + return mPool; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |