00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _SVNCPP_CLIENT_H_
00015 #define _SVNCPP_CLIENT_H_
00016
00017
00018 #if defined (_MSC_VER) && _MSC_VER <= 1200
00019 #pragma warning (disable: 4786)
00020 #endif
00021
00022
00023 #if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1310
00024 #pragma warning (disable: 4290)
00025 #endif
00026
00027
00028
00029 #include <vector>
00030 #include <utility>
00031 #include <map>
00032
00033
00034 #include "svncpp/context.hpp"
00035 #include "svncpp/exception.hpp"
00036 #include "svncpp/path.hpp"
00037 #include "svncpp/entry.hpp"
00038 #include "svncpp/revision.hpp"
00039 #include "svncpp/log_entry.hpp"
00040 #include "svncpp/annotate_line.hpp"
00041
00042
00043 namespace svn
00044 {
00045
00046 class Context;
00047 class Status;
00048 class Targets;
00049 class DirEntry;
00050
00051 typedef std::vector<LogEntry> LogEntries;
00052 typedef std::vector<Status> StatusEntries;
00053 typedef std::vector<DirEntry> DirEntries;
00054 typedef std::vector<AnnotateLine> AnnotatedFile;
00055
00056
00057 typedef std::map<std::string,std::string> PropertiesMap;
00058
00059 typedef std::pair<std::string, PropertiesMap> PathPropertiesMapEntry;
00060
00061 typedef std::vector<PathPropertiesMapEntry> PathPropertiesMapList;
00062
00066 class Client
00067 {
00068 public:
00072 Client (Context * context = 0);
00073
00074 virtual ~Client ();
00075
00076
00080 const Context *
00081 getContext () const;
00082
00090 void
00091 setContext (Context * context = NULL);
00092
00105 StatusEntries
00106 status (const char * path,
00107 const bool descend = false,
00108 const bool get_all = true,
00109 const bool update = false,
00110 const bool no_ignore = false) throw (ClientException);
00111
00120 Status
00121 singleStatus (const char * path) throw (ClientException);
00122
00132 svn_revnum_t
00133 checkout (const char * moduleName, const Path & destPath,
00134 const Revision & revision,
00135 bool recurse) throw (ClientException);
00136
00141 void
00142 relocate (const Path & path, const char *from_url,
00143 const char *to_url, bool recurse) throw (ClientException);
00144
00149 void
00150 remove (const Path & path, bool force) throw (ClientException);
00151
00159 void
00160 remove (const Targets & targets,
00161 bool force) throw (ClientException);
00162
00167 void
00168 revert (const Targets & targets, bool recurse) throw (ClientException);
00169
00170
00175 void
00176 add (const Path & path, bool recurse) throw (ClientException);
00177
00187 svn_revnum_t
00188 update (const Path & path, const Revision & revision,
00189 bool recurse) throw (ClientException);
00190
00199 std::string
00200 cat (const Path & path,
00201 const Revision & revision) throw (ClientException);
00202
00203
00219 void
00220 get (Path & dstPath, const Path & path,
00221 const Revision & revision) throw (ClientException);
00222
00223
00233 AnnotatedFile *
00234 annotate (const Path & path,
00235 const Revision & revisionStart,
00236 const Revision & revisionEnd) throw (ClientException);
00237
00248 svn_revnum_t
00249 commit (const Targets & targets,
00250 const char * message,
00251 bool recurse) throw (ClientException);
00252
00257 void
00258 copy (const Path & srcPath,
00259 const Revision & srcRevision,
00260 const Path & destPath) throw (ClientException);
00261
00266 void
00267 move (const Path & srcPath,
00268 const Revision & srcRevision,
00269 const Path & destPath,
00270 bool force) throw (ClientException);
00271
00281 void
00282 mkdir (const Path & path,
00283 const char * message) throw (ClientException);
00284 void
00285 mkdir (const Targets & targets,
00286 const char * message) throw (ClientException);
00287
00294 void
00295 cleanup (const Path & path) throw (ClientException);
00296
00301 void
00302 resolved (const Path & path, bool recurse) throw (ClientException);
00303
00314 svn_revnum_t
00315 doExport (const Path & srcPath,
00316 const Path & destPath,
00317 const Revision & revision,
00318 bool force=false) throw (ClientException);
00319
00325 svn_revnum_t
00326 doSwitch (const Path & path, const char * url,
00327 const Revision & revision,
00328 bool recurse) throw (ClientException);
00329
00339 void
00340 import (const Path & path, const char * url,
00341 const char * message,
00342 bool recurse) throw (ClientException);
00343
00348 void
00349 merge (const Path & path1, const Revision & revision1,
00350 const Path & path2, const Revision & revision2,
00351 const Path & localPath, bool force,
00352 bool recurse,
00353 bool notice_ancestry=false,
00354 bool dry_run=false) throw (ClientException);
00355
00363 Entry
00364 info (const char *path );
00365
00381 const LogEntries *
00382 log (const char * path, const Revision & revisionStart,
00383 const Revision & revisionEnd,
00384 bool discoverChangedPaths=false,
00385 bool strictNodeHistory=true) throw (ClientException);
00386
00409 std::string
00410 diff (const Path & tmpPath, const Path & path,
00411 const Revision & revision1, const Revision & revision2,
00412 const bool recurse, const bool ignoreAncestry,
00413 const bool noDiffDeleted) throw (ClientException);
00414
00438 DirEntries
00439 ls (const char * pathOrUrl,
00440 svn_opt_revision_t * revision,
00441 bool recurse) throw (ClientException);
00442
00453 DirEntries
00454 list (const char * pathOrUrl,
00455 svn_opt_revision_t * revision,
00456 bool recurse) throw (ClientException);
00457
00467 PathPropertiesMapList
00468 proplist(const Path &path,
00469 const Revision &revision,
00470 bool recurse=false);
00471
00482 PathPropertiesMapList
00483 propget(const char *propName,
00484 const Path &path,
00485 const Revision &revision,
00486 bool recurse=false);
00487
00499 void
00500 propset(const char *propName,
00501 const char *propValue,
00502 const Path &path,
00503 const Revision &revision,
00504 bool recurse=false);
00505
00515 void
00516 propdel(const char *propName,
00517 const Path &path,
00518 const Revision &revision,
00519 bool recurse=false);
00520
00521
00530 std::pair<svn_revnum_t,PropertiesMap>
00531 revproplist(const Path &path,
00532 const Revision &revision);
00533
00543 std::pair<svn_revnum_t,std::string>
00544 revpropget(const char *propName,
00545 const Path &path,
00546 const Revision &revision);
00547
00559 svn_revnum_t
00560 revpropset(const char *propName,
00561 const char *propValue,
00562 const Path &path,
00563 const Revision &revision,
00564 bool force=false);
00565
00576 svn_revnum_t
00577 revpropdel(const char *propName,
00578 const Path &path,
00579 const Revision &revision,
00580 bool force=false);
00581
00582
00583 private:
00584 Context * m_context;
00585
00589 Client & operator= (const Client &);
00590
00594 Client (const Client &);
00595
00596 };
00597
00598 }
00599
00600 #endif
00601
00602
00603
00604
00605