Subversion
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
33
34#include "svnxx/depth.hpp"
35#include "svnxx/revision.hpp"
36
37namespace apache {
38namespace subversion {
39namespace svnxx {
40namespace client {
41
42/**
43 * @warning TODO: Work in progress
44 */
46
47/**
48 * @warning TODO: Work in progress
49 */
50using 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 */
57enum 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 */
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 */
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 */
97status(context& ctx, const char* path,
98 const revision& rev, depth depth, status_flags flags,
99 status_callback callback);
100
101namespace 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 */
117status(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 */
128status(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
The context for client operations, see svn_client_ctx_t.
Definition: context.hpp:46
like std::future, but also maintains internal state relevant to the asynchronous SVN++ operation.
Definition: future.hpp:129
A revision, see svn_opt_revision_t.
Definition: revision.hpp:49
number
Revision number type.
Definition: revision.hpp:55
depth
The concept of depth for directories (see svn_depth_t).
Definition: depth.hpp:42
svnxx::detail::future< revision::number > status(context &ctx, const char *path, const revision &rev, depth depth_, status_flags flags, status_callback callback)
This is an overloaded member function, provided for convenience. It differs from the above function o...
status_flags operator&(status_flags a, status_flags b)
Bitwise conjunction operator for status_flags.
Definition: status.hpp:71
status_flags operator|(status_flags a, status_flags b)
Bitwise disjunction operator for status_flags.
Definition: status.hpp:79
status_flags
Flags that modify the behaviour of the status operation.
Definition: status.hpp:58
std::function< void(const char *path, const status_notification &st)> status_callback
Definition: status.hpp:51