-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
ConvenientParser.cpp
37 lines (32 loc) · 1.13 KB
/
ConvenientParser.cpp
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
#include "ConvenientParser.h"
#include "ParserHelpers.h"
void commonItems::convenientParser::registerSetter(const std::string& keyword, std::string& targetString)
{
registerKeyword(keyword, [&targetString](std::istream& theStream) {
targetString = getString(theStream);
});
}
void commonItems::convenientParser::registerSetter(const std::string& keyword, int& targetInt)
{
registerKeyword(keyword, [&targetInt](std::istream& theStream) {
targetInt = getInt(theStream);
});
}
void commonItems::convenientParser::registerSetter(const std::string& keyword, double& targetDouble)
{
registerKeyword(keyword, [&targetDouble](std::istream& theStream) {
targetDouble = getDouble(theStream);
});
}
void commonItems::convenientParser::registerSetter(const std::string& keyword, long long int& targetLlong)
{
registerKeyword(keyword, [&targetLlong](std::istream& theStream) {
targetLlong = getLlong(theStream);
});
}
void commonItems::convenientParser::registerSetter(const std::string& keyword, unsigned long long int& targetULlong)
{
registerKeyword(keyword, [&targetULlong](std::istream& theStream) {
targetULlong = getULlong(theStream);
});
}