client.hpp

Go to the documentation of this file.
00001 /*
00002  * ====================================================================
00003  * Copyright (c) 2002-2008 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
00030 #if defined (_MSC_VER) && _MSC_VER <= 1200
00031 // debug symbol truncated
00032 #pragma warning (disable: 4786)
00033 // C++ exception specification
00034 #pragma warning (disable: 4290)
00035 #endif
00036 
00037 // Ignore MSVC 7,8 compiler warnings
00038 #if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1400
00039 // C++ exception specification
00040 #pragma warning (disable: 4290)
00041 #endif
00042 
00043 
00044 // stl
00045 #include <vector>
00046 #include <utility>
00047 #include <map>
00048 
00049 // svncpp
00050 #include "svncpp/context.hpp"
00051 #include "svncpp/exception.hpp"
00052 #include "svncpp/path.hpp"
00053 #include "svncpp/entry.hpp"
00054 #include "svncpp/revision.hpp"
00055 #include "svncpp/log_entry.hpp"
00056 #include "svncpp/annotate_line.hpp"
00057 
00058 
00059 namespace svn
00060 {
00061   // forward declarations
00062   class Context;
00063   class DirEntry;
00064   class Info;
00065   class Status;
00066   class Targets;
00067 
00068   typedef std::vector<AnnotateLine> AnnotatedFile;
00069   typedef std::vector<DirEntry> DirEntries;
00070   typedef std::vector<Info> InfoVector;
00071   typedef std::vector<LogEntry> LogEntries;
00072   typedef std::vector<Status> StatusEntries;
00073 
00074 
00075   // map of property names to values
00076   typedef std::map<std::string,std::string> PropertiesMap;
00077   // pair of path, PropertiesMap
00078   typedef std::pair<std::string, PropertiesMap> PathPropertiesMapEntry;
00079   // vector of path, Properties pairs
00080   typedef std::vector<PathPropertiesMapEntry> PathPropertiesMapList;
00081 
00085   class Client
00086   {
00087   public:
00091     Client (Context * context = 0);
00092 
00093     virtual ~Client ();
00094 
00098     const Context * 
00099     getContext () const;
00100 
00104     Context * 
00105     getContext();
00106 
00114     void 
00115     setContext (Context * context = NULL);
00116 
00130     StatusEntries 
00131     status (const char * path,
00132             const bool descend = false,
00133             const bool get_all = true,
00134             const bool update = false,
00135             const bool no_ignore = false,
00136             const bool ignore_externals = false) throw (ClientException);
00137 
00149     svn_revnum_t
00150     checkout (const char * moduleName,
00151               const Path & destPath, 
00152               const Revision & revision, 
00153               bool recurse,
00154               bool ignore_externals = false,
00155               const Revision & peg_revision = Revision::UNSPECIFIED) throw (ClientException);
00156   
00161     void 
00162     relocate (const Path & path, const char *from_url,
00163               const char *to_url, bool recurse) throw (ClientException);
00164 
00169     void 
00170     remove (const Path & path, bool force) throw (ClientException);
00171 
00179     void 
00180     remove (const Targets & targets, 
00181             bool force) throw (ClientException);
00182 
00191     void 
00192     lock (const Targets & targets, bool force,
00193           const char * comment) throw (ClientException);
00194 
00202     void 
00203     unlock (const Targets & targets, bool force) throw (ClientException);
00204 
00209     void
00210     revert (const Targets & targets, bool recurse) throw (ClientException);
00211 
00216     void 
00217     add (const Path & path, bool recurse) throw (ClientException);
00218 
00231     std::vector<svn_revnum_t>
00232     update (const Targets & targets,
00233             const Revision & revision, 
00234             bool recurse,
00235             bool ignore_externals) throw (ClientException);
00236 
00237     svn_revnum_t
00238     update (const Path & path,
00239             const Revision & revision, 
00240             bool recurse,
00241             bool ignore_externals) throw (ClientException);
00242 
00253     std::string
00254     cat (const Path & path, 
00255          const Revision & revision,
00256          const Revision & peg_revision = Revision::UNSPECIFIED) throw (ClientException);
00257 
00258 
00275     void
00276     get (Path & dstPath, 
00277          const Path & path,
00278          const Revision & revision, 
00279          const Revision & peg_revision = Revision::UNSPECIFIED) throw (ClientException);
00280 
00281 
00291     AnnotatedFile *
00292     annotate (const Path & path, 
00293               const Revision & revisionStart, 
00294               const Revision & revisionEnd) throw (ClientException);
00295 
00307     svn_revnum_t
00308     commit (const Targets & targets,
00309             const char * message, 
00310             bool recurse,
00311             bool keep_locks = false) throw (ClientException);
00312 
00317     void 
00318     copy (const Path & srcPath, 
00319           const Revision & srcRevision,
00320           const Path & destPath) throw (ClientException);
00321 
00326     void 
00327     move (const Path & srcPath, 
00328           const Revision & srcRevision, 
00329           const Path & destPath, 
00330           bool force) throw (ClientException);
00331 
00340     void 
00341     mkdir (const Path & path) throw (ClientException);
00342 
00343     void 
00344     mkdir (const Targets & targets) 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 
00375     void
00376     doExport (const Path & from_path,
00377               const Path & to_path,
00378               const Revision & revision,
00379               bool overwrite = false,
00380               const Revision & peg_revision = Revision::UNSPECIFIED,
00381               bool ignore_externals = false,
00382               bool recurse = true,
00383               const char * native_eol = NULL) throw (ClientException);
00384 
00390     svn_revnum_t
00391     doSwitch (const Path & path, const char * url, 
00392               const Revision & revision, 
00393               bool recurse) throw (ClientException);
00394 
00404     void 
00405     import (const Path & path,
00406             const char * url,
00407             const char * message, 
00408             bool recurse) throw (ClientException);
00409     void
00410     import (const Path & path,
00411             const Path & url,
00412             const char * message,
00413             bool recurse) throw (ClientException);
00414 
00415 
00420     void 
00421     merge (const Path & path1, const Revision & revision1, 
00422            const Path & path2, const Revision & revision2,
00423            const Path & localPath, bool force, 
00424            bool recurse,
00425            bool notice_ancestry = false,
00426            bool dry_run = false) throw (ClientException);
00427 
00428 
00441     InfoVector
00442     info (const Path & pathOrUrl,
00443           bool recurse=false,
00444           const Revision & revision = Revision::UNSPECIFIED,
00445           const Revision & pegRevision = Revision::UNSPECIFIED) throw (ClientException);
00446 
00447 
00463     const LogEntries *
00464     log (const char * path,
00465          const Revision & revisionStart, 
00466          const Revision & revisionEnd,
00467          bool discoverChangedPaths = false, 
00468          bool strictNodeHistory = true) throw (ClientException);
00469 
00492     std::string
00493     diff (const Path & tmpPath, const Path & path,
00494           const Revision & revision1, const Revision & revision2,
00495           const bool recurse, const bool ignoreAncestry,
00496           const bool noDiffDeleted) throw (ClientException);
00497 
00521     std::string
00522     diff (const Path & tmpPath, const Path & path1, const Path & path2,
00523           const Revision & revision1, const Revision & revision2,
00524           const bool recurse, const bool ignoreAncestry,
00525           const bool noDiffDeleted) throw (ClientException);
00526 
00550     std::string
00551     diff (const Path & tmpPath, const Path & path,
00552           const Revision & pegRevision, const Revision & revision1, 
00553           const Revision & revision2, const bool recurse, 
00554           const bool ignoreAncestry, const bool noDiffDeleted) 
00555           throw (ClientException);
00556 
00567     DirEntries
00568     list (const char * pathOrUrl,
00569           svn_opt_revision_t * revision,
00570           bool recurse) throw (ClientException);
00571 
00581     PathPropertiesMapList
00582     proplist (const Path &path,
00583               const Revision &revision,
00584               bool recurse = false);
00585 
00596     PathPropertiesMapList
00597     propget (const char * propName,
00598              const Path & path,
00599              const Revision & revision,
00600              bool recurse = false);
00601 
00618     void
00619     propset (const char * propName,
00620              const char * propValue,
00621              const Path & path,
00622              const Revision & revision,
00623              bool recurse = false,
00624              bool skip_checks = true);
00625 
00635     void
00636     propdel (const char * propName,
00637              const Path & path,
00638              const Revision & revision,
00639              bool recurse = false);
00640 
00641 
00650     std::pair<svn_revnum_t,PropertiesMap>
00651     revproplist (const Path & path,
00652                  const Revision & revision);
00653 
00663     std::pair<svn_revnum_t,std::string>
00664     revpropget (const char * propName,
00665                 const Path & path,
00666                 const Revision & revision);
00667 
00679     svn_revnum_t
00680     revpropset (const char * propName,
00681                 const char * propValue,
00682                 const Path & path,
00683                 const Revision & revision,
00684                 bool force = false);
00685 
00696     svn_revnum_t
00697     revpropdel (const char * propName,
00698                 const Path & path,
00699                 const Revision & revision,
00700                 bool force = false);
00701 
00702 
00710     void 
00711     ignore (const Path & path) throw (ClientException);
00712 
00720     void 
00721     ignore (const Targets & targets) throw (ClientException);
00722   private:
00723     Context * m_context;
00724 
00728     Client & operator= (const Client &);
00729 
00733     Client (const Client &);
00734   };
00735 }
00736 
00737 #endif
00738 /* -----------------------------------------------------------------
00739  * local variables:
00740  * eval: (load-file "../../rapidsvn-dev.el")
00741  * end:
00742  */

Generated on Fri Mar 7 23:09:11 2008 for SvnCpp by  doxygen 1.5.3