Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorv0lt <v0lt@rambler.ru>2013-03-16 15:25:24 +0400
committerv0lt <v0lt@rambler.ru>2013-03-16 15:27:44 +0400
commitda59b57a76da243275345bc5e6045382e13102e8 (patch)
treee5e95a32969e73b1b29d3cfa69af586be5a7c9bc /src/DSUtil/text.cpp
parent4f5ed9d0b4351d7452b9e880d82e03c167e6c8b7 (diff)
Move code of shaders from registry and ini to separate files in folder.
Diffstat (limited to 'src/DSUtil/text.cpp')
-rw-r--r--src/DSUtil/text.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/DSUtil/text.cpp b/src/DSUtil/text.cpp
index f4226ac1a..8d1a3b2b9 100644
--- a/src/DSUtil/text.cpp
+++ b/src/DSUtil/text.cpp
@@ -219,3 +219,38 @@ CString FormatNumber(CString szNumber, bool bNoFractionalDigits /*= true*/)
return ret;
}
+
+void FixFilename(CString& str)
+{
+ str.Trim();
+
+ for (int i = 0, l = str.GetLength(); i < l; i++) {
+ switch (str[i]) {
+ case '?':
+ case '"':
+ case '/':
+ case '\\':
+ case '<':
+ case '>':
+ case '*':
+ case '|':
+ case ':':
+ str.SetAt(i, '_');
+ }
+ }
+
+ CString tmp;
+ if (str.GetLength() == 3 || str.Find('.') == 3) {
+ tmp = str.Left(3).MakeUpper();
+ if (tmp == _T("CON") || tmp == _T("AUX") || tmp == _T("PRN") || tmp == _T("NUL")) {
+ str = _T("___") + str.Mid(3);
+ }
+ }
+ if (str.GetLength() == 4 || str.Find('.') == 4) {
+ tmp = str.Left(4).MakeUpper();
+ if (tmp == _T("COM1") || tmp == _T("COM2") || tmp == _T("COM3") || tmp == _T("COM4") ||
+ tmp == _T("LPT1") || tmp == _T("LPT2") || tmp == _T("LPT3")) {
+ str = _T("____") + str.Mid(4);
+ }
+ }
+}