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