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,
00245              const Revision & revision, 
00246              bool recurse,
00247              bool ignore_externals) throw (ClientException);
00248 
00258     std::string
00259     cat (const Path & path, 
00260          const Revision & revision,
00261          const Revision & peg_revision = Revision ()) throw (ClientException);
00262 
00263 
00279     void
00280     get (Path & dstPath, const Path & path,
00281          const Revision & revision) throw (ClientException);
00282 
00283 
00293     AnnotatedFile *
00294     annotate (const Path & path, 
00295               const Revision & revisionStart, 
00296               const Revision & revisionEnd) throw (ClientException);
00297 
00309     svn_revnum_t
00310     commit (const Targets & targets,
00311             const char * message, 
00312             bool recurse,
00313             bool keep_locks = false) throw (ClientException);
00314 
00319     void 
00320     copy (const Path & srcPath, 
00321           const Revision & srcRevision,
00322           const Path & destPath) throw (ClientException);
00323 
00328     void 
00329     move (const Path & srcPath, 
00330           const Revision & srcRevision, 
00331           const Path & destPath, 
00332           bool force) throw (ClientException);
00333 
00343     void 
00344     mkdir (const Path & path, 
00345            const char * message = "") throw (ClientException);
00346     void 
00347     mkdir (const Targets & targets, 
00348            const char * message = "") throw (ClientException);
00349 
00356     void 
00357     cleanup (const Path & path) throw (ClientException);
00358 
00363     void 
00364     resolved (const Path & path, bool recurse) throw (ClientException);
00365 
00376     svn_revnum_t
00377     doExport (const Path & srcPath, 
00378               const Path & destPath, 
00379               const Revision & revision, 
00380               bool force = false) throw (ClientException);
00381 
00395     void
00396     doExport2 (const Path & from_path,
00397                const Path & to_path,
00398                const Revision & revision,
00399                bool overwrite = false,
00400                const Revision & peg_revision = Revision (),
00401                bool ignore_externals = false,
00402                bool recurse = true,
00403                const char * native_eol = NULL) throw (ClientException);
00404 
00410     svn_revnum_t
00411     doSwitch (const Path & path, const char * url, 
00412               const Revision & revision, 
00413               bool recurse) throw (ClientException);
00414 
00424     void 
00425     import (const Path & path,
00426             const char * url,
00427             const char * message, 
00428             bool recurse) throw (ClientException);
00429 
00430 
00435     void 
00436     merge (const Path & path1, const Revision & revision1, 
00437            const Path & path2, const Revision & revision2,
00438            const Path & localPath, bool force, 
00439            bool recurse,
00440            bool notice_ancestry = false,
00441            bool dry_run = false) throw (ClientException);
00442 
00450     Entry
00451     info (const char * path);
00452 
00468     const LogEntries *
00469     log (const char * path,
00470          const Revision & revisionStart, 
00471          const Revision & revisionEnd,
00472          bool discoverChangedPaths = false, 
00473          bool strictNodeHistory = true) throw (ClientException);
00474 
00497     std::string
00498     diff (const Path & tmpPath, const Path & path,
00499           const Revision & revision1, const Revision & revision2,
00500           const bool recurse, const bool ignoreAncestry,
00501           const bool noDiffDeleted) throw (ClientException);
00502 
00526     DirEntries
00527     ls (const char * pathOrUrl,
00528         svn_opt_revision_t * revision,
00529         bool recurse) throw (ClientException);
00530 
00541     DirEntries
00542     list (const char * pathOrUrl,
00543           svn_opt_revision_t * revision,
00544           bool recurse) throw (ClientException);
00545 
00555     PathPropertiesMapList
00556     proplist (const Path &path,
00557               const Revision &revision,
00558               bool recurse = false);
00559 
00570     PathPropertiesMapList
00571     propget (const char * propName,
00572              const Path & path,
00573              const Revision & revision,
00574              bool recurse = false);
00575 
00592     void
00593     propset (const char * propName,
00594              const char * propValue,
00595              const Path & path,
00596              const Revision & revision,
00597              bool recurse = false,
00598              bool skip_checks = true);
00599 
00609     void
00610     propdel (const char * propName,
00611              const Path & path,
00612              const Revision & revision,
00613              bool recurse = false);
00614 
00615 
00624     std::pair<svn_revnum_t,PropertiesMap>
00625     revproplist (const Path & path,
00626                  const Revision & revision);
00627 
00637     std::pair<svn_revnum_t,std::string>
00638     revpropget (const char * propName,
00639                 const Path & path,
00640                 const Revision & revision);
00641 
00653     svn_revnum_t
00654     revpropset (const char * propName,
00655                 const char * propValue,
00656                 const Path & path,
00657                 const Revision & revision,
00658                 bool force = false);
00659 
00670     svn_revnum_t
00671     revpropdel (const char * propName,
00672                 const Path & path,
00673                 const Revision & revision,
00674                 bool force = false);
00675 
00676 
00677   private:
00678     Context * m_context;
00679 
00683     Client & operator= (const Client &);
00684 
00688     Client (const Client &);
00689   };
00690 }
00691 
00692 #endif
00693 /* -----------------------------------------------------------------
00694  * local variables:
00695  * eval: (load-file "../../rapidsvn-dev.el")
00696  * end:
00697  */

Generated on Mon Jul 31 13:39:33 2006 for SvnCpp by  doxygen 1.4.7