Repository navigation
Expand file tree
/
Copy pathdebug.hpp
More file actions
65 lines (48 loc) · 1.98 KB
/
Copy pathdebug.hpp
File metadata and controls
65 lines (48 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef DEBUG_CORE_H
#define DEBUG_CORE_H
#include "math.hpp"
#include <iostream>
#include <chrono>
inline std::string _to_string(std::string v) {return v;}
inline std::string _to_string(char v) {return std::string(1, v);}
inline std::string _to_string(char* v) {return v;}
inline std::string _to_string(const char* v) {return v;}
inline std::string _to_string(short v) {return std::to_string(v);}
inline std::string _to_string(int v) {return std::to_string(v);}
inline std::string _to_string(long int v) {return std::to_string(v);}
inline std::string _to_string(long long int v) {return std::to_string(v);}
inline std::string _to_string(unsigned char v) {return std::to_string(v);}
inline std::string _to_string(unsigned short v) {return std::to_string(v);}
inline std::string _to_string(unsigned int v) {return std::to_string(v);}
inline std::string _to_string(unsigned long int v) {return std::to_string(v);}
inline std::string _to_string(unsigned long long int v) {return std::to_string(v);}
inline std::string _to_string(float v) {return std::to_string(v);}
inline std::string _to_string(double v) {return std::to_string(v);}
inline std::string _to_string(bool v) {return std::to_string(v);}
template<typename T>
inline std::string _to_string(Vec2<T> v) {return v.to_string();}
template<typename T>
inline std::string _to_string(Vec3<T> v) {return v.to_string();}
template<typename T>
inline std::string _to_string(Vec4<T> v) {return v.to_string();}
template<typename T>
inline std::string _to_string(T o) {return o.to_string();}
inline void print() {}
template<typename T>
void print(T t) {
std::cout << _to_string(t);
}
template<typename T, typename... A>
void print(T t, A... a) {
print(t);
std::cout << " ";
print(a...);
}
template<typename... A>
inline void log(A... a) {
std::time_t t = std::time(0);
std::tm* now = std::localtime(&t);
std::cout << now->tm_hour << ":" << now->tm_min << ":" << now->tm_sec << " - ";
print(a..., "\n");
}
#endif // DEBUG_CORE_H