OLD | NEW |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 #include <algorithm> | 2 #include <algorithm> |
3 #include <stdexcept> | 3 #include <stdexcept> |
4 #include <vector> | 4 #include <vector> |
5 | 5 |
6 #include "../shared/Utils.h" | 6 #include "../shared/Utils.h" |
7 #include "PluginUtil.h" | 7 #include "PluginUtil.h" |
8 #include "PluginSettings.h" | 8 #include "PluginSettings.h" |
9 | 9 |
10 BString::BString(const std::wstring& value) | 10 BString::BString(const std::wstring& value) |
(...skipping 26 matching lines...) Expand all Loading... |
37 return FileUrl(HtmlFolderPath() + L"firstRun.html"); | 37 return FileUrl(HtmlFolderPath() + L"firstRun.html"); |
38 } | 38 } |
39 | 39 |
40 std::wstring FileUrl(const std::wstring& path) | 40 std::wstring FileUrl(const std::wstring& path) |
41 { | 41 { |
42 std::wstring url = path; | 42 std::wstring url = path; |
43 std::replace(url.begin(), url.end(), L'\\', L'/'); | 43 std::replace(url.begin(), url.end(), L'\\', L'/'); |
44 return L"file:///" + url; | 44 return L"file:///" + url; |
45 } | 45 } |
46 | 46 |
| 47 CString ExtractDomain(const CString& url) |
| 48 { |
| 49 int pos = 0; |
| 50 if (url.Find('/', pos) >= 0) |
| 51 url.Tokenize(L"/", pos); |
| 52 CString domain = url.Tokenize(L"/", pos); |
| 53 domain.MakeLower(); |
| 54 return domain; |
| 55 } |
| 56 |
| 57 void ReplaceString(std::wstring& input, const std::wstring placeholder, const st
d::wstring replacement) |
| 58 { |
| 59 size_t replaceStart = input.find(placeholder); |
| 60 if (replaceStart != std::string::npos) |
| 61 { |
| 62 input.replace(replaceStart, placeholder.length(), replacement); |
| 63 } |
| 64 } |
OLD | NEW |