SvnCpp
context_listener.hpp
Go to the documentation of this file.
1 /*
2  * ====================================================================
3  * Copyright (c) 2002-2018 The RapidSVN Group. All rights reserved.
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as
7  * published by the Free Software Foundation, either version 3 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program (in the file LGPL.txt).
17  * If not, see <http://www.gnu.org/licenses/>.
18  *
19  * This software consists of voluntary contributions made by many
20  * individuals. For exact contribution history, see the revision
21  * history and logs, available at http://rapidsvn.tigris.org/.
22  * ====================================================================
23  */
24 
25 #ifndef _SVNCPP_CONTEXT_LISTENER_HPP_
26 #define _SVNCPP_CONTEXT_LISTENER_HPP_
27 
28 // stl
30 
31 // Subversion api
32 #include "svn_client.h"
33 
34 // svncpp
35 #include "svncpp/pool.hpp"
36 
37 namespace svn
38 {
46  {
47  public:
62  virtual bool
63  contextGetLogin(const std::string & realm,
64  std::string & username,
65  std::string & password,
66  bool & maySave) = 0;
67 
80  virtual void
81  contextNotify(const char *path,
82  svn_wc_notify_action_t action,
83  svn_node_kind_t kind,
84  const char *mime_type,
85  svn_wc_notify_state_t content_state,
86  svn_wc_notify_state_t prop_state,
87  svn_revnum_t revision) = 0;
88 
89  /*
90  * this method will be called periodically to allow
91  * the app to cancel long running operations
92  *
93  * @return cancel action?
94  * @retval true cancel
95  */
96  virtual bool
98 
110  virtual bool
111  contextGetLogMessage(std::string & msg) = 0;
112 
113  typedef enum
114  {
119 
120 
126  {
127  public:
129  apr_uint32_t failures;
130 
132  std::string hostname;
133  std::string fingerprint;
134  std::string validFrom;
135  std::string validUntil;
136  std::string issuerDName;
137  std::string realm;
138  bool maySave;
139 
140  SslServerTrustData(const apr_uint32_t failures_ = 0)
141  : failures(failures_), hostname(""), fingerprint(""),
142  validFrom(""), validUntil(""), issuerDName(""),
143  realm(""), maySave(true)
144  {
145  }
146 
148  : failures(src.failures)
149  {
150  hostname = src.hostname;
151  fingerprint = src.fingerprint;
152  validFrom = src.validFrom;
153  validUntil = src.validUntil;
154  issuerDName = src.issuerDName;
155  realm = src.realm;
156  maySave = src.maySave;
157  }
158 
161  {
162  if (this == &src)
163  return *this;
164 
165  hostname = src.hostname;
166  fingerprint = src.fingerprint;
167  validFrom = src.validFrom;
168  validUntil = src.validUntil;
169  issuerDName = src.issuerDName;
170  realm = src.realm;
171  maySave = src.maySave;
172  failures = src.failures;
173 
174  return *this;
175  }
176  };
177 
178 
187  virtual SslServerTrustAnswer
189  apr_uint32_t & acceptedFailures) = 0;
190 
195  virtual bool
196  contextSslClientCertPrompt(std::string & certFile) = 0;
197 
206  virtual bool
207  contextSslClientCertPwPrompt(std::string & password,
208  const std::string & realm,
209  bool & maySave) = 0;
210 
211  virtual ~ContextListener() { }
212  };
213 }
214 
215 #endif
216 /* -----------------------------------------------------------------
217  * local variables:
218  * eval: (load-file "../../rapidsvn-dev.el")
219  * end:
220  */
svn::ContextListener::~ContextListener
virtual ~ContextListener()
Definition: context_listener.hpp:211
svn::ContextListener::SslServerTrustData::realm
std::string realm
Definition: context_listener.hpp:137
svn::ContextListener::SslServerTrustData::maySave
bool maySave
Definition: context_listener.hpp:138
string_wrapper.hpp
svn::ContextListener::SslServerTrustData::validUntil
std::string validUntil
Definition: context_listener.hpp:135
svn::ContextListener::contextSslClientCertPrompt
virtual bool contextSslClientCertPrompt(std::string &certFile)=0
svn::ContextListener::SslServerTrustData::operator=
SslServerTrustData & operator=(const SslServerTrustData &src)
Definition: context_listener.hpp:160
svn::ContextListener
Definition: context_listener.hpp:46
pool.hpp
svn::ContextListener::ACCEPT_PERMANENTLY
@ ACCEPT_PERMANENTLY
Definition: context_listener.hpp:117
svn::ContextListener::SslServerTrustData::hostname
std::string hostname
Definition: context_listener.hpp:132
svn::ContextListener::DONT_ACCEPT
@ DONT_ACCEPT
Definition: context_listener.hpp:115
svn::ContextListener::SslServerTrustData::SslServerTrustData
SslServerTrustData(const SslServerTrustData &src)
Definition: context_listener.hpp:147
svn::ContextListener::SslServerTrustData::issuerDName
std::string issuerDName
Definition: context_listener.hpp:136
svn::ContextListener::contextSslClientCertPwPrompt
virtual bool contextSslClientCertPwPrompt(std::string &password, const std::string &realm, bool &maySave)=0
svn::ContextListener::SslServerTrustData::failures
apr_uint32_t failures
Definition: context_listener.hpp:129
svn::ContextListener::SslServerTrustData::validFrom
std::string validFrom
Definition: context_listener.hpp:134
svn::ContextListener::contextSslServerTrustPrompt
virtual SslServerTrustAnswer contextSslServerTrustPrompt(const SslServerTrustData &data, apr_uint32_t &acceptedFailures)=0
svn::ContextListener::SslServerTrustData::fingerprint
std::string fingerprint
Definition: context_listener.hpp:133
svn::ContextListener::SslServerTrustData
Definition: context_listener.hpp:126
svn
Definition: annotate_line.hpp:32
svn::ContextListener::ACCEPT_TEMPORARILY
@ ACCEPT_TEMPORARILY
Definition: context_listener.hpp:116
svn::ContextListener::SslServerTrustAnswer
SslServerTrustAnswer
Definition: context_listener.hpp:114
svn::ContextListener::contextCancel
virtual bool contextCancel()=0
svn::ContextListener::contextGetLogin
virtual bool contextGetLogin(const std::string &realm, std::string &username, std::string &password, bool &maySave)=0
svn::ContextListener::SslServerTrustData::SslServerTrustData
SslServerTrustData(const apr_uint32_t failures_=0)
Definition: context_listener.hpp:140
svn::ContextListener::contextGetLogMessage
virtual bool contextGetLogMessage(std::string &msg)=0
svn::ContextListener::contextNotify
virtual void contextNotify(const char *path, svn_wc_notify_action_t action, svn_node_kind_t kind, const char *mime_type, svn_wc_notify_state_t content_state, svn_wc_notify_state_t prop_state, svn_revnum_t revision)=0