1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_JVMFWK_SOURCE_FWKUTIL_HXX
20 #define INCLUDED_JVMFWK_SOURCE_FWKUTIL_HXX
22 #include <config_features.h>
23 #include <config_folders.h>
25 #include "sal/config.h"
26 #include "osl/mutex.hxx"
27 #include "rtl/bootstrap.hxx"
28 #include "rtl/instance.hxx"
29 #include "rtl/ustrbuf.hxx"
30 #include "rtl/byteseq.hxx"
31 #include "osl/thread.hxx"
32 #if OSL_DEBUG_LEVEL >=2
40 /** Returns the file URL of the directory where the framework library
41 (this library) resides.
43 OUString
getLibraryLocation();
45 /** provides a bootstrap class which already knows the values from the
49 public ::rtl::StaticWithInit
< const rtl::Bootstrap
*, Bootstrap
> {
50 const rtl::Bootstrap
* operator () () {
51 OUStringBuffer
buf(256);
52 buf
.append(getLibraryLocation());
54 // For some reason the jvmfwk3rc file is traditionally in
55 // LIBO_URE_ETC_FOLDER
56 buf
.appendAscii( "/../" LIBO_URE_ETC_FOLDER
);
58 buf
.appendAscii(SAL_CONFIGFILE("/jvmfwk3"));
59 OUString sIni
= buf
.makeStringAndClear();
60 ::rtl::Bootstrap
* bootstrap
= new ::rtl::Bootstrap(sIni
);
61 #if OSL_DEBUG_LEVEL >=2
62 OString o
= OUStringToOString( sIni
, osl_getThreadTextEncoding() );
63 fprintf(stderr
, "[Java framework] Using configuration file %s\n" , o
.getStr() );
69 struct FwkMutex
: public ::rtl::Static
<osl::Mutex
, FwkMutex
> {};
71 rtl::ByteSequence
encodeBase16(const rtl::ByteSequence
& rawData
);
72 rtl::ByteSequence
decodeBase16(const rtl::ByteSequence
& data
);
74 OUString
getPlatform();
77 OUString
getDirFromFile(const OUString
& usFilePath
);
86 /** checks if the URL is a file.
88 If it is a link to a file than
89 it is resolved. Assuming that the argument
90 represents a relative URL then FILE_INVALID
95 one of the values of FileStatus.
98 Errors occurred during determining if the file exists
100 FileStatus
checkFileURL(const OUString
& path
);
102 bool isAccessibilitySupportDesired();
104 OUString
retrieveClassPath( OUString
const & macro
);
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */