-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.cpp
More file actions
14 lines (11 loc) · 697 Bytes
/
string.cpp
File metadata and controls
14 lines (11 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "HeaderFiles/DataTypes.h"
// CONVERT TEMPLATE SECIALIZATION
template <> inline int convertDataType<int>(const std::string& str) { return std::stoi(str); }
template <> inline char convertDataType<char>(const std::string& str) { return str[0]; }
template <> inline bool convertDataType<bool>(const std::string& str) { return str == "true"; }
template <> inline float convertDataType<float>(const std::string& str){ return std::stof(str); }
template <> inline dbms::string convertDataType<dbms::string>(const std::string& str){ return dbms::string(str); }
std::ostream & operator << (std::ostream &out, const dbms::string &c){
out << c.str_;
return out;
}