diff options
author | Jörg Budischewski <jbu@openoffice.org> | 2002-04-29 13:12:14 +0000 |
---|---|---|
committer | Jörg Budischewski <jbu@openoffice.org> | 2002-04-29 13:12:14 +0000 |
commit | 69e376c01ab6c8a1e421382f94b1d167e78a429e (patch) | |
tree | 09aedba1f054f1ae7ba836f4eb9bbd15668e059a /stoc | |
parent | 3918192b9b63a686282981cafc22f6e4cbadcf07 (diff) |
#99011# UNO_SHARE/USER_PACAKGES_CACHE is now interpreted by the javavm service
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/javavm/jvmargs.cxx | 54 | ||||
-rw-r--r-- | stoc/source/javavm/jvmargs.hxx | 15 |
2 files changed, 50 insertions, 19 deletions
diff --git a/stoc/source/javavm/jvmargs.cxx b/stoc/source/javavm/jvmargs.cxx index 647be9a00d27..55e2e8afca13 100644 --- a/stoc/source/javavm/jvmargs.cxx +++ b/stoc/source/javavm/jvmargs.cxx @@ -2,9 +2,9 @@ * * $RCSfile: jvmargs.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: hr $ $Date: 2002-02-21 12:14:56 $ + * last change: $Author: jbu $ $Date: 2002-04-29 14:12:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,8 +73,10 @@ #include "jvmargs.hxx" #include <osl/diagnose.h> +#include <osl/thread.h> #include <rtl/ustring.hxx> +#include <rtl/ustrbuf.hxx> using namespace rtl; @@ -126,10 +128,10 @@ namespace stoc_javavm { _vmtype = right; else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("SystemClasspath")))) - setSystemClasspath(right); + addSystemClasspath(right); else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("UserClasspath")))) - setUserClasspath(right); + addUserClasspath(right); else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("DisableAsyncGC")))) setDisableAsyncGC(right.toInt32()); @@ -232,18 +234,37 @@ namespace stoc_javavm { _debugPort = jiValue; } - void JVM::setSystemClasspath(const OUString & classpath) throw() { - OString tmp = OUStringToOString(classpath, RTL_TEXTENCODING_ASCII_US); - OSL_TRACE("JVM::setSystemClasspath: %s", tmp.getStr()); - - _systemClasspath = classpath; + void JVM::addSystemClasspath(const OUString & classpath) throw() { + if( classpath.getLength() ) + { + OString tmp = OUStringToOString(classpath, RTL_TEXTENCODING_ASCII_US); + OSL_TRACE("JVM::addSystemClasspath: %s", tmp.getStr()); + + OUStringBuffer buf(_systemClasspath.getLength() +1 + classpath.getLength()); + if( _systemClasspath.getLength() ) + { + buf.append( _systemClasspath ); + buf.appendAscii( CLASSPATH_DELIMETER ); + } + buf.append( classpath ); + _systemClasspath = buf.makeStringAndClear(); + } } - void JVM::setUserClasspath(const OUString & classpath) throw() { - OString tmp = OUStringToOString(classpath, RTL_TEXTENCODING_ASCII_US); - OSL_TRACE("JVM::setUserClasspath: %s", tmp.getStr()); - - _userClasspath = classpath; + void JVM::addUserClasspath(const OUString & classpath) throw() { + if( classpath.getLength() ) + { + OString tmp = OUStringToOString(classpath, RTL_TEXTENCODING_ASCII_US); + OSL_TRACE("JVM::addUserClasspath: %s", tmp.getStr()); + OUStringBuffer buf( _userClasspath.getLength() + 1 + classpath.getLength() ); + if( _userClasspath.getLength() ) + { + buf.append( _userClasspath ); + buf.appendAscii( CLASSPATH_DELIMETER ); + } + buf.append( classpath ); + _userClasspath = buf.makeStringAndClear(); + } } void JVM::setPrint(JNIvfprintf vfprintf) throw() { @@ -266,7 +287,10 @@ namespace stoc_javavm { classpath += OUString(RTL_CONSTASCII_USTRINGPARAM(CLASSPATH_DELIMETER)); classpath += _userClasspath; - pargs->classpath = strdup(OUStringToOString(classpath, RTL_TEXTENCODING_ASCII_US)); +#ifdef DEBUG + fprintf( stderr, "JavaVM: using classpath %s\n" , OUStringToOString(classpath, osl_getThreadTextEncoding()).getStr()); +#endif + pargs->classpath = strdup(OUStringToOString(classpath, osl_getThreadTextEncoding())); if(_is_debugPort) { pargs->debugging = JNI_TRUE; diff --git a/stoc/source/javavm/jvmargs.hxx b/stoc/source/javavm/jvmargs.hxx index 88a3fc12dba1..747ee4bbff60 100644 --- a/stoc/source/javavm/jvmargs.hxx +++ b/stoc/source/javavm/jvmargs.hxx @@ -2,9 +2,9 @@ * * $RCSfile: jvmargs.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: cp $ $Date: 2002-01-20 20:11:04 $ + * last change: $Author: jbu $ $Date: 2002-04-29 14:12:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,6 +62,13 @@ #ifndef __JVM_HXX #define __JVM_HXX +#ifdef UNIX +#define CLASSPATH_DELIMETER ":" + +#else +#define CLASSPATH_DELIMETER ";" + +#endif #include <cstdarg> #include <vector> @@ -149,8 +156,8 @@ namespace stoc_javavm { void setMinHeapSize(jint jiSize) throw(); void setMaxHeapSize(jint jiSize) throw(); void setDebugPort(jint jiDebugPort) throw(); - void setSystemClasspath(const ::rtl::OUString & str) throw(); - void setUserClasspath(const ::rtl::OUString & str) throw(); + void addSystemClasspath(const ::rtl::OUString & str) throw(); + void addUserClasspath(const ::rtl::OUString & str) throw(); void setPrint(JNIvfprintf vfprintf) throw(); void setExit(JNIexit exit) throw(); void setAbort(JNIabort abort) throw(); |