diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2008-03-12 18:18:39 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2008-03-12 18:18:39 +0000 |
| commit | 7bd5d99a8ff482a9ab419999ec9d930977789426 (patch) | |
| tree | a75701b20a7c2af469a3c2f77b9451661d912d61 /src/bind | |
| parent | Improve exception handling. Handle static method return types. (diff) | |
| download | inkscape-7bd5d99a8ff482a9ab419999ec9d930977789426.tar.gz inkscape-7bd5d99a8ff482a9ab419999ec9d930977789426.zip | |
Improve call to callMain()
(bzr r5067)
Diffstat (limited to 'src/bind')
| -rw-r--r-- | src/bind/javabind-private.h | 3 | ||||
| -rw-r--r-- | src/bind/javabind.cpp | 10 | ||||
| -rw-r--r-- | src/bind/javabind.h | 3 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/bind/javabind-private.h b/src/bind/javabind-private.h index 9b7b4e995..5a810480b 100644 --- a/src/bind/javabind-private.h +++ b/src/bind/javabind-private.h @@ -54,7 +54,8 @@ public: const std::vector<Value> ¶ms, Value &retval); - virtual bool callMain(const String &className); + virtual bool callMain(const String &className, + const std::vector<String> &args); virtual bool isLoaded(); diff --git a/src/bind/javabind.cpp b/src/bind/javabind.cpp index f4905e153..b03d562ce 100644 --- a/src/bind/javabind.cpp +++ b/src/bind/javabind.cpp @@ -930,11 +930,19 @@ String JavaBinderyImpl::getException() * method of a given class * * @param className full name of the java class + * @args the argument strings to the method * @return true if successful, else false */ -bool JavaBinderyImpl::callMain(const String &className) +bool JavaBinderyImpl::callMain(const String &className, + const std::vector<String> &args) { std::vector<Value> parms; + for (unsigned int i=0 ; i<args.size() ; i++) + { + Value v; + v.setString(args[i]); + parms.push_back(v); + } Value retval; return callStatic(Value::BIND_VOID, className, "main", "([Ljava/lang/String;)V", parms, retval); diff --git a/src/bind/javabind.h b/src/bind/javabind.h index cd622960b..c73afa581 100644 --- a/src/bind/javabind.h +++ b/src/bind/javabind.h @@ -241,7 +241,8 @@ public: /** * */ - virtual bool callMain(const String &/*className*/) + virtual bool callMain(const String &/*className*/, + const std::vector<String> &/*args*/) { return false; } |
