* not part of tbox builds*
Fixed 57779, 58191 git-svn-id: svn://10.0.0.236/trunk@83932 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -10,4 +10,6 @@ interface bcIJavaSample : nsISupports
|
||||
void test3(in PRUint32 count,[array, size_is(count)] in long valueArray);
|
||||
void test4(in PRUint32 count,[array, size_is(count)] inout string valueArray);
|
||||
void test5(in nsIComponentManager cm);
|
||||
void test6(in PRUint32 count,[array, size_is(count)] in string valueArray);
|
||||
void test7(out PRUint32 count,[array, size_is(count)] out char valueArray);
|
||||
};
|
||||
|
||||
@@ -4,15 +4,16 @@
|
||||
* This file was automatically generated from bcIJavaSample.idl.
|
||||
*/
|
||||
|
||||
|
||||
import org.mozilla.xpcom.*;
|
||||
|
||||
|
||||
/**
|
||||
* Interface bcIJavaSample
|
||||
*
|
||||
* IID: 0xca1e2656-1dd1-11b2-9c4e-f49ea557abde
|
||||
*/
|
||||
|
||||
|
||||
public interface bcIJavaSample extends nsISupports
|
||||
{
|
||||
public static final String IID =
|
||||
@@ -37,6 +38,12 @@ public interface bcIJavaSample extends nsISupports
|
||||
/* void test5 (in nsIComponentManager cm); */
|
||||
public void test5(nsIComponentManager cm);
|
||||
|
||||
/* void test6 (in PRUint32 count, [array, size_is (count)] in string valueArray); */
|
||||
public void test6(int count, String[] valueArray);
|
||||
|
||||
/* void test7 (out PRUint32 count, [array, size_is (count)] out char valueArray); */
|
||||
public void test7(int[] count, char[][] valueArray);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -100,6 +100,19 @@ NS_IMETHODIMP bcJavaSample::Test5(nsIComponentManager *cm) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void test6 (in PRUint32 count, [array, size_is (count)] in string valueArray); */
|
||||
NS_IMETHODIMP bcJavaSample::Test6(PRUint32 count, const char **valueArray) {
|
||||
printf("--[c++] bcJavaSample.test6 coutn %d\n",count);
|
||||
for(unsigned int i = 0; i < count; i++) {
|
||||
printf("--[c++] valueArray[%d]=%s\n",i,valueArray[i]);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void test7 (in PRUint32 count, [array, size_is (count)] out char valueArray); */
|
||||
NS_IMETHODIMP bcJavaSample::Test7(PRUint32 *count, char **valueArray) {
|
||||
return NS_OK;
|
||||
}
|
||||
void test() {
|
||||
printf("--BlackConnect test start\n");
|
||||
nsresult r;
|
||||
@@ -151,6 +164,25 @@ void test() {
|
||||
}
|
||||
printf("--[c++] bcJavaSample after test->Test5(cm)\n");
|
||||
}
|
||||
{
|
||||
const char ** valueArray = (const char **)malloc(sizeof(char*)*4);
|
||||
valueArray[0] = "hi";
|
||||
valueArray[1] = "there";
|
||||
valueArray[2] = "a";
|
||||
valueArray[3] = "b";
|
||||
test->Test6(4,valueArray);
|
||||
}
|
||||
{
|
||||
printf("--[c++]about to test7\n");
|
||||
PRUint32 count;
|
||||
char *charArray;
|
||||
test->Test7(&count,&charArray);
|
||||
for (int i = 0; i < count; i++) {
|
||||
printf("--[c++] charArray[%d]=%c\n",i,charArray[i]);
|
||||
}
|
||||
printf("--[c++]end of test7\n");
|
||||
}
|
||||
|
||||
printf("--BlackConnect test end\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ public class bcJavaSample implements bcIJavaSample {
|
||||
o.test2(this);
|
||||
int[] array={3,2,1};
|
||||
o.test3(3,array);
|
||||
{
|
||||
String[] strings = {"4","3","2","1"};
|
||||
o.test6(4, strings);
|
||||
}
|
||||
} else {
|
||||
System.out.println("--[java]bcJavaSample.test2 o = null");
|
||||
}
|
||||
@@ -70,7 +74,7 @@ public class bcJavaSample implements bcIJavaSample {
|
||||
System.out.println("--[java]bcJavaSample.test4");
|
||||
String[] array = valueArray[0];
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
System.out.println("--[java]callMethodByIndex args["+i+"] = "+array[i]);
|
||||
System.out.println("--[java]bcJavaSample.test4 valueArray["+i+"] = "+array[i]);
|
||||
}
|
||||
String[] returnArray = {"4","3","2","1"};
|
||||
valueArray[0] = returnArray;
|
||||
@@ -103,6 +107,22 @@ public class bcJavaSample implements bcIJavaSample {
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
}
|
||||
|
||||
}
|
||||
public void test6(int count, String[] valueArray) {
|
||||
System.out.println("--[java]bcJavaSample.test6");
|
||||
String[] array = valueArray;
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
System.out.println("--[java]bcJavaSample.test6 valueArray["+i+"] = "+array[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* void test7 (out PRUint32 count, [array, size_is (count)] out char valueArray); */
|
||||
public void test7(int[] count, char[][] valueArray) {
|
||||
System.out.println("--[java]bcJavaSample.test7");
|
||||
char [] retValue = {'1','b','c','d'};
|
||||
count[0] = retValue.length;
|
||||
valueArray[0] = retValue;
|
||||
}
|
||||
|
||||
static IID bcIJavaSampleIID = new IID(bcIJavaSample.IID);
|
||||
|
||||
Reference in New Issue
Block a user