This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
svn_branch_analyzer.hpp
83 lines (63 loc) · 2.57 KB
/
svn_branch_analyzer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright Dave Abrahams 2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef SVN_BRANCH_ANALYZER_DWA201319_HPP
# define SVN_BRANCH_ANALYZER_DWA201319_HPP
# include "svn_dump_parser.hpp"
# include <set>
# include <string>
#include <boost/filesystem/path.hpp>
namespace ryppl {
// "Proves the concept" of svn_dump_parser by producing a
// human-readable rendition of the dump. This component will probably
// not be used except for testing.
struct svn_branch_analyzer : svn_dump_parser
{
svn_branch_analyzer(apr_pool_t* pool)
: svn_dump_parser(pool), rev_num(-1), found_path(false) {}
private: // virtual function implementations
//
// Top-level events
//
// The parser has discovered a new uuid record
void uuid_record(const char *uuid, apr_pool_t *pool);
// The parser has discovered a new revision record
void begin_revision(apr_hash_t *headers, apr_pool_t *pool);
// the named property of the current revision to was set to value.
void set_revision_property(const char *name, const svn_string_t *value);
// The parser has reached the end of the current revision
void end_revision();
//
// Events within a given revision
//
// The parser has discovered a new node (file) record
void begin_node(apr_hash_t *headers, apr_pool_t *pool);
// The parser has reached the end of the current node
void end_node();
//
// Events within a given node
//
// the named property of the current node was set to value
void set_node_property(const char *name, const svn_string_t *value);
// the named property of the current node was deleted
void delete_node_property(const char *name);
// all properties of the current node were deleted
void remove_node_props();
// The given fulltext provides the next section of the node's contents
void write_fulltext_stream(const char *data, apr_size_t *len);
// There are no more fulltext sections in this node
void close_fulltext_stream();
// The given text delta should be applied against the node's
// previous contents.
void apply_textdelta(svn_txdelta_window_t *window);
private: // data members
// Revision number
long rev_num;
bool node_is_dir;
bool found_path;
boost::filesystem::path path_gcd;
// A set of all source directory paths that are used for a copy (or move)
std::set<std::string> src_dirs;
};
}
#endif // SVN_BRANCH_ANALYZER_DWA201319_HPP