20#include <config_java.h>
24#include <com/sun/star/beans/XPropertySet.hpp>
25#include <com/sun/star/java/JavaVirtualMachine.hpp>
29#include <osl/diagnose.h>
30#include <rtl/character.hxx>
31#include <rtl/process.h>
37 return ch >= 0x0061 &&
ch <= 0x007a ?
ch + 0x20 :
ch;
45 using namespace ::com::sun::star::java;
56 while ( *pWild || flag )
65 if (*pWild && (*pWild == cEscape) && ((*(pWild+1)==
CHAR_PLACE) || (*(pWild+1) ==
CHAR_WILD)) )
85 return ( *pWild == 0 );
86 while ( *pStr && *pStr != *pWild )
95 return ( *pWild == 0 );
108 return ( *pStr == 0 ) && ( *pWild == 0 );
115 OSL_ENSURE(_rxContext.is(),
"No XMultiServiceFactory a.v.!");
121 Reference< XJavaVM > xVM = JavaVirtualMachine::create(_rxContext);
123 Sequence<sal_Int8> processID(17);
124 auto pprocessID = processID.getArray();
125 rtl_getGlobalProcessId(
reinterpret_cast<sal_uInt8*
>(pprocessID) );
128 Any uaJVM = xVM->getJavaVM( processID );
130 if (!(uaJVM >>= nTemp)) {
131 throw Exception(
"cannot get result for getJavaVM",
nullptr);
134 static_cast<sal_IntPtr
>(nTemp));
144 bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,std::u16string_view _sClassName )
150 JNIEnv* pEnv = aGuard.getEnvironment();
154 sClassName = sClassName.replace(
'.',
'/');
155 jobject out = pEnv->FindClass(sClassName.getStr());
156 bRet = out !=
nullptr;
157 pEnv->DeleteLocalRef( out );
171 return ( ((c >= 97) && (c <= 122)) || ((c >= 65) && (c <= 90)) || ((c >= 48) && (c <= 57)) ||
172 c ==
'_' || _rSpecials.find(c) != std::u16string_view::npos);
181 if (*pStr > 127 || rtl::isAsciiDigit(*pStr))
184 for (; *pStr; ++pStr )
188 if ( !rName.isEmpty()
189 && ( (rName.toChar() ==
'_')
190 || ( (rName.toChar() >=
'0')
191 && (rName.toChar() <=
'9')
212 if (*pStr >= 128 || rtl::isAsciiDigit(*pStr))
215 OUStringBuffer aNewName(rName);
216 sal_Int32
nLength = rName.getLength();
221 return aNewName.makeStringAndClear();
224OUString
quoteName(std::u16string_view _rQuote,
const OUString& _rName)
226 OUString
sName = _rName;
227 if( !_rQuote.empty() && _rQuote[0] !=
' ')
228 sName = _rQuote + _rName + _rQuote;
#define TOOLS_WARN_EXCEPTION(area, stream)
const sal_Unicode CHAR_PLACE
const sal_Unicode CHAR_WILD
bool match(const sal_Unicode *pWild, const sal_Unicode *pStr, const sal_Unicode cEscape)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)