scsl 1.0.1
Shimmering Clarity Standard Library
Loading...
Searching...
No Matches
StringUtil.h
Go to the documentation of this file.
1
22
23
24#include <algorithm>
25#include <string>
26#include <vector>
27
28
29#ifndef STRINGUTIL_H
30#define STRINGUTIL_H
31
32
33namespace scsl {
34
36namespace scstring {
37
38
41void TrimLeadingWhitespace(std::string &s);
42
45void TrimTrailingWhitespace(std::string &s);
46
49void TrimWhitespace(std::string &s);
50
53std::string TrimLeadingWhitespaceDup(std::string s);
54
57std::string TrimTrailingWhitespaceDup(std::string s);
58
61std::string TrimWhitespaceDup(std::string s);
62
63
71std::vector<std::string> SplitKeyValuePair(std::string line, std::string delimiter);
72
80std::vector<std::string> SplitKeyValuePair(std::string line, char delimiter);
81
89std::vector<std::string> SplitN(std::string s, std::string delimiter, size_t maxCount=0);
90
94std::vector<std::string> WrapText(std::string& line, size_t lineLength);
95
102void WriteTabIndented(std::ostream &os, std::vector<std::string> lines,
103 int tabStop, bool indentFirst);
104
112void WriteTabIndented(std::ostream &os, std::string line, size_t maxLength,
113 int tabStop, bool indentFirst);
114
115
118std::ostream &VectorToString(std::ostream &os, const std::vector<std::string> &svec);
119
122std::string VectorToString(const std::vector<std::string> &svec);
123
124
125} // namespace string
126} // namespace scsl
127
128
129#endif // STRINGUTIL_H
130
131
std::string TrimLeadingWhitespaceDup(std::string s)
void TrimTrailingWhitespace(std::string &s)
std::string TrimTrailingWhitespaceDup(std::string s)
void TrimLeadingWhitespace(std::string &s)
void WriteTabIndented(std::ostream &os, std::vector< std::string > lines, int tabStop, bool indentFirst)
void TrimWhitespace(std::string &s)
std::vector< std::string > SplitKeyValuePair(std::string line, std::string delimiter)
std::vector< std::string > SplitN(std::string s, std::string delimiter, size_t maxCount=0)
std::vector< std::string > WrapText(std::string &line, size_t lineLength)
std::ostream & VectorToString(std::ostream &os, const std::vector< std::string > &svec)
std::string TrimWhitespaceDup(std::string s)
scsl is the top-level namespace containing all the code in this library.
Definition scsl.h:43