client.hpp

Go to the documentation of this file.
00001 /*
00002  * ====================================================================
00003  * Copyright (c) 2002-2006 The RapidSvn Group.  All rights reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  * 
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library (in the file LGPL.txt); if not, 
00017  * write to the Free Software Foundation, Inc., 51 Franklin St, 
00018  * Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  * This software consists of voluntary contributions made by many
00021  * individuals.  For exact contribution history, see the revision
00022  * history and logs, available at http://rapidsvn.tigris.org/.
00023  * ====================================================================
00024  */
00025 
00026 #ifndef _SVNCPP_CLIENT_H_
00027 #define _SVNCPP_CLIENT_H_
00028 
00029 // Ignore MSVC 6 compiler warning: debug symbol truncated
00030 #if defined (_MSC_VER) && _MSC_VER <= 1200
00031 #pragma warning (disable: 4786)
00032 #endif
00033 
00034 // Ignore MSVC 7 compiler warning: C++ exception specification
00035 #if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1310
00036 #pragma warning (disable: 4290)
00037 #endif
00038 
00039 
00040 // stl
00041 #include <vector>
00042 #include <utility>
00043 #include <map>
00044 
00045 // svncpp
00046 #include "svncpp/check.hpp"
00047 #include "svncpp/context.hpp"
00048 #include "svncpp/exception.hpp"
00049 #include "svncpp/path.hpp"
00050 #include "svncpp/entry.hpp"
00051 #include "svncpp/revision.hpp"
00052 #include "svncpp/log_entry.hpp"
00053 #include "svncpp/annotate_line.hpp"
00054 
00055 
00056 namespace svn
00057 {
00058   // forward declarations
00059   class Context;
00060   class Status;
00061   class Targets;
00062   class DirEntry;
00063 
00064   typedef std::vector<LogEntry> LogEntries;
00065   typedef std::vector<Status> StatusEntries;
00066   typedef std::vector<DirEntry> DirEntries;
00067   typedef std::vector<AnnotateLine> AnnotatedFile;
00068 
00069   // map of property names to values
00070   typedef std::map<std::string,std::string> PropertiesMap;
00071   // pair of path, PropertiesMap
00072   typedef std::pair<std::string, PropertiesMap> PathPropertiesMapEntry;
00073   // vector of path, Properties pairs
00074   typedef std::vector<PathPropertiesMapEntry> PathPropertiesMapList;
00075 
00079   class Client
00080   {
00081   public:
00085     Client (Context * context = 0);
00086 
00087     virtual ~Client ();
00088 
00092     const Context * 
00093     getContext () const;
00094 
00102     void 
00103     setContext (Context * context = NULL);
00104 
00118     StatusEntries 
00119     status (const char * path,
00120             const bool descend = false,
00121             const bool get_all = true,
00122             const bool update = false,
00123             const bool no_ignore = false,
00124             const bool ignore_externals = false) throw (ClientException);
00125 
00134     Status 
00135     singleStatus (const char * path) throw (ClientException);
00136 
00148     svn_revnum_t
00149     checkout (const char * moduleName,
00150               const Path & destPath, 
00151               const Revision & revision, 
00152               bool recurse,
00153               bool ignore_externals = false,
00154               const Revision & peg_revision = Revision ()) throw (ClientException);
00155   
00160     void 
00161     relocate (const Path & path, const char *from_url,
00162               const char *to_url, bool recurse) throw (ClientException);
00163 
00168     void 
00169     remove (const Path & path, bool force) throw (ClientException);
00170 
00178     void 
00179     remove (const Targets & targets, 
00180             bool force) throw (ClientException);
00181 
00190     void 
00191     lock (const Targets & targets, bool force,
00192           const char * comment) throw (ClientException);
00193 
00201     void 
00202     unlock (const Targets & targets, bool force) throw (ClientException);
00203 
00208     void
00209     revert (const Targets & targets, bool recurse) throw (ClientException);
00210 
00215     void 
00216     add (const Path & path, bool recurse) throw (ClientException);
00217 
00229     svn_revnum_t 
00230     update (const Path & path, const Revision & revision, 
00231             bool recurse) throw (ClientException);
00232 
00243     void
00244     update2 (const Targets & targets, const Revision & revision, 
00245              bool recurse, bool ignore_externals) throw (ClientException);
00246 
00255     std::string
00256     cat (const Path & path, 
00257          const Revision & revision,
00258          const Revision & peg_revision = Revision ()) throw (ClientException);
00259 
00260 
00276     void
00277     get (Path & dstPath, const Path & path,
00278          const Revision & revision) throw (ClientException);
00279 
00280 
00290     AnnotatedFile *
00291     annotate (const Path & path, 
00292               const Revision & revisionStart, 
00293               const Revision & revisionEnd) throw (ClientException);
00294 
00305     svn_revnum_t
00306     commit (const Targets & targets,
00307             const char * message, 
00308             bool recurse,
00309             bool keep_locks = false) throw (ClientException);
00310 
00315     void 
00316     copy (const Path & srcPath, 
00317           const Revision & srcRevision,
00318           const Path & destPath) throw (ClientException);
00319 
00324     void 
00325     move (const Path & srcPath, 
00326           const Revision & srcRevision, 
00327           const Path & destPath, 
00328           bool force) throw (ClientException);
00329 
00339     void 
00340     mkdir (const Path & path, 
00341            const char * message) throw (ClientException);
00342     void 
00343     mkdir (const Targets & targets, 
00344            const char * message) throw (ClientException);
00345 
00352     void 
00353     cleanup (const Path & path) throw (ClientException);
00354 
00359     void 
00360     resolved (const Path & path, bool recurse) throw (ClientException);
00361 
00372     svn_revnum_t
00373     doExport (const Path & srcPath, 
00374               const Path & destPath, 
00375               const Revision & revision, 
00376               bool force = false) throw (ClientException);
00377 
00391     void
00392     doExport2 (const Path & from_path,
00393                const Path & to_path,
00394                const Revision & revision,
00395                bool overwrite = false,
00396                const Revision & peg_revision = Revision (),
00397                bool ignore_externals = false,
00398                bool recurse = true,
00399                const char * native_eol = NULL) throw (ClientException);
00400 
00406     svn_revnum_t
00407     doSwitch (const Path & path, const char * url, 
00408               const Revision & revision, 
00409               bool recurse) throw (ClientException);
00410 
00420     void 
00421     import (const Path & path,
00422             const char * url,
00423             const char * message, 
00424             bool recurse) throw (ClientException);
00425 
00426 
00431     void 
00432     merge (const Path & path1, const Revision & revision1, 
00433            const Path & path2, const Revision & revision2,
00434            const Path & localPath, bool force, 
00435            bool recurse,
00436            bool notice_ancestry = false,
00437            bool dry_run = false) throw (ClientException);
00438 
00446     Entry
00447     info (const char * path);
00448 
00464     const LogEntries *
00465     log (const char * path,
00466          const Revision & revisionStart, 
00467          const Revision & revisionEnd,
00468          bool discoverChangedPaths = false, 
00469          bool strictNodeHistory = true) throw (ClientException);
00470 
00493     std::string
00494     diff (const Path & tmpPath, const Path & path,
00495           const Revision & revision1, const Revision & revision2,
00496           const bool recurse, const bool ignoreAncestry,
00497           const bool noDiffDeleted) throw (ClientException);
00498 
00522     DirEntries
00523     ls (const char * pathOrUrl,
00524         svn_opt_revision_t * revision,
00525         bool recurse) throw (ClientException);
00526 
00537     DirEntries
00538     list (const char * pathOrUrl,
00539           svn_opt_revision_t * revision,
00540           bool recurse) throw (ClientException);
00541 
00551     PathPropertiesMapList
00552     proplist (const Path &path,
00553               const Revision &revision,
00554               bool recurse = false);
00555 
00566     PathPropertiesMapList
00567     propget (const char * propName,
00568              const Path & path,
00569              const Revision & revision,
00570              bool recurse = false);
00571 
00588     void
00589     propset (const char * propName,
00590              const char * propValue,
00591              const Path & path,
00592              const Revision & revision,
00593              bool recurse = false,
00594              bool skip_checks = true);
00595 
00605     void
00606     propdel (const char * propName,
00607              const Path & path,
00608              const Revision & revision,
00609              bool recurse = false);
00610 
00611 
00620     std::pair<svn_revnum_t,PropertiesMap>
00621     revproplist (const Path & path,
00622                  const Revision & revision);
00623 
00633     std::pair<svn_revnum_t,std::string>
00634     revpropget (const char * propName,
00635                 const Path & path,
00636                 const Revision & revision);
00637 
00649     svn_revnum_t
00650     revpropset (const char * propName,
00651                 const char * propValue,
00652                 const Path & path,
00653                 const Revision & revision,
00654                 bool force = false);
00655 
00666     svn_revnum_t
00667     revpropdel (const char * propName,
00668                 const Path & path,
00669                 const Revision & revision,
00670                 bool force = false);
00671 
00672 
00673   private:
00674     Context * m_context;
00675 
00679     Client & operator= (const Client &);
00680 
00684     Client (const Client &);
00685   };
00686 }
00687 
00688 #endif
00689 /* -----------------------------------------------------------------
00690  * local variables:
00691  * eval: (load-file "../../rapidsvn-dev.el")
00692  * end:
00693  */

Generated on Sun May 14 14:03:06 2006 for SvnCpp by  doxygen 1.4.6