diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-15 12:40:27 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-15 12:40:27 +0300 |
commit | 939a842bc8af062686870e7362ca1e82b064edfa (patch) | |
tree | 92777712071b4eff53f227c705c392513b345af4 /plugins/CurrencyRates/src/CreateFilePath.cpp | |
parent | d061852f027e57625d7bdfd445469d9a29b1eb07 (diff) |
the less boost the better
Diffstat (limited to 'plugins/CurrencyRates/src/CreateFilePath.cpp')
-rw-r--r-- | plugins/CurrencyRates/src/CreateFilePath.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/plugins/CurrencyRates/src/CreateFilePath.cpp b/plugins/CurrencyRates/src/CreateFilePath.cpp index 18a8896e9d..71490432a9 100644 --- a/plugins/CurrencyRates/src/CreateFilePath.cpp +++ b/plugins/CurrencyRates/src/CreateFilePath.cpp @@ -1,22 +1,6 @@ #include "StdAfx.h" -static wchar_t InvalidSymbols[] = { '\\', '/', ':', '*', '?', '"', '<', '>', '|' }; - -static wchar_t replace_invalid_symbol(wchar_t chr) -{ - for (int i = 0; i < _countof(InvalidSymbols); ++i) - if (chr == InvalidSymbols[i]) - return '_'; - - return chr; -} - -void prepare_name(tstring& rsName) -{ - std::transform(rsName.begin(), rsName.end(), rsName.begin(), boost::bind(replace_invalid_symbol, _1)); -} - -tstring CreateFilePath(const tstring& rsName) +tstring CreateFilePath(const tstring &rsName) { wchar_t szPath[_MAX_PATH]; ::GetModuleFileName(g_plugin.getInst(), szPath, _MAX_PATH); @@ -26,7 +10,7 @@ tstring CreateFilePath(const tstring& rsName) *p = 0; tstring s(rsName); - prepare_name(s); + FixInvalidChars(s); tostringstream o; o << szPath << L"\\CurrencyRates\\" << s; return o.str(); |