Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
TextUtilities.hpp
1#pragma once
2#include "Common.hpp"
3
9
10public:
16 static std::string trim(const std::string & str, const std::string & del);
17
22 static std::string splitExtension(std::string & str);
23
28 static std::string extractFilename(const std::string & str);
29
35 static void replace(std::string & source, const std::string & fromString, const std::string & toString);
36
42 static void replace(std::string & source, const std::string & fromChars, const char toChar);
43
49 static bool hasPrefix(const std::string & source, const std::string & prefix);
50
56 static bool hasSuffix(const std::string & source, const std::string & suffix);
57
63 static std::string join(const std::vector<std::string> & tokens, const std::string & delimiter);
64
71 static std::vector<std::string> split(const std::string & str, const std::string & delimiter, bool skipEmpty);
72
78 static std::vector<std::string> splitLines(const std::string & str, bool skipEmpty);
79
85 static std::string padInt(uint number, uint padding);
86
91 static std::string lowercase(const std::string & src);
92
97 static std::string uppercase(const std::string & src);
98
99};
Provides utilities process strings.
Definition: TextUtilities.hpp:8
static bool hasPrefix(const std::string &source, const std::string &prefix)
Definition: TextUtilities.cpp:48
static std::string splitExtension(std::string &str)
Definition: TextUtilities.cpp:12
static std::vector< std::string > splitLines(const std::string &str, bool skipEmpty)
Definition: TextUtilities.cpp:102
static std::string uppercase(const std::string &src)
Definition: TextUtilities.cpp:131
static std::string trim(const std::string &str, const std::string &del)
Definition: TextUtilities.cpp:3
static std::string extractFilename(const std::string &str)
Definition: TextUtilities.cpp:22
static std::string padInt(uint number, uint padding)
Definition: TextUtilities.cpp:116
static void replace(std::string &source, const std::string &fromString, const std::string &toString)
Definition: TextUtilities.cpp:30
static std::vector< std::string > split(const std::string &str, const std::string &delimiter, bool skipEmpty)
Definition: TextUtilities.cpp:81
static bool hasSuffix(const std::string &source, const std::string &suffix)
Definition: TextUtilities.cpp:59
static std::string lowercase(const std::string &src)
Definition: TextUtilities.cpp:122
static std::string join(const std::vector< std::string > &tokens, const std::string &delimiter)
Definition: TextUtilities.cpp:70