• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..04-Feb-2021-

include/H04-Feb-2021-1,856658

src/H04-Feb-2021-2,6471,419

tests/H04-Feb-2021-1,6591,164

READMEH A D08-Jan-20194.1 KiB14896

README

1WORK IN PROGRESS
2================
3
4This directory contains an experimental implementation of SVN++, a
5high-level Subversion C++ API.
6
7It is far from complete and may never see the light of day.
8
9On the other hand, one good reason for having a high-level C++ API is
10to use it as a baseline for Swig-generated bindings. Our current set
11of Perl, Python and Ruby bindings is too heterogenous in terms of
12feature set, object and usage model. They're almost as hard to use as
13the C API itself.
14
15
16DESIGN GOALS
17============
18
19In no particular order:
20
21  * Use modern C++ constructs (the current baseline is C++11).
22
23  * Hide the dependency on APR that is exposed in Subversion's C API.
24
25  * Use separate C++ types for different kinds of values returned
26    from the C API (e.g., dirent vs. property value vs. URL), to make
27    it easier to create generic typemaps for Swig.
28
29  * Provide both synchronous and asynchronous interfaces.
30
31  * Avoid unnecessary copies by defining strict lifetimes for
32    returned values.
33
34  * Provide API variants that accept wide strings as well as
35    UTF-8-encoded narrow strings.
36
37  * Provide high-level constructs for common parameter types; e.g.,
38    revision ranges and lists for diff, merge, etc.
39
40  * Provide optional header-only conversions and overload for Boost types (e.g.,
41    boost::tribool, boost::filesystem::path), which can be enabled by users by
42    defining the SVNXX_USE_BOOST symbol.
43
44    These convenience overloads and conversions must *not* make the SVN++
45    library depend on any Boost runtime libraries.
46
47  * API versioning (how?).
48
49
50API COVERAGE
51============
52
53Planned:
54
55  * libsvn_client (highest priority)
56  * svn_mtcc_*
57  * utilities (diff, revision ranges/lists, etc.)
58  * libsvn_ra
59  * libsvn_repos/libsvn_fs (lowest priority)
60
61Not planned:
62  * libsvn_subr
63  * libsvn_wc
64
65
66C++ NAMESPACES AND SOURCE LAYOUT
67================================
68
69Public API
70----------
71
72The public API is in namespace apache::subversion::svnxx and we define
73a namespace alias for that:
74
75    namespace svn = ::apache::subversion::svnxx
76
77All elements of the public API are defined or declared in header files
78in the directory
79
80    .../include/svnxx/*.hpp
81
82with the single header file
83
84    .../include/svnxx.hpp
85
86importing all relevant headers from that directory.
87
88Implementation details used by the public API and visible to user
89code but that should not be directly used by user code are in the
90namespace apache::subversion::svnxx::detail and should be defined
91in header files in the directory:
92
93    .../include/svnxx/detail/*.hpp
94
95Note on API versioning
96----------------------
97
98Version-specific elements of the public API should be defined in
99namespaces within the public namespace; e.g., for version 1.13:
100
101    apache::subversion::svnxx::v_1_13
102
103and the default (or selected) version will be exposed in the
104parent namespace by inlining the namespace declaration.
105This versioning does not apply to things declared in svn::detail.
106
107Implementation
108--------------
109
110All entities that are private to the implementation should be
111in the namespace apache::subversion::svnxx::impl and defined
112in header files within the source directory tree:
113
114    .../src/private/*_private.hpp
115
116with the single header file
117
118    .../src/private.hpp
119
120importing all relevant headers from that directory. The exception to
121this rule are C++ wrappers for APR types, which are defined in the
122namespace apache::subversion::svnxx::apr in header files in the
123directory:
124
125    .../src/aprwrap/*.hpp
126
127with the single header file
128
129    .../src/aprwrap.hpp
130
131importing all relevant headers from that directory.
132
133====================================================================
134
135IMPLEMENTATION NOTES
136====================
137
138Asynchronous Operations (TODO)
139------------------------------
140
141In the current model of asyncrhonous operations, we do not protect
142against using the same svn_client_ctx_t object from multiple
143threads. This _should_ be safe as long as the callback
144implementations are aware of it, but we should consider changing the
145design so that whilst svn::client::context can be shared, we create
146the actual svn_client_ctx_t on the fly for each operation --
147similarly to how we create a the scratch pool.
148