-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathStringify.h
More file actions
32 lines (26 loc) · 816 Bytes
/
Stringify.h
File metadata and controls
32 lines (26 loc) · 816 Bytes
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
//==============================================================================
/*
Utility class for converting to and from strings
3/18/2014
SDLTutorials.com
Tim Jones
*/
//==============================================================================
#ifndef _STRINGIFY_H_
#define _STRINGIFY_H_
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
class Stringify {
public:
static std::string Int(int x);
static std::string Char(char* x);
static std::string Float(float x);
static std::string Double(double x);
static int ToInt(const std::string& String);
static float ToFloat(const std::string& String);
static double ToDouble(const std::string& String);
static std::vector<std::string> Explode(std::string str, const std::string& separator);
};
#endif