-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.h
48 lines (38 loc) · 1.04 KB
/
global.h
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
#pragma once
#include <string>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <sstream>
#include <functional>
#include <string>
#include <cmath>
#include <Windows.h>
namespace YGO
{
using t_string = std::string;
inline void panic(const t_string& msg, int code = 1) {
std::cout << msg << std::endl;
system("pause");
exit(code);
}
bool wildCardMatch(const t_string& s, const t_string& p);
std::vector<std::string> split(std::string s, std::string delimiter);
void ltrim(std::string& s);
void rtrim(std::string& s);
void trim(std::string& s);
void remove_space(std::stringstream& ss);
std::string read_while(std::stringstream& s, std::function<bool(char c)> pred);
int random_int(int low, int high);
double compute_ci(double p, int n);
double compute_mean(const std::vector<double> data);
double compute_std(const std::vector<double> data);
std::string utf8_to_local_encoding(const std::string& utf8String);
class UTF8CodePage {
public:
UTF8CodePage();
~UTF8CodePage();
private:
UINT m_old_code_page;
};
}