source: main/trunk/search4j/libsearch4j.h@ 37137

Last change on this file since 37137 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
RevLine 
[18596]1#include <cstdlib>
2#include <cstring>
[35420]3#include <iostream>
4#include <fstream>
[15893]5#include <string>
6#include <sstream>
[18237]7#include <sys/stat.h>
[35698]8
[15893]9using namespace std;
[35420]10#ifdef WINDOWS
11#include <windows.h>
12#endif
[15893]13
14
[35420]15void replace_all( std::string & str, std::string const & pattern, std::string const & replacement );
[15893]16int process( string command, bool render );
17int process_and_catch_output( string command, string &output );
[35420]18#ifdef WINDOWS
19int regSearch(HKEY hKey, const char* keyName, int searchType, char* foundJavaVer );
20#endif
[15893]21
22
23class Jvm {
24
[35420]25 // version string. era.major.minor_update. eg: 1.4.2_02
26 int era_;
27 int major_;
28 int minor_;
29 int update_;
[15893]30
[35420]31 string javaHome_;
32 bool isJdk_;
33 bool healthy_;
[15893]34
35 public:
36 Jvm();
[20709]37 ~Jvm();
38
[15893]39 void setJavaHome( string jh );
[35420]40 string getJavaHome();
[15893]41 string getExecutable();
[35420]42 #ifdef WINDOWS
43 string getWinExecutable();
44 #endif
[15893]45 string getVersion();
[35420]46 bool check();
[15893]47 bool setVersionFromString( string version );
48 int compare( Jvm otherJvm );
[35420]49 int getEra();
50 int getMajor();
51 int getMinor();
[15893]52 int getUpdate();
53
[18237]54 bool getIsJre();
55 bool getIsJdk();
56
[35420]57 private:
[18237]58 void setVersionFromExeOuput();
[35420]59 void setIsJdkFromJavacPresence();
[15893]60
61};
62
63
[35420]64
[20709]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.