Code cleanup

This commit is contained in:
amazing-username
2018-02-26 22:01:00 -06:00
commit cec1e0bbb6
39 changed files with 3268 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
#ifndef CONVERSIONS_H_
#define CONVERSIONS_H_
#include<string>
#include<sstream>
using std::string;
using std::stringstream;
class Conversions
{
public:
Conversions() = default;
~Conversions()=default;
template<typename C=char,typename S=string>
S cstringToString(const C* tmp, const int size)
{
stringstream cToS{};
for (auto index=0; index!=size; ++index)
cToS<<tmp[index];
S tmpString{};
cToS>>tmpString;
return tmpString;
}
template<typename C=char,typename S=string>
C stringToChar(const S& tmp)
{
stringstream sToC{};
for (auto tmpElements:tmp)
sToC<<tmpElements;
char tmpChar{};
sToC>>tmpChar;
return tmpChar;
}
private:
};
#endif