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 
00280     void
00281     get (Path & dstPath, 
00282          const Path & path,
00283          const Revision & revision, 
00284          const Revision & peg_revision = Revision ()) throw (ClientException);
00285 
00286 
00296     AnnotatedFile *
00297     annotate (const Path & path, 
00298               const Revision & revisionStart, 
00299               const Revision & revisionEnd) throw (ClientException);
00300 
00312     svn_revnum_t
00313     commit (const Targets & targets,
00314             const char * message, 
00315             bool recurse,
00316             bool keep_locks = false) throw (ClientException);
00317 
00322     void 
00323     copy (const Path & srcPath, 
00324           const Revision & srcRevision,
00325           const Path & destPath) throw (ClientException);
00326 
00331     void 
00332     move (const Path & srcPath, 
00333           const Revision & srcRevision, 
00334           const Path & destPath, 
00335           bool force) throw (ClientException);
00336 
00346     void 
00347     mkdir (const Path & path, 
00348            const char * message = "") throw (ClientException);
00349     void 
00350     mkdir (const Targets & targets, 
00351            const char * message = "") throw (ClientException);
00352 
00359     void 
00360     cleanup (const Path & path) throw (ClientException);
00361 
00366     void 
00367     resolved (const Path & path, bool recurse) throw (ClientException);
00368 
00379     svn_revnum_t
00380     doExport (const Path & srcPath, 
00381               const Path & destPath, 
00382               const Revision & revision, 
00383               bool force = false) throw (ClientException);
00384 
00398     void
00399     doExport2 (const Path & from_path,
00400                const Path & to_path,
00401                const Revision & revision,
00402                bool overwrite = false,
00403                const Revision & peg_revision = Revision (),
00404                bool ignore_externals = false,
00405                bool recurse = true,
00406                const char * native_eol = NULL) throw (ClientException);
00407 
00413     svn_revnum_t
00414     doSwitch (const Path & path, const char * url, 
00415               const Revision & revision, 
00416               bool recurse) throw (ClientException);
00417 
00427     void 
00428     import (const Path & path,
00429             const char * url,
00430             const char * message, 
00431             bool recurse) throw (ClientException);
00432 
00433 
00438     void 
00439     merge (const Path & path1, const Revision & revision1, 
00440            const Path & path2, const Revision & revision2,
00441            const Path & localPath, bool force, 
00442            bool recurse,
00443            bool notice_ancestry = false,
00444            bool dry_run = false) throw (ClientException);
00445 
00453     Entry
00454     info (const char * path);
00455 
00471     const LogEntries *
00472     log (const char * path,
00473          const Revision & revisionStart, 
00474          const Revision & revisionEnd,
00475          bool discoverChangedPaths = false, 
00476          bool strictNodeHistory = true) throw (ClientException);
00477 
00500     std::string
00501     diff (const Path & tmpPath, const Path & path,
00502           const Revision & revision1, const Revision & revision2,
00503           const bool recurse, const bool ignoreAncestry,
00504           const bool noDiffDeleted) throw (ClientException);
00505 
00529     DirEntries
00530     ls (const char * pathOrUrl,
00531         svn_opt_revision_t * revision,
00532         bool recurse) throw (ClientException);
00533 
00544     DirEntries
00545     list (const char * pathOrUrl,
00546           svn_opt_revision_t * revision,
00547           bool recurse) throw (ClientException);
00548 
00558     PathPropertiesMapList
00559     proplist (const Path &path,
00560               const Revision &revision,
00561               bool recurse = false);
00562 
00573     PathPropertiesMapList
00574     propget (const char * propName,
00575              const Path & path,
00576              const Revision & revision,
00577              bool recurse = false);
00578 
00595     void
00596     propset (const char * propName,
00597              const char * propValue,
00598              const Path & path,
00599              const Revision & revision,
00600              bool recurse = false,
00601              bool skip_checks = true);
00602 
00612     void
00613     propdel (const char * propName,
00614              const Path & path,
00615              const Revision & revision,
00616              bool recurse = false);
00617 
00618 
00627     std::pair<svn_revnum_t,PropertiesMap>
00628     revproplist (const Path & path,
00629                  const Revision & revision);
00630 
00640     std::pair<svn_revnum_t,std::string>
00641     revpropget (const char * propName,
00642                 const Path & path,
00643                 const Revision & revision);
00644 
00656     svn_revnum_t
00657     revpropset (const char * propName,
00658                 const char * propValue,
00659                 const Path & path,
00660                 const Revision & revision,
00661                 bool force = false);
00662 
00673     svn_revnum_t
00674     revpropdel (const char * propName,
00675                 const Path & path,
00676                 const Revision & revision,
00677                 bool force = false);
00678 
00679 
00680   private:
00681     Context * m_context;
00682 
00686     Client & operator= (const Client &);
00687 
00691     Client (const Client &);
00692   };
00693 }
00694 
00695 #endif
00696 /* -----------------------------------------------------------------
00697  * local variables:
00698  * eval: (load-file "../../rapidsvn-dev.el")
00699  * end:
00700  */

Generated on Fri Dec 8 18:57:44 2006 for SvnCpp by  doxygen 1.4.7