client.hpp
Go to the documentation of this file.
/*
* ====================================================================
* Copyright (c) 2002-2009 The RapidSvn Group. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (in the file GPL.txt.
* If not, see <http://www.gnu.org/licenses/>.
*
* This software consists of voluntary contributions made by many
* individuals. For exact contribution history, see the revision
* history and logs, available at http://rapidsvn.tigris.org/.
* ====================================================================
*/
#ifndef _SVNCPP_CLIENT_H_
#define _SVNCPP_CLIENT_H_
// Ignore MSVC 6 compiler warning
#if defined (_MSC_VER) && _MSC_VER <= 1200
// debug symbol truncated
#pragma warning (disable: 4786)
// C++ exception specification
#pragma warning (disable: 4290)
#endif
// Ignore MSVC 7,8,9 compiler warnings
#if defined (_MSC_VER) && _MSC_VER > 1200 && _MSC_VER <= 1500
// C++ exception specification
#pragma warning (disable: 4290)
#endif
// stl
#include "svncpp/vector_wrapper.hpp"
#include "svncpp/utility_wrapper.hpp"
#include "svncpp/map_wrapper.hpp"
// svncpp
#include "svncpp/context.hpp"
#include "svncpp/exception.hpp"
#include "svncpp/path.hpp"
#include "svncpp/entry.hpp"
#include "svncpp/revision.hpp"
#include "svncpp/log_entry.hpp"
#include "svncpp/annotate_line.hpp"
namespace svn
{
// forward declarations
class Context;
class DirEntry;
class Info;
class Status;
class Targets;
typedef std::vector<AnnotateLine> AnnotatedFile;
typedef std::vector<DirEntry> DirEntries;
typedef std::vector<Info> InfoVector;
typedef std::vector<LogEntry> LogEntries;
typedef std::vector<Status> StatusEntries;
// map of property names to values
typedef std::map<std::string,std::string> PropertiesMap;
// pair of path, PropertiesMap
typedef std::pair<std::string, PropertiesMap> PathPropertiesMapEntry;
// vector of path, Properties pairs
typedef std::vector<PathPropertiesMapEntry> PathPropertiesMapList;
struct StatusFilter
{
public:
bool showUnversioned;
bool showUnmodified;
bool showModified;
bool showConflicted;
bool showIgnored;
bool showExternals;
StatusFilter()
: showUnversioned(false), showUnmodified(false),
showModified(false), showConflicted(false),
showExternals(false)
{
}
};
class Client
{
public:
Client(Context * context = 0);
virtual ~Client();
const Context *
getContext() const;
Context *
getContext();
void
setContext(Context * context = NULL);
StatusEntries
status(const char * path,
const bool descend = false,
const bool get_all = true,
const bool update = false,
const bool no_ignore = false,
const bool ignore_externals = false) throw(ClientException);
svn_revnum_t
status(const char * path,
const StatusFilter & filter,
const bool descend,
const bool update,
StatusEntries & entries) throw(ClientException);
svn_revnum_t
checkout(const char * moduleName,
const Path & destPath,
const Revision & revision,
bool recurse,
bool ignore_externals = false,
const Revision & peg_revision = Revision::UNSPECIFIED) throw(ClientException);
void
relocate(const Path & path, const char *from_url,
const char *to_url, bool recurse) throw(ClientException);
void
remove(const Path & path, bool force) throw(ClientException);
void
remove(const Targets & targets,
bool force) throw(ClientException);
void
lock(const Targets & targets, bool force,
const char * comment) throw(ClientException);
void
unlock(const Targets & targets, bool force) throw(ClientException);
void
revert(const Targets & targets, bool recurse) throw(ClientException);
void
add(const Path & path, bool recurse) throw(ClientException);
std::vector<svn_revnum_t>
update(const Targets & targets,
const Revision & revision,
bool recurse,
bool ignore_externals) throw(ClientException);
svn_revnum_t
update(const Path & path,
const Revision & revision,
bool recurse,
bool ignore_externals) throw(ClientException);
std::string
cat(const Path & path,
const Revision & revision,
const Revision & peg_revision = Revision::UNSPECIFIED) throw(ClientException);
void
get(Path & dstPath,
const Path & path,
const Revision & revision,
const Revision & peg_revision = Revision::UNSPECIFIED) throw(ClientException);
AnnotatedFile *
annotate(const Path & path,
const Revision & revisionStart,
const Revision & revisionEnd) throw(ClientException);
svn_revnum_t
commit(const Targets & targets,
const char * message,
bool recurse,
bool keep_locks = false) throw(ClientException);
void
copy(const Path & srcPath,
const Revision & srcRevision,
const Path & destPath) throw(ClientException);
void
move(const Path & srcPath,
const Revision & srcRevision,
const Path & destPath,
bool force) throw(ClientException);
void
mkdir(const Path & path) throw(ClientException);
void
mkdir(const Targets & targets) throw(ClientException);
void
cleanup(const Path & path) throw(ClientException);
void
resolved(const Path & path, bool recurse) throw(ClientException);
void
doExport(const Path & from_path,
const Path & to_path,
const Revision & revision,
bool overwrite = false,
const Revision & peg_revision = Revision::UNSPECIFIED,
bool ignore_externals = false,
bool recurse = true,
const char * native_eol = NULL) throw(ClientException);
svn_revnum_t
doSwitch(const Path & path, const char * url,
const Revision & revision,
bool recurse) throw(ClientException);
void
import(const Path & path,
const char * url,
const char * message,
bool recurse) throw(ClientException);
void
import(const Path & path,
const Path & url,
const char * message,
bool recurse) throw(ClientException);
void
merge(const Path & path1, const Revision & revision1,
const Path & path2, const Revision & revision2,
const Path & localPath, bool force,
bool recurse,
bool notice_ancestry = false,
bool dry_run = false) throw(ClientException);
InfoVector
info(const Path & pathOrUrl,
bool recurse=false,
const Revision & revision = Revision::UNSPECIFIED,
const Revision & pegRevision = Revision::UNSPECIFIED) throw(ClientException);
const LogEntries *
log(const char * path,
const Revision & revisionStart,
const Revision & revisionEnd,
bool discoverChangedPaths = false,
bool strictNodeHistory = true) throw(ClientException);
std::string
diff(const Path & tmpPath, const Path & path,
const Revision & revision1, const Revision & revision2,
const bool recurse, const bool ignoreAncestry,
const bool noDiffDeleted) throw(ClientException);
std::string
diff(const Path & tmpPath, const Path & path1, const Path & path2,
const Revision & revision1, const Revision & revision2,
const bool recurse, const bool ignoreAncestry,
const bool noDiffDeleted) throw(ClientException);
std::string
diff(const Path & tmpPath, const Path & path,
const Revision & pegRevision, const Revision & revision1,
const Revision & revision2, const bool recurse,
const bool ignoreAncestry, const bool noDiffDeleted)
throw(ClientException);
DirEntries
list(const char * pathOrUrl,
svn_opt_revision_t * revision,
bool recurse) throw(ClientException);
PathPropertiesMapList
proplist(const Path &path,
const Revision &revision,
bool recurse = false);
PathPropertiesMapList
propget(const char * propName,
const Path & path,
const Revision & revision,
bool recurse = false);
void
propset(const char * propName,
const char * propValue,
const Path & path,
const Revision & revision,
bool recurse = false,
bool skip_checks = true);
void
propdel(const char * propName,
const Path & path,
const Revision & revision,
bool recurse = false);
std::pair<svn_revnum_t,PropertiesMap>
revproplist(const Path & path,
const Revision & revision);
std::pair<svn_revnum_t,std::string>
revpropget(const char * propName,
const Path & path,
const Revision & revision);
svn_revnum_t
revpropset(const char * propName,
const char * propValue,
const Path & path,
const Revision & revision,
bool force = false);
svn_revnum_t
revpropdel(const char * propName,
const Path & path,
const Revision & revision,
bool force = false);
void
ignore(const Path & path) throw(ClientException);
void
ignore(const Targets & targets) throw(ClientException);
private:
Context * m_context;
Client & operator= (const Client &);
Client(const Client &);
};
}
#endif
/* -----------------------------------------------------------------
* local variables:
* eval: (load-file "../../rapidsvn-dev.el")
* end:
*/
entry.hpp
svn::Revision::UNSPECIFIED
static const Revision UNSPECIFIED
Definition: revision.hpp:55
svn::StatusFilter::showExternals
bool showExternals
Definition: client.hpp:95
svn::Client::doExport
void doExport(const Path &from_path, const Path &to_path, const Revision &revision, bool overwrite=false, const Revision &peg_revision=Revision::UNSPECIFIED, bool ignore_externals=false, bool recurse=true, const char *native_eol=NULL)
svn::Client::commit
svn_revnum_t commit(const Targets &targets, const char *message, bool recurse, bool keep_locks=false)
svn::Client::info
InfoVector info(const Path &pathOrUrl, bool recurse=false, const Revision &revision=Revision::UNSPECIFIED, const Revision &pegRevision=Revision::UNSPECIFIED)
svn::Client::propdel
void propdel(const char *propName, const Path &path, const Revision &revision, bool recurse=false)
svn::Targets
Definition: targets.hpp:43
svn::StatusEntries
std::vector< Status > StatusEntries
Definition: client.hpp:71
svn::Client::cat
std::string cat(const Path &path, const Revision &revision, const Revision &peg_revision=Revision::UNSPECIFIED)
svn::Client::relocate
void relocate(const Path &path, const char *from_url, const char *to_url, bool recurse)
svn::InfoVector
std::vector< Info > InfoVector
Definition: client.hpp:69
svn::Client::cleanup
void cleanup(const Path &path)
svn::Client::proplist
PathPropertiesMapList proplist(const Path &path, const Revision &revision, bool recurse=false)
svn::Client::mkdir
void mkdir(const Path &path)
svn::Client::add
void add(const Path &path, bool recurse)
revision.hpp
svn::Client::~Client
virtual ~Client()
svn::Revision
Definition: revision.hpp:42
svn::Client::propset
void propset(const char *propName, const char *propValue, const Path &path, const Revision &revision, bool recurse=false, bool skip_checks=true)
svn::Client::list
DirEntries list(const char *pathOrUrl, svn_opt_revision_t *revision, bool recurse)
svn::StatusFilter::showUnversioned
bool showUnversioned
Definition: client.hpp:90
svn::Client::diff
std::string diff(const Path &tmpPath, const Path &path, const Revision &revision1, const Revision &revision2, const bool recurse, const bool ignoreAncestry, const bool noDiffDeleted)
svn::Context
Definition: context.hpp:48
svn::Path
Definition: path.hpp:37
svn::StatusFilter::showConflicted
bool showConflicted
Definition: client.hpp:93
svn::Client::unlock
void unlock(const Targets &targets, bool force)
svn::LogEntries
std::vector< LogEntry > LogEntries
Definition: client.hpp:70
context.hpp
svn::StatusFilter::showIgnored
bool showIgnored
Definition: client.hpp:94
svn::AnnotatedFile
std::vector< AnnotateLine > AnnotatedFile
Definition: client.hpp:65
svn::StatusFilter
Definition: client.hpp:87
svn::Client::revpropset
svn_revnum_t revpropset(const char *propName, const char *propValue, const Path &path, const Revision &revision, bool force=false)
svn::Client::revpropget
std::pair< svn_revnum_t, std::string > revpropget(const char *propName, const Path &path, const Revision &revision)
svn::StatusFilter::showUnmodified
bool showUnmodified
Definition: client.hpp:91
path.hpp
svn::Client::log
const LogEntries * log(const char *path, const Revision &revisionStart, const Revision &revisionEnd, bool discoverChangedPaths=false, bool strictNodeHistory=true)
svn::Client::lock
void lock(const Targets &targets, bool force, const char *comment)
svn::Client::merge
void merge(const Path &path1, const Revision &revision1, const Path &path2, const Revision &revision2, const Path &localPath, bool force, bool recurse, bool notice_ancestry=false, bool dry_run=false)
svn::Client::annotate
AnnotatedFile * annotate(const Path &path, const Revision &revisionStart, const Revision &revisionEnd)
svn::DirEntries
std::vector< DirEntry > DirEntries
Definition: client.hpp:68
svn::StatusFilter::showModified
bool showModified
this includes showConflicted as well
Definition: client.hpp:92
svn::Client::revpropdel
svn_revnum_t revpropdel(const char *propName, const Path &path, const Revision &revision, bool force=false)
svn::Client::doSwitch
svn_revnum_t doSwitch(const Path &path, const char *url, const Revision &revision, bool recurse)
svn::Client::ignore
void ignore(const Path &path)
svn::Client::propget
PathPropertiesMapList propget(const char *propName, const Path &path, const Revision &revision, bool recurse=false)
svn::PathPropertiesMapList
std::vector< PathPropertiesMapEntry > PathPropertiesMapList
Definition: client.hpp:79
svn::Client::revert
void revert(const Targets &targets, bool recurse)
svn::Client::revproplist
std::pair< svn_revnum_t, PropertiesMap > revproplist(const Path &path, const Revision &revision)
svn::Client::checkout
svn_revnum_t checkout(const char *moduleName, const Path &destPath, const Revision &revision, bool recurse, bool ignore_externals=false, const Revision &peg_revision=Revision::UNSPECIFIED)
exception.hpp
svn::Client::update
std::vector< svn_revnum_t > update(const Targets &targets, const Revision &revision, bool recurse, bool ignore_externals)
svn::Client::getContext
const Context * getContext() const
svn::Client::move
void move(const Path &srcPath, const Revision &srcRevision, const Path &destPath, bool force)
svn::PropertiesMap
std::map< std::string, std::string > PropertiesMap
Definition: client.hpp:75
svn::Client::setContext
void setContext(Context *context=NULL)
svn::Client::status
StatusEntries status(const char *path, const bool descend=false, const bool get_all=true, const bool update=false, const bool no_ignore=false, const bool ignore_externals=false)
map_wrapper.hpp
svn::Client::resolved
void resolved(const Path &path, bool recurse)
svn::Client::copy
void copy(const Path &srcPath, const Revision &srcRevision, const Path &destPath)
svn::Client::Client
Client(Context *context=0)
svn::StatusFilter::StatusFilter
StatusFilter()
Definition: client.hpp:97
utility_wrapper.hpp
vector_wrapper.hpp
svn::ClientException
Definition: exception.hpp:74
svn::PathPropertiesMapEntry
std::pair< std::string, PropertiesMap > PathPropertiesMapEntry
Definition: client.hpp:77
annotate_line.hpp
svn::Client
Definition: client.hpp:109
log_entry.hpp