Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginUtil.cpp

Issue 11292028: Status bar menu added (Closed)
Patch Set: Comments addressed Created Aug. 5, 2013, 1:13 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/PluginUtil.h ('k') | src/plugin/Resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/plugin/PluginUtil.h ('k') | src/plugin/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld