summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools.cpp9
-rw-r--r--tools.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/tools.cpp b/tools.cpp
index 515418a..de0b43c 100644
--- a/tools.cpp
+++ b/tools.cpp
@@ -62,4 +62,13 @@ int StringToInt( std::string const& string, int base )
return 0;
}
+string StringRepeat(int times, const string& input)
+{
+ string result;
+ for (int i = 0; i < times; i++) {
+ result += input;
+ }
+ return result;
+}
+
} // namespace vdrlive
diff --git a/tools.h b/tools.h
index 7db052e..d830d47 100644
--- a/tools.h
+++ b/tools.h
@@ -14,6 +14,7 @@ std::string FormatDateTime( char const* format, time_t time );
std::string StringReplace( std::string const& text, std::string const& substring, std::string const& replacement );
std::vector< std::string > StringSplit( std::string const& text, char delimiter );
int StringToInt( std::string const& string, int base = 10 );
+std::string StringRepeat(int times, const std::string& input);
struct bad_lexical_cast: std::runtime_error
{