From 5268f55344229f70e3565f63671eb582eaff733f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 1 Mar 2014 20:53:39 +0100 Subject: java/File: add method ToAbsolutePath() returning AllocatedPath --- src/java/File.hxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/java/File.hxx') diff --git a/src/java/File.hxx b/src/java/File.hxx index 57af6199c..3636fc7c6 100644 --- a/src/java/File.hxx +++ b/src/java/File.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2012 Max Kellermann + * Copyright (C) 2010-2014 Max Kellermann * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +34,8 @@ #include +class AllocatedPath; + namespace Java { /** * Wrapper for a java.io.File object. @@ -42,12 +44,22 @@ namespace Java { static jmethodID getAbsolutePath_method; public: + gcc_nonnull_all static void Initialise(JNIEnv *env); + gcc_nonnull_all static jstring getAbsolutePath(JNIEnv *env, jobject file) { return (jstring)env->CallObjectMethod(file, getAbsolutePath_method); } + + /** + * Invoke File.getAbsolutePath() and release the + * specified File reference. + */ + gcc_pure gcc_nonnull_all + static AllocatedPath ToAbsolutePath(JNIEnv *env, + jobject file); }; } -- cgit v1.2.3