This commit is contained in:
Seven Du
2014-09-06 07:18:31 +08:00
parent 1a4e6e3093
commit d8bc5ed7ae
7 changed files with 310 additions and 378 deletions
+17 -14
View File
@@ -972,17 +972,19 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1Stream(JN
}
SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jlong jresult = 0 ;
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) {
jstring jresult = 0 ;
Stream *arg1 = (Stream *) 0 ;
std::string result;
int *arg2 = (int *) 0 ;
char *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(Stream **)&jarg1;
result = (arg1)->read();
*(std::string **)&jresult = new std::string((std::string &)result);
arg2 = *(int **)&jarg2;
result = (char *)(arg1)->read(arg2);
if(result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
@@ -1005,22 +1007,23 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1write(JNI
}
SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1raw_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) {
SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_Stream_1raw_1write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) {
Stream *arg1 = (Stream *) 0 ;
std::string arg2 ;
std::string *argp2 ;
char *arg2 = (char *) 0 ;
int arg3 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(Stream **)&jarg1;
argp2 = *(std::string **)&jarg2;
if (!argp2) {
SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null std::string");
return ;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return ;
}
arg2 = *argp2;
(arg1)->raw_write(arg2);
arg3 = (int)jarg3;
(arg1)->raw_write((char const *)arg2,arg3);
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
}