-
Notifications
You must be signed in to change notification settings - Fork 0
/
Utils.h
23 lines (22 loc) · 876 Bytes
/
Utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef SDDS_UTILS_H
#define SDDS_UTILS_H
#include <cstring>
namespace sdds {
const int sdds_testYear = 2023;
const int sdds_testMon = 12;
const int sdds_testDay = 9;
class Utils {
bool m_testMode = false;
public:
void getSystemDate(int* year = nullptr, int* mon = nullptr, int* day = nullptr);
int daysOfMon(int mon, int year)const;
void testMode(bool testmode = true);
void alocpy(char*& destination, const char* source);
int getint(const char* prompt = nullptr);
int getint(int min, int max, const char* prompt = nullptr, const char* errMes = nullptr);
double getdouble(const char* prompt = nullptr);
double getdouble(double min, double max, const char* prompt = nullptr, const char* errMes = nullptr);
};
extern Utils ut;
}
#endif // !SDDS_UTILS_H