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

Unified Diff: src/plugin/PluginUtil.cpp

Issue 11292028: Status bar menu added (Closed)
Patch Set: Comments addressed Created Aug. 5, 2013, 1:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/plugin/PluginUtil.h ('k') | src/plugin/Resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginUtil.cpp
===================================================================
--- a/src/plugin/PluginUtil.cpp
+++ b/src/plugin/PluginUtil.cpp
@@ -44,3 +44,21 @@
return L"file:///" + url;
}
+CString ExtractDomain(const CString& url)
+{
+ int pos = 0;
+ if (url.Find('/', pos) >= 0)
+ url.Tokenize(L"/", pos);
+ CString domain = url.Tokenize(L"/", pos);
+ domain.MakeLower();
+ return domain;
+}
+
+void ReplaceString(std::wstring& input, const std::wstring placeholder, const std::wstring replacement)
+{
+ size_t replaceStart = input.find(placeholder);
+ if (replaceStart != std::string::npos)
+ {
+ input.replace(replaceStart, placeholder.length(), replacement);
+ }
+}
« 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