summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-01-07 23:25:01 +0000
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-01-07 23:25:01 +0000
commit9b0557c2c31dbc95b040ac79b17804f6da6c5dcb (patch)
tree678297c499e561749d99ab9df604b12cbd69701b
parent6fb75d00de6328f14fa5072ece4f36a6f8e7830c (diff)
downloadvdr-plugin-live-9b0557c2c31dbc95b040ac79b17804f6da6c5dcb.tar.gz
vdr-plugin-live-9b0557c2c31dbc95b040ac79b17804f6da6c5dcb.tar.bz2
added StringRepeat function to tools
-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
{