source: main/trunk/search4j/libsearch4j.h

Last change on this file was 35699, checked in by davidb, 3 years ago

dirname() wasn't part of VS, so adding in our own get_dirname()

File size: 1.3 KB
Line 
1#include <cstdlib>
2#include <cstring>
3#include <iostream>
4#include <fstream>
5#include <string>
6#include <sstream>
7#include <sys/stat.h>
8
9using namespace std;
10#ifdef WINDOWS
11#include <windows.h>
12#endif
13
14
15void replace_all( std::string & str, std::string const & pattern, std::string const & replacement );
16int process( string command, bool render );
17int process_and_catch_output( string command, string &output );
18#ifdef WINDOWS
19int regSearch(HKEY hKey, const char* keyName, int searchType, char* foundJavaVer );
20#endif
21
22
23class Jvm {
24
25 // version string. era.major.minor_update. eg: 1.4.2_02
26 int era_;
27 int major_;
28 int minor_;
29 int update_;
30
31 string javaHome_;
32 bool isJdk_;
33 bool healthy_;
34
35 public:
36 Jvm();
37 ~Jvm();
38
39 void setJavaHome( string jh );
40 string getJavaHome();
41 string getExecutable();
42 #ifdef WINDOWS
43 string getWinExecutable();
44 #endif
45 string getVersion();
46 bool check();
47 bool setVersionFromString( string version );
48 int compare( Jvm otherJvm );
49 int getEra();
50 int getMajor();
51 int getMinor();
52 int getUpdate();
53
54 bool getIsJre();
55 bool getIsJdk();
56
57 private:
58 void setVersionFromExeOuput();
59 void setIsJdkFromJavacPresence();
60
61};
62
63
64
65bool find( Jvm &jvm, bool use_minimum, const Jvm& minimum, bool jreOnly, bool jdeOnly, string phint, string hint, bool verbose );
Note: See TracBrowser for help on using the repository browser.