-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUtils.h
57 lines (36 loc) · 1.16 KB
/
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
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
#pragma once
#include <vector>
#include <string>
#include "xmath.h"
namespace Utils
{
std::vector<std::string> split(std::string str, std::string separator);
Texture* loadImage(std::string path);
Texture* getFolderIcon();
std::string showFileDialog();
std::string showSaveFileDialog();
bool isNumber(const std::string& s);
std::string getFileName(const std::string& path);
std::string getFolderPath(const std::string& path);
std::string getSystemSeparator();
void copyFile(std::string from, std::string to);
std::string fixSeparator(std::string path);
bool isRelativePath(std::string path);
template<typename T>
T getValueFromString(std::string value)
{
return 0;
}
template<>
float getValueFromString(std::string value);
template<>
Vec2 getValueFromString(std::string value);
template<>
Vec3 getValueFromString(std::string value);
template<>
Vec4 getValueFromString(std::string value);
std::string valueToString(float value);
std::string valueToString(Vec2 value);
std::string valueToString(Vec3 value);
std::string valueToString(Vec4 value);
}