FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java4cpp/src/main/resources/cpp_getfield.cpp at java4cpp-1.5 · wshackle/java4cpp · GitHub
wshackle
/
java4cpp
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
9
Code
Issues
1
Pull requests
1
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
java4cpp
/
src
/
main
/
resources
/
cpp_getfield.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (30 loc) · 1.61 KB
Breadcrumbs
java4cpp
/
src
/
main
/
resources
/
cpp_getfield.cpp
Copy path
File metadata and controls
30 lines (30 loc) · 1.61 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
%%% Lines beginning with "//%%%" are template comments and removed from final output.
//
%%% "%NAMESPACE%" will be replaced with namespace
//
%%% "%HEADER%" will be replaced with header
//
%%% "%HEADER_DEFINE%" will be replaced with defined value used to prevent multiple inclusion
//
%%% "%CLASS_NAME%" will be replaced with className (not including package)
//
%%% "%JNI_SIGNATURE% will be replaced with the JNI signature for the method.
//
%%% "%METHOD_NAME% will be replaced with the actual methods arguments
//
%%% "%METHOD_ARGS% will be replaced with the actual methods arguments
//
%%% "%METHOD_ONFAIL% will be replaced with the code to execute on failure eg return -1
//
%%% "%METHOD_CALL_TYPE% will be replaced with the type of Call<Type>Method needed.
//
%%% "%METHOD_RETURN%" will be replaced with "return" or "" for void functions.
if
(jthis ==
NULL
) {
std::cerr << __FILE__ <<
"
:
"
<< __LINE__ <<
"
Call of method %METHOD_NAME% of %FULL_CLASS_NAME% with jthis == NULL.
"
<< std::endl;
%
METHOD_ONFAIL
%
}
JNIEnv *env =getEnv();
jclass cls = env->
GetObjectClass
(jthis);
if
(GetDebugJ4Cpp()) DebugPrintJObject(__FILE__,__LINE__,
"
%CLASS_NAME%::%METHOD_NAME% jthis=
"
,jthis);
%
RETURN_VAR_DECLARE
%
if
(cls !=
NULL
) {
static
jfieldID fid = env->
GetFieldID
(cls,
"
%FIELD_NAME%
"
,
"
%JNI_SIGNATURE%
"
);
if
(
NULL
== fid) {
std::cerr <<
"
Class %FULL_CLASS_NAME% has no field named %FIELD_NAME% with signature %JNI_SIGNATURE%.
"
<< std::endl;
%
METHOD_ONFAIL
%
}
else
{
%
METHOD_RETURN_STORE
% env->
Get
%
METHOD_CALL_TYPE
%
Field
( jthis, fid %
METHOD_ARGS
% );
}
}
releaseEnv
(env);
%
METHOD_RETURN_GET
%
Back
|
FazBrowse Home
|
New Git URL