Last change
on this file since 18596 was 18596, checked in by oranfry, 15 years ago |
being more explicit about included libraries for te sake of newer linux distros
|
File size:
1.3 KB
|
Rev | Line | |
---|
[18596] | 1 | #include <cstdlib>
|
---|
| 2 | #include <cstring>
|
---|
[15893] | 3 | #include <iostream>
|
---|
| 4 | #include <fstream>
|
---|
| 5 | #include <string>
|
---|
| 6 | #include <sstream>
|
---|
[18237] | 7 | #include <sys/stat.h>
|
---|
[15893] | 8 | using namespace std;
|
---|
[15897] | 9 | #ifdef WINDOWS
|
---|
| 10 | #include <windows.h>
|
---|
| 11 | #endif
|
---|
[15893] | 12 |
|
---|
| 13 |
|
---|
| 14 | void replace_all( std::string & str, std::string const & pattern, std::string const & replacement );
|
---|
| 15 | int process( string command, bool render );
|
---|
| 16 | int process_and_catch_output( string command, string &output );
|
---|
| 17 | #ifdef WINDOWS
|
---|
| 18 | int regSearch(HKEY hKey, const char* keyName, int searchType, char* foundJavaVer );
|
---|
| 19 | #endif
|
---|
| 20 |
|
---|
| 21 |
|
---|
| 22 | class Jvm {
|
---|
| 23 |
|
---|
| 24 | // version string. era.major.minor_update. eg: 1.4.2_02
|
---|
| 25 | int era;
|
---|
| 26 | int major;
|
---|
| 27 | int minor;
|
---|
| 28 | int update;
|
---|
| 29 |
|
---|
| 30 | string javaHome;
|
---|
| 31 | bool isJdk;
|
---|
[18237] | 32 | bool healthy;
|
---|
[15893] | 33 |
|
---|
| 34 | public:
|
---|
| 35 | Jvm();
|
---|
| 36 | void setJavaHome( string jh );
|
---|
| 37 | string getJavaHome();
|
---|
| 38 | string getExecutable();
|
---|
| 39 | #ifdef WINDOWS
|
---|
| 40 | string getWinExecutable();
|
---|
| 41 | #endif
|
---|
| 42 | string getVersion();
|
---|
| 43 | bool check();
|
---|
| 44 | bool setVersionFromString( string version );
|
---|
| 45 | int compare( Jvm otherJvm );
|
---|
| 46 | int getEra();
|
---|
| 47 | int getMajor();
|
---|
| 48 | int getMinor();
|
---|
| 49 | int getUpdate();
|
---|
| 50 |
|
---|
[18237] | 51 | bool getIsJre();
|
---|
| 52 | bool getIsJdk();
|
---|
| 53 |
|
---|
[15893] | 54 | private:
|
---|
[18237] | 55 | void setVersionFromExeOuput();
|
---|
| 56 | void setIsJdkFromJavacPresence();
|
---|
[15893] | 57 |
|
---|
| 58 | };
|
---|
| 59 |
|
---|
| 60 |
|
---|
| 61 |
|
---|
[18237] | 62 | bool find( Jvm &jvm, bool use_minimum, Jvm minimum, bool jreOnly, bool jdeOnly, string phint, string hint, bool verbose );
|
---|
Note:
See
TracBrowser
for help on using the repository browser.