Subversion
Toggle main menu visibility
Loading...
Searching...
No Matches
svnxx
client
status.hpp
Go to the documentation of this file.
1
/**
2
* @file svnxx/client/status.hpp
3
* @copyright
4
* ====================================================================
5
* Licensed to the Apache Software Foundation (ASF) under one
6
* or more contributor license agreements. See the NOTICE file
7
* distributed with this work for additional information
8
* regarding copyright ownership. The ASF licenses this file
9
* to you under the Apache License, Version 2.0 (the
10
* "License"); you may not use this file except in compliance
11
* with the License. You may obtain a copy of the License at
12
*
13
* http://www.apache.org/licenses/LICENSE-2.0
14
*
15
* Unless required by applicable law or agreed to in writing,
16
* software distributed under the License is distributed on an
17
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18
* KIND, either express or implied. See the License for the
19
* specific language governing permissions and limitations
20
* under the License.
21
* ====================================================================
22
* @endcopyright
23
*/
24
25
#ifndef SVNXX_CLIENT_STATUS_HPP
26
#define SVNXX_CLIENT_STATUS_HPP
27
28
#include <cstdint>
29
#include <functional>
30
31
#include "
svnxx/detail/future.hpp
"
32
#include "
svnxx/client/context.hpp
"
33
34
#include "
svnxx/depth.hpp
"
35
#include "
svnxx/revision.hpp
"
36
37
namespace
apache {
38
namespace
subversion {
39
namespace
svnxx {
40
namespace
client {
41
42
/**
43
* @warning TODO: Work in progress
44
*/
45
struct
status_notification
{};
46
47
/**
48
* @warning TODO: Work in progress
49
*/
50
using
status_callback
= std::function<void(
const
char
*
path
,
51
const
status_notification
& st)>;
52
53
/**
54
* @brief Flags that modify the behaviour of the status operation.
55
* @see svn_client_status6
56
*/
57
enum class
status_flags
: std::uint_least32_t
58
{
59
empty = 0U,
60
get_all = 1U << 0,
61
check_out_of_date = 1U << 1,
62
check_working_copy = 1U << 2,
63
no_ignore = 1U << 3,
64
ignore_externals = 1U << 4,
65
depth_as_sticky = 1U << 5,
66
};
67
68
/**
69
* @brief Bitwise conjunction operator for @c status_flags.
70
*/
71
inline
status_flags
operator&
(
status_flags
a,
status_flags
b)
72
{
73
return
status_flags
(std::uint_least32_t(a) & std::uint_least32_t(b));
74
}
75
76
/**
77
* @brief Bitwise disjunction operator for @c status_flags.
78
*/
79
inline
status_flags
operator|
(
status_flags
a,
status_flags
b)
80
{
81
return
status_flags
(std::uint_least32_t(a) | std::uint_least32_t(b));
82
}
83
84
/**
85
* @ingroup svnxx_client
86
* @brief Perform a status operation on @a path.
87
* @param ctx the #context object to use for this operation
88
* @param path the (root) path for the status walk.
89
* @param rev the revision to use when @c check_out_of_date is set in @a flags
90
* @param depth the depth of the operation
91
* @param flags a combination of @c status_flags
92
* @param callback a function that will be called for each status target
93
* @warning TODO: Work in progress
94
* @see svn_client_status6
95
*/
96
revision::number
97
status
(
context
& ctx,
const
char
*
path
,
98
const
revision
& rev,
depth
depth
,
status_flags
flags,
99
status_callback
callback);
100
101
namespace
async {
102
103
/**
104
* @ingroup svnxx_client
105
* @brief Perform an asynchronous status operation on @a path.
106
*
107
* Behaves as if svn::client::status() were invoked through
108
* <tt>std::async()</tt>, but also maintains the lifetime of
109
* internal state relevant to the status operation.
110
*
111
* @warning Any callbacks regietered in @a ctx, as well as the
112
* status @a callback itself, may be called in the context
113
* of a different thread than the one that created this
114
* asynchronous operation.
115
*/
116
svnxx::detail::future<revision::number>
117
status
(std::launch policy,
context
& ctx,
const
char
*
path
,
118
const
revision
& rev,
depth
depth_,
status_flags
flags,
119
status_callback
callback);
120
121
/**
122
* @overload
123
* @ingroup svnxx_client
124
* @note Uses the <tt>std::launch</tt> @a policy set to
125
* <tt>std::launch::async|std::launch::deferred</tt>.
126
*/
127
svnxx::detail::future<revision::number>
128
status
(
context
& ctx,
const
char
*
path
,
129
const
revision
& rev,
depth
depth_,
status_flags
flags,
130
status_callback
callback);
131
132
}
// namespace async
133
}
// namespace client
134
}
// namespace svnxx
135
}
// namespace subversion
136
}
// namespace apache
137
138
#endif
// SVNXX_CLIENT_STATUS_HPP
apache::subversion::svnxx::client::context
The context for client operations, see svn_client_ctx_t.
Definition
context.hpp:46
apache::subversion::svnxx::revision
A revision, see svn_opt_revision_t.
Definition
revision.hpp:49
apache::subversion::svnxx::revision::number
number
Revision number type.
Definition
revision.hpp:55
context.hpp
depth.hpp
apache::subversion::svnxx::depth
depth
The concept of depth for directories (see svn_depth_t).
Definition
depth.hpp:42
future.hpp
path
const char * path
Structure used in the svn_wc_notify_func2_t function.
Definition
svn_wc.h:1396
apache::subversion::svnxx::client::async::status
svnxx::detail::future< revision::number > status(std::launch policy, context &ctx, const char *path, const revision &rev, depth depth_, status_flags flags, status_callback callback)
Perform an asynchronous status operation on path.
apache::subversion::svnxx::client::status
revision::number status(context &ctx, const char *path, const revision &rev, depth depth, status_flags flags, status_callback callback)
Perform a status operation on path.
revision.hpp
apache::subversion::svnxx::client::operator&
status_flags operator&(status_flags a, status_flags b)
Bitwise conjunction operator for status_flags.
Definition
status.hpp:71
apache::subversion::svnxx::client::operator|
status_flags operator|(status_flags a, status_flags b)
Bitwise disjunction operator for status_flags.
Definition
status.hpp:79
apache::subversion::svnxx::client::status_callback
std::function< void(const char *path, const status_notification &st)> status_callback
Definition
status.hpp:50
apache::subversion::svnxx::client::status_flags
status_flags
Flags that modify the behaviour of the status operation.
Definition
status.hpp:58
apache::subversion::svnxx::client::status_notification
Definition
status.hpp:45
Generated by
1.17.0