Mercurial > hg > octave-lyh
comparison libinterp/octave-value/ov-java.h @ 15824:abc9e5f3c661
Return correct value for ischar() predicate test on octave_java objects.
* libinterp/octave-value/ov-java.h(is_string):
Rename is_string() to is_java_string. Leave only prototype in .h file.
* libinterp/octave-value/ov-java.cc(is_java_string):
Move code for is_string from ov-java.h to is_java_string in ov-java.cc.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 21 Dec 2012 10:18:38 -0800 |
parents | 10d6ab9b1b4f |
children | fe2cefaa772b |
comparison
equal
deleted
inserted
replaced
15823:bc7a130bbdfb | 15824:abc9e5f3c661 |
---|---|
181 const std::list<octave_value_list>& idx, | 181 const std::list<octave_value_list>& idx, |
182 const octave_value& rhs); | 182 const octave_value& rhs); |
183 | 183 |
184 octave_value convert_to_str_internal (bool pad, bool force, char type) const; | 184 octave_value convert_to_str_internal (bool pad, bool force, char type) const; |
185 | 185 |
186 bool is_string (void) const | 186 bool is_java_string (void) const; |
187 { | |
188 JNIEnv *current_env = thread_jni_env (); | |
189 | |
190 if (current_env && java_object) | |
191 { | |
192 jclass_ref cls (current_env, current_env->FindClass ("java/lang/String")); | |
193 return current_env->IsInstanceOf (java_object, cls); | |
194 } | |
195 | |
196 return false; | |
197 } | |
198 | 187 |
199 static JNIEnv* thread_jni_env (void); | 188 static JNIEnv* thread_jni_env (void); |
200 | 189 |
201 octave_value do_javaMethod (JNIEnv* jni_env, const std::string& name, | 190 octave_value do_javaMethod (JNIEnv* jni_env, const std::string& name, |
202 const octave_value_list& args); | 191 const octave_value_list& args); |