Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
stringhelper.h
Go to the documentation of this file.
1/*
2 * stringhelper.h
3 *
4 * Copyright 2011-2020 Mj Mendoza IV <mj.mendoza.iv@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 *
21 *
22 */
23
24#ifndef UTIL_STRING_HELPER_H
25 #define UTIL_STRING_HELPER_H
26
27 #include <string>
28 #include <sstream>
29 #include <vector>
30 #include <algorithm>
31 #include <cstring>
32 using namespace std;
33
35 public:
36 static string toUpper(string p_str);
37 static string toLower(string p_str);
38 static string integerToString(int p_src);
39 static string unsignedIntegerToString(unsigned int p_src);
40 static string doubleToString(double p_src);
41 static int toInteger(string p_str);
42 static unsigned int toUnsignedInteger(string p_str);
43 static long toLong(string p_str);
44 static double toDouble(string p_str);
45 static bool toBoolean(string p_str);
46 static vector<string> split(const string &p_source, const string &p_delimiter);
47 static string trim(string p_source);
48 static string kHash(string par, int p_len = 8);
49 };
50
51#endif //UTIL_STRING_HELPER_H
Definition: stringhelper.h:34
static int toInteger(string p_str)
Definition: stringhelper.cpp:74
static long toLong(string p_str)
Definition: stringhelper.cpp:84
static double toDouble(string p_str)
Definition: stringhelper.cpp:89
static string integerToString(int p_src)
Definition: stringhelper.cpp:44
static string kHash(string par, int p_len=8)
Definition: stringhelper.cpp:154
static string toUpper(string p_str)
Definition: stringhelper.cpp:26
static bool toBoolean(string p_str)
Definition: stringhelper.cpp:94
static vector< string > split(const string &p_source, const string &p_delimiter)
Definition: stringhelper.cpp:102
static string doubleToString(double p_src)
Definition: stringhelper.cpp:64
static string toLower(string p_str)
Definition: stringhelper.cpp:36
static string unsignedIntegerToString(unsigned int p_src)
Definition: stringhelper.cpp:54
static unsigned int toUnsignedInteger(string p_str)
Definition: stringhelper.cpp:79
static string trim(string p_source)
Definition: stringhelper.cpp:123