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
package org.apache.subversion.javahl.types;
27
* Encapsulates information about the compile-time and run-time
28
* properties of the Subversion libraries.
31
public class VersionExtended
34
* @return The date when the libsvn_subr library was compiled, in
35
* the format defined by the C standard macro #__DATE__.
37
public native String getBuildDate();
40
* @return The time when the libsvn_subr library was compiled, in
41
* the format defined by the C standard macro #__TIME__.
43
public native String getBuildTime();
46
* @return The canonical host triplet (arch-vendor-osname) of the
47
* system where libsvn_subr was compiled.
49
* @note On Unix-like systems (includng Mac OS X), this string is
50
* the same as the output of the config.guess script for the
51
* underlying Subversion libraries.
53
public native String getBuildHost();
56
* @return The localized copyright notice.
58
public native String getCopyright();
61
* @return The canonical host triplet (arch-vendor-osname) of the
62
* system where the current process is running.
64
* @note This string may not be the same as the output of
65
* config.guess on the same system.
67
public native String getRuntimeHost();
70
* @return The "commercial" release name of the running operating
71
* system, if available. Not to be confused with, e.g., the
72
* output of "uname -v" or "uname -r". The returned value may
75
public native String getRuntimeOSName();
78
* Dependent library information.
79
* Describes the name and versions of known dependencies
80
* used by libsvn_subr.
82
public class LinkedLib
84
/** @return Library name. */
85
public final native String getName();
87
/** @return Compile-time version string. */
88
public final native String getCompiledVersion();
91
* @return Run-time version string (may be #null, which
92
* indicates that the library is embedded or statically
95
public final native String getRuntimeVersion();
97
LinkedLib(VersionExtended wrapper, int index)
99
this.wrapper = wrapper;
103
private final VersionExtended wrapper;
104
private final int index;
108
* @return Iterator for an immutable internal list of #LinkedLib
109
* describing dependent libraries. The list may be empty.
111
public java.util.Iterator<LinkedLib> getLinkedLibs()
113
return new LinkedLibIterator(this);
117
* Loaded shared library information.
118
* Describes the name and, where available, version of the shared
119
* libraries loaded by the running program.
121
public class LoadedLib
123
/** @return Library name. */
124
public final native String getName();
126
/** @return Library version (may be #null). */
127
public final native String getVersion();
129
LoadedLib(VersionExtended wrapper, int index)
131
this.wrapper = wrapper;
135
private final VersionExtended wrapper;
136
private final int index;
140
* @return Iterator for an immutable internal list of #LoadedLib
141
* describing loaded shared libraries. The the list may be empty.
143
* @note On Mac OS X, the loaded frameworks, private frameworks
144
* and system libraries will not be listed.
146
public java.util.Iterator<LoadedLib> getLoadedLibs()
148
return new LoadedLibIterator(this);
152
* Iterator for #LinkedLib.
154
private class LinkedLibIterator implements java.util.Iterator<LinkedLib>
156
public LinkedLibIterator(VersionExtended wrapper)
158
this.wrapper = wrapper;
163
* Implementation of java.util.Iterator#hasNext().
164
* @return #true if next() can be called safely.
166
public native boolean hasNext();
169
* Implementation of java.util.Iterator#next().
170
* @return The next element of the sequence.
172
public LinkedLib next()
175
throw new java.util.NoSuchElementException();
176
return new LinkedLib(this.wrapper, ++this.index);
180
* Implementation of java.util.Iterator#remove().
181
* @note Not implemented, all sequences are immutable.
185
throw new java.lang.UnsupportedOperationException();
188
private final VersionExtended wrapper;
193
* Iterator for #LoadedLib.
195
private class LoadedLibIterator implements java.util.Iterator<LoadedLib>
197
public LoadedLibIterator(VersionExtended wrapper)
199
this.wrapper = wrapper;
204
* Implementation of java.util.Iterator#hasNext().
205
* @return #true if next() can be called safely.
207
public native boolean hasNext();
210
* Implementation of java.util.Iterator#next().
211
* @return The next element of the sequence.
213
public LoadedLib next()
216
throw new java.util.NoSuchElementException();
217
return new LoadedLib(this.wrapper, ++this.index);
221
* Implementation of java.util.Iterator#remove().
222
* @note Not implemented, all sequences are immutable.
226
throw new java.lang.UnsupportedOperationException();
229
private final VersionExtended wrapper;
234
* Slot for the adress of the native peer.
235
* The JNI code is the only user of this member.
237
private long cppAddr = 0;