LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Util.h
Go to the documentation of this file.
1 #ifndef __DBIUTIL_HPP_
2 #define __DBIUTIL_HPP_
3 
4 #include <string>
5 #include <ctime>
6 
7 namespace nutools {
8  namespace dbi {
9 
16  class Util
17  {
18  public:
19 
20  static bool CheckConnection(std::string dbname,
21  std::string server,
22  std::string user = "",
23  std::string port = "");
24  static std::string GetFarPastTimeAsString();
25  static std::string GetCurrentTimeAsString();
26  static std::string GetCurrentDateAsString();
27  static std::string GetFarFutureTimeAsString();
28  static bool TimeAsStringToTime_t(std::string ts, time_t& t);
29  static bool DateAsStringToTime_t(std::string date, time_t& t);
30  static bool RunningOnGrid();
31  };
32 
33  } // namespace dbi close
34 } // namespace nova close
35 
36 #endif
static bool RunningOnGrid()
Definition: Util.cpp:132
static std::string GetCurrentTimeAsString()
Definition: Util.cpp:42
Simple service to provide a RunHistory configured to the right run.
Definition: Column.cpp:14
static std::string GetFarFutureTimeAsString()
Definition: Util.cpp:75
static bool CheckConnection(std::string dbname, std::string server, std::string user="", std::string port="")
Definition: Util.cpp:13
static std::string GetFarPastTimeAsString()
Definition: Util.cpp:70
static bool TimeAsStringToTime_t(std::string ts, time_t &t)
Definition: Util.cpp:81
static bool DateAsStringToTime_t(std::string date, time_t &t)
Definition: Util.cpp:106
static std::string GetCurrentDateAsString()
Definition: Util.cpp:56