/
TIVarTypes.h
40 lines (29 loc) · 971 Bytes
/
TIVarTypes.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
/*
* Part of tivars_lib_cpp
* (C) 2015 Adrien 'Adriweb' Bertrand
* https://github.com/adriweb/tivars_lib_cpp
* License: MIT
*/
#ifndef TIVARTYPES_H
#define TIVARTYPES_H
#include "autoloader.h"
#include "TIVarType.h"
#include "TypeHandlers/DummyHandler.h"
namespace tivars
{
extern std::unordered_map<std::string, TIVarType> types;
class TIVarTypes
{
public:
static void initTIVarTypesArray();
static bool isValidName(std::string name);
static bool isValidID(int id);
static std::vector<std::string> getExtensionsFromName(std::string name);
static std::vector<std::string> getExtensionsFromTypeID(int id);
static int getIDFromName(std::string name);
static std::string getNameFromID(int id);
private:
static void insertType(std::string name, int id, std::vector<std::string> exts, handler_pair_t handlers = make_handler_pair(DummyHandler));
};
}
#endif //TIVARTYPES_H