diff options
author | Mattes D <github@xoft.cz> | 2015-01-24 15:59:06 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-01-27 14:53:29 +0100 |
commit | f1f12495b2fe33e6ae424e1654a66e220162e926 (patch) | |
tree | f6213441ed9cc6f807158a0d2942f3eb4ca86ba8 /src/OSSupport/File.cpp | |
parent | StringUtils: Fixed bad predicate in MergeStringVectors(). (diff) | |
download | cuberite-f1f12495b2fe33e6ae424e1654a66e220162e926.tar cuberite-f1f12495b2fe33e6ae424e1654a66e220162e926.tar.gz cuberite-f1f12495b2fe33e6ae424e1654a66e220162e926.tar.bz2 cuberite-f1f12495b2fe33e6ae424e1654a66e220162e926.tar.lz cuberite-f1f12495b2fe33e6ae424e1654a66e220162e926.tar.xz cuberite-f1f12495b2fe33e6ae424e1654a66e220162e926.tar.zst cuberite-f1f12495b2fe33e6ae424e1654a66e220162e926.zip |
Diffstat (limited to '')
-rw-r--r-- | src/OSSupport/File.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp index 8957dfaef..1ee9feafe 100644 --- a/src/OSSupport/File.cpp +++ b/src/OSSupport/File.cpp @@ -453,6 +453,29 @@ AString cFile::ReadWholeFile(const AString & a_FileName) +AString cFile::ReplaceFileNameInvalidChars(const AString & a_FileName, char a_Replacement) +{ + AString res(a_FileName); + for (auto & ch: res) + { + switch (ch) + { + case ':': + case '\\': + case '/': + { + ch = a_Replacement; + break; + } + } + } + return res; +} + + + + + int cFile::Printf(const char * a_Fmt, ...) { AString buf; |