sunjre.cxx (36f55ffc) sunjre.cxx (696f238b)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 15 unchanged lines hidden (view full) ---

24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_jvmfwk.hxx"
26
27#include "osl/thread.h"
28#include "sunjre.hxx"
29#include "sunversion.hxx"
30#include "diagnostics.h"
31
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 15 unchanged lines hidden (view full) ---

24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_jvmfwk.hxx"
26
27#include "osl/thread.h"
28#include "sunjre.hxx"
29#include "sunversion.hxx"
30#include "diagnostics.h"
31
32using namespace rtl;
33using namespace std;
34
35#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
36namespace jfw_plugin
37{
38
32using namespace std;
33
34#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
35namespace jfw_plugin
36{
37
39Reference<VendorBase> SunInfo::createInstance()
38rtl::Reference<VendorBase> SunInfo::createInstance()
40{
41 return new SunInfo;
42}
43
44char const* const* SunInfo::getJavaExePaths(int * size)
45{
46 static char const * ar[] = {
47#if defined(WNT) || defined(OS2)

--- 27 unchanged lines hidden (view full) ---

75
76 };
77 *size = sizeof(ar) / sizeof (char*);
78 return ar;
79}
80
81char const* const* SunInfo::getLibraryPaths(int* size)
82{
39{
40 return new SunInfo;
41}
42
43char const* const* SunInfo::getJavaExePaths(int * size)
44{
45 static char const * ar[] = {
46#if defined(WNT) || defined(OS2)

--- 27 unchanged lines hidden (view full) ---

74
75 };
76 *size = sizeof(ar) / sizeof (char*);
77 return ar;
78}
79
80char const* const* SunInfo::getLibraryPaths(int* size)
81{
83#ifdef UNX
82#ifdef UNX
84 static char const * ar[] = {
85
86 "/lib/" JFW_PLUGIN_ARCH "/client",
87 "/lib/" JFW_PLUGIN_ARCH "/native_threads",
88 "/lib/" JFW_PLUGIN_ARCH
89
90 };
91 *size = sizeof(ar) / sizeof (char*);
92 return ar;
93#else
94 size = 0;
95 return NULL;
96#endif
97}
98
99int SunInfo::compareVersions(const rtl::OUString& sSecond) const
100{
83 static char const * ar[] = {
84
85 "/lib/" JFW_PLUGIN_ARCH "/client",
86 "/lib/" JFW_PLUGIN_ARCH "/native_threads",
87 "/lib/" JFW_PLUGIN_ARCH
88
89 };
90 *size = sizeof(ar) / sizeof (char*);
91 return ar;
92#else
93 size = 0;
94 return NULL;
95#endif
96}
97
98int SunInfo::compareVersions(const rtl::OUString& sSecond) const
99{
101 OUString sFirst = getVersion();
102
100 rtl::OUString sFirst = getVersion();
101
103 SunVersion version1(sFirst);
104 JFW_ENSURE(version1, OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION
105 " does not know the version: ")
102 SunVersion version1(sFirst);
103 JFW_ENSURE(version1, OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION
104 " does not know the version: ")
106 + sFirst + OUSTR(" as valid for a SUN JRE."));
105 + sFirst + OUSTR(" as valid for a SUN/Oracle JRE."));
107 SunVersion version2(sSecond);
108 if ( ! version2)
109 throw MalformedVersionException();
110
111 if(version1 == version2)
112 return 0;
113 if(version1 > version2)
114 return 1;
115 else
116 return -1;
117}
118
119
120}
106 SunVersion version2(sSecond);
107 if ( ! version2)
108 throw MalformedVersionException();
109
110 if(version1 == version2)
111 return 0;
112 if(version1 > version2)
113 return 1;
114 else
115 return -1;
116}
117
118
119}