-
Notifications
You must be signed in to change notification settings - Fork 30
/
stringfunc.h
42 lines (31 loc) · 1.42 KB
/
stringfunc.h
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
38
39
40
41
42
#ifndef _STRINGFUNC_H_
#define _STRINGFUNC_H_
#include "color.h"
#include <string>
#include <vector>
#include <istream>
#define STD_DELIM "</>"
std::vector<std::string> break_into_lines(const std::string& text,
int linesize);
std::vector<std::string> split_string(const std::string& text, char split,
bool keep_split);
std::vector<std::string> split_string(const std::string& text,
const std::string& split,
bool keep_split);
std::string load_to_delim(std::istream &datastream, std::string delim);
std::string load_to_character(std::istream &datastream, char ch,
bool _trim = false);
std::string load_to_character(std::istream &datastream, std::string chars,
bool _trim = false);
std::string slurp_file(const std::string &filename);
std::string trim (const std::string &orig);
std::string all_caps (const std::string &orig);
std::string no_caps (const std::string &orig);
std::string capitalize (const std::string &orig);
std::string remove_color_tags(const std::string &orig);
// Convert an int to a string
std::string itos(int num);
std::string color_gradient(int value, std::vector<int> breakpoints,
std::vector<nc_color> colors);
bool is_vowel(char ch);
#endif