Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
a237db55
Commit
a237db55
authored
Mar 28, 2021
by
Max Kellermann
Committed by
Max Kellermann
Apr 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
java/File: add non-static GetAbsolutePath() overload
parent
285ba54f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
File.cxx
src/java/File.cxx
+1
-1
File.hxx
src/java/File.hxx
+10
-1
No files found.
src/java/File.cxx
View file @
a237db55
...
...
@@ -54,7 +54,7 @@ Java::File::ToAbsolutePath(JNIEnv *env, jobject _file) noexcept
LocalObject
file
(
env
,
_file
);
const
jstring
path
=
g
etAbsolutePath
(
env
,
file
);
const
jstring
path
=
G
etAbsolutePath
(
env
,
file
);
if
(
DiscardException
(
env
)
||
path
==
nullptr
)
return
nullptr
;
...
...
src/java/File.hxx
View file @
a237db55
...
...
@@ -31,6 +31,7 @@
#define JAVA_FILE_HXX
#include "Object.hxx"
#include "String.hxx"
#include <jni.h>
...
...
@@ -51,11 +52,19 @@ public:
static
void
Initialise
(
JNIEnv
*
env
)
noexcept
;
gcc_nonnull_all
static
jstring
g
etAbsolutePath
(
JNIEnv
*
env
,
jobject
file
)
noexcept
{
static
jstring
G
etAbsolutePath
(
JNIEnv
*
env
,
jobject
file
)
noexcept
{
return
(
jstring
)
env
->
CallObjectMethod
(
file
,
getAbsolutePath_method
);
}
String
GetAbsolutePath
()
const
noexcept
{
return
{
GetEnv
(),
GetAbsolutePath
(
GetEnv
(),
Get
())};
}
String
GetAbsolutePathChecked
()
const
noexcept
{
return
*
this
?
GetAbsolutePath
()
:
nullptr
;
}
/**
* Invoke File.getAbsolutePath() and release the
* specified File reference.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment