hydrobricks
Loading...
Searching...
No Matches
Utils.h
1#ifndef HYDROBRICKS_UTILS_H
2#define HYDROBRICKS_UTILS_H
3
4#include <chrono>
5
6#include "Includes.h"
7
11[[nodiscard]] bool InitHydrobricks();
12
16[[nodiscard]] bool InitHydrobricksForPython();
17
23string GetUserDirPath();
24
30[[nodiscard]] bool CheckOutputDirectory(const string& path);
31
37void DisplayProcessingTime(std::chrono::steady_clock::time_point startTime);
38
44void InitLog(const string& path);
45
51string LogFilePath(const string& directory);
52
56void LogVersion();
57
61void CloseLog();
62
66void SetMaxLogLevel();
67
71void SetDebugLogLevel();
72
76void SetMessageLogLevel();
77
87bool IsNaN(int value);
88
95bool IsNaN(float value);
96
103bool IsNaN(double value);
104
110const char* GetPathSeparator();
111
123bool StringsMatch(const string& str1, const string& str2);
124
135int Find(const int* start, const int* end, int value, int tolerance = 0, bool showWarning = true);
136
147int Find(const float* start, const float* end, float value, float tolerance = 0.0, bool showWarning = true);
148
159int Find(const double* start, const double* end, double value, double tolerance = 0.0, bool showWarning = true);
160
171template <std::totally_ordered T>
172int FindT(const T* start, const T* end, T value, T tolerance = 0, bool showWarning = true);
173
182double IncrementDateBy(double date, int amount, TimeUnit unit);
183
190Time GetTimeStructFromMJD(double mjd);
191
199double ParseDate(const string& dateStr, TimeFormat format);
200
212double GetMJD(int year, int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0);
213
214#endif // HYDROBRICKS_UTILS_H
Definition Includes.h:48