OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 if (!SHGetSpecialFolderPathW(0, pathBuffer.get(), CSIDL_LOCAL_APPDATA, tru
e)) | 138 if (!SHGetSpecialFolderPathW(0, pathBuffer.get(), CSIDL_LOCAL_APPDATA, tru
e)) |
139 throw std::runtime_error("Unable to find app data directory"); | 139 throw std::runtime_error("Unable to find app data directory"); |
140 appDataPath.assign(pathBuffer.get()); | 140 appDataPath.assign(pathBuffer.get()); |
141 } | 141 } |
142 appDataPath += L"\\Adblock Plus for IE"; | 142 appDataPath += L"\\Adblock Plus for IE"; |
143 | 143 |
144 // Ignore errors here, this isn't a critical operation | 144 // Ignore errors here, this isn't a critical operation |
145 ::CreateDirectoryW(appDataPath.c_str(), NULL); | 145 ::CreateDirectoryW(appDataPath.c_str(), NULL); |
146 } | 146 } |
147 return appDataPath; | 147 return appDataPath; |
148 } | 148 } |
149 | |
150 void ReplaceString(std::wstring& input, const std::wstring placeholder, const st
d::wstring replacement) | |
151 { | |
152 size_t replaceStart = input.find(placeholder); | |
153 if (replaceStart != std::string::npos) | |
154 { | |
155 input.replace(replaceStart, placeholder.length(), replacement); | |
156 } | |
157 } | |
OLD | NEW |