platformAPI.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <vector>
5
7
8namespace by {
9 enum consoleColor {
10 CONSOLE_COLOR_START = 0,
11 BLACK = CONSOLE_COLOR_START,
12 BLUE,
13 GREEN,
14 CYAN,
15 RED,
16 MAGENTA,
17 BROWN,
18 LIGHTGRAY,
19 DARKGRAY,
20 LIGHTBLUE,
21 LIGHTGREEN,
22 LIGHTCYAN,
23 LIGHTRED,
24 LIGHTMAGENTA,
25 YELLOW,
26 CONSOLE_COLOR_END,
27 WHITE = CONSOLE_COLOR_END
28 };
29
30 namespace platformAPI {
31 const _nout std::string& foreColor(consoleColor fore);
32 const _nout std::string& backColor(consoleColor back);
33 _nout std::string createNowTime(const std::string& strftime_format);
34 _nout std::vector<std::string> callstack();
35 _nout std::string demangle(const nchar* org);
36 _nout std::string filterDemangle(const nchar* org);
37 _nout std::string getExecPath();
38 _nout std::string exec(const std::string& cmd);
39 _nout nuint64 getNowMs();
40 _nout std::string toAddrId(const void* inst);
41 _nout void log(const std::string& msg);
42 _nout void log(const std::string* it);
43 _nout std::string format(const nchar* fmt, ...);
44 _nout std::string format(const nchar* fmt, va_list args);
45 _nout std::string format(const std::string& fmt, va_list args);
46 _nout std::string format(const std::string* fmt, va_list args);
47 _nout void crash(const nchar* msg, ...);
48 _nout void crash(const std::string& msg, va_list args);
49 _nout void crash(const std::string* msg, va_list args);
50 _nout void crash(const std::string& msg);
51 _nout void crash(const std::string* msg);
52 };
53} // namespace by