OLD | NEW |
1 #include <memory> | 1 #include <memory> |
2 #include <stdexcept> | 2 #include <stdexcept> |
3 #include <vector> | 3 #include <vector> |
4 | 4 |
5 #include <Windows.h> | 5 #include <Windows.h> |
6 #include <ShlObj.h> | 6 #include <ShlObj.h> |
7 | 7 |
8 #include "Utils.h" | 8 #include "Utils.h" |
9 | 9 |
10 namespace | 10 namespace |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 throw std::runtime_error("Unable to find app data directory"); | 103 throw std::runtime_error("Unable to find app data directory"); |
104 appDataPath.assign(pathBuffer.get()); | 104 appDataPath.assign(pathBuffer.get()); |
105 } | 105 } |
106 appDataPath += L"\\Adblock Plus for IE"; | 106 appDataPath += L"\\Adblock Plus for IE"; |
107 | 107 |
108 // Ignore errors here, this isn't a critical operation | 108 // Ignore errors here, this isn't a critical operation |
109 ::CreateDirectoryW(appDataPath.c_str(), NULL); | 109 ::CreateDirectoryW(appDataPath.c_str(), NULL); |
110 } | 110 } |
111 return appDataPath; | 111 return appDataPath; |
112 } | 112 } |
| 113 |
| 114 void ReplaceString(std::wstring& input, const std::wstring placeholder, const st
d::wstring replacement) |
| 115 { |
| 116 size_t replaceStart = input.find(placeholder); |
| 117 if (replaceStart != std::string::npos) |
| 118 { |
| 119 input.replace(replaceStart, placeholder.length(), replacement); |
| 120 } |
| 121 } |
OLD | NEW |