3
* ====================================================================
4
* Licensed to the Apache Software Foundation (ASF) under one
5
* or more contributor license agreements. See the NOTICE file
6
* distributed with this work for additional information
7
* regarding copyright ownership. The ASF licenses this file
8
* to you under the Apache License, Version 2.0 (the
9
* "License"); you may not use this file except in compliance
10
* with the License. You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing,
15
* software distributed under the License is distributed on an
16
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
* KIND, either express or implied. See the License for the
18
* specific language governing permissions and limitations
20
* ====================================================================
24
#ifndef SVN_JAVAHL_EDITOR_CALLBACKS_HPP
25
#define SVN_JAVAHL_EDITOR_CALLBACKS_HPP
31
#include "jniwrapper/jni_object.hpp"
36
* Object wrapper for the base contents callback interface in
37
* @c org.apache.subversion.javahl.ISVNEditor.
41
class ProvideBaseCallback : public ::Java::Object
45
* Constructs a wrapper around @a jthis.
46
* The constructor does not verify the class of the wrapped object.
48
explicit ProvideBaseCallback(::Java::Env env, jobject jthis)
50
::Java::ClassCache::get_editor_provide_base_cb(env),
55
* Invokes the callback.
57
jobject operator()(jstring relpath) const
59
return m_env.CallObjectMethod(m_jthis, impl().m_mid_get_contents,
63
class ReturnValue : public ::Java::Object
67
* Constructs a wrapper around @a jthis.
68
* The constructor does not verify the class of the wrapped object.
70
explicit ReturnValue(::Java::Env env, jobject jthis)
72
::Java::ClassCache::get_editor_provide_base_cb_ret(env),
77
* Returns an @c svn_stream_t for the contents stream in the
78
* wrapped return value, allocated from @a pool. The wrapped Java
79
* stream will live as long as @a pool.
81
svn_stream_t* get_global_stream(apr_pool_t* pool) const;
84
* Returns an @c svn_stream_t for the contents stream in the
85
* wrapped return value, allocated from @a pool. The wrapped Java
86
* stream will live as long as @a pool.
88
svn_stream_t* get_global_stream(const SVN::Pool& pool) const
90
return get_global_stream(pool.getPool());
94
* Returns the revision in the wrapped return value.
96
jlong get_revision() const
98
return m_env.GetLongField(m_jthis, impl().m_fid_revision);
103
* This object's implementation details.
105
class ClassImpl : public Object::ClassImpl
107
friend class ::Java::ClassCacheImpl;
110
explicit ClassImpl(::Java::Env env, jclass cls);
113
virtual ~ClassImpl();
115
const ::Java::FieldID m_fid_contents;
116
const ::Java::FieldID m_fid_revision;
119
const ClassImpl& impl() const
121
return *dynamic_cast<const ClassImpl*>(m_impl);
124
friend class ::Java::ClassCacheImpl;
125
static const char* const m_class_name;
130
* This object's implementation details.
132
class ClassImpl : public Object::ClassImpl
134
friend class ::Java::ClassCacheImpl;
137
explicit ClassImpl(::Java::Env env, jclass cls);
140
virtual ~ClassImpl();
142
const ::Java::MethodID m_mid_get_contents;
145
const ClassImpl& impl() const
147
return *dynamic_cast<const ClassImpl*>(m_impl);
150
friend class ::Java::ClassCacheImpl;
151
static const char* const m_class_name;
156
* Object wrapper for the props callback interface in
157
* @c org.apache.subversion.javahl.ISVNEditor.
161
class ProvidePropsCallback : public ::Java::Object
165
* Constructs a wrapper around @a jthis.
166
* The constructor does not verify the class of the wrapped object.
168
explicit ProvidePropsCallback(::Java::Env env, jobject jthis)
169
: ::Java::Object(env,
170
::Java::ClassCache::get_editor_provide_props_cb(env),
175
* Invokes the callback.
177
jobject operator()(jstring relpath) const
179
return m_env.CallObjectMethod(m_jthis, impl().m_mid_get_props, relpath);
182
class ReturnValue : public ::Java::Object
186
* Constructs a wrapper around @a jthis.
187
* The constructor does not verify the class of the wrapped object.
189
explicit ReturnValue(::Java::Env env, jobject jthis)
191
::Java::ClassCache::get_editor_provide_props_cb_ret(env),
196
* Returns an @c apr_hash_t of the node properties in the wrapped
197
* return value, allocated from @a pool.
199
apr_hash_t* get_property_hash(apr_pool_t* pool) const;
202
* Returns an @c apr_hash_t of the node properties in the wrapped
203
* return value, allocated from @a pool.
205
apr_hash_t* get_property_hash(const SVN::Pool& pool) const
207
return get_property_hash(pool.getPool());
211
* Returns the revision in the wrapped return value.
213
jlong get_revision() const
215
return m_env.GetLongField(m_jthis, impl().m_fid_revision);
220
* This object's implementation details.
222
class ClassImpl : public Object::ClassImpl
224
friend class ::Java::ClassCacheImpl;
227
explicit ClassImpl(::Java::Env env, jclass cls);
230
virtual ~ClassImpl();
232
const ::Java::FieldID m_fid_properties;
233
const ::Java::FieldID m_fid_revision;
236
const ClassImpl& impl() const
238
return *dynamic_cast<const ClassImpl*>(m_impl);
241
friend class ::Java::ClassCacheImpl;
242
static const char* const m_class_name;
247
* This object's implementation details.
249
class ClassImpl : public Object::ClassImpl
251
friend class ::Java::ClassCacheImpl;
254
explicit ClassImpl(::Java::Env env, jclass cls);
257
virtual ~ClassImpl();
259
const ::Java::MethodID m_mid_get_props;
262
const ClassImpl& impl() const
264
return *dynamic_cast<const ClassImpl*>(m_impl);
267
friend class ::Java::ClassCacheImpl;
268
static const char* const m_class_name;
273
* Object wrapper for the kind callback interface in
274
* @c org.apache.subversion.javahl.ISVNEditor.
278
class GetNodeKindCallback : public ::Java::Object
282
* Constructs a wrapper around @a jthis.
283
* The constructor does not verify the class of the wrapped object.
285
explicit GetNodeKindCallback(::Java::Env env, jobject jthis)
286
: ::Java::Object(env,
287
::Java::ClassCache::get_editor_get_kind_cb(env),
292
* Invokes the callback.
294
jobject operator()(jstring relpath, jlong revision) const
296
return m_env.CallObjectMethod(m_jthis, impl().m_mid_get_kind,
302
* This object's implementation details.
304
class ClassImpl : public Object::ClassImpl
306
friend class ::Java::ClassCacheImpl;
309
explicit ClassImpl(::Java::Env env, jclass cls);
312
virtual ~ClassImpl();
314
const ::Java::MethodID m_mid_get_kind;
317
const ClassImpl& impl() const
319
return *dynamic_cast<const ClassImpl*>(m_impl);
322
friend class ::Java::ClassCacheImpl;
323
static const char* const m_class_name;
326
} // namespace JavaHL
328
#endif // SVN_JAVAHL_EDITOR_CALLBACKS_HPP