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

Unified Diff: src/plugin/PluginUtil.h

Issue 5733210436665344: Issue #1234 - Remove local CString variable from TraverseDocument() (Closed)
Patch Set: Created Oct. 9, 2015, 3:48 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/PluginDomTraverserBase.h ('k') | test/plugin/UtilTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginUtil.h
===================================================================
--- a/src/plugin/PluginUtil.h
+++ b/src/plugin/PluginUtil.h
@@ -17,6 +17,7 @@
#pragma once
#include <string>
+#include <ExDisp.h>
std::wstring HtmlFolderPath();
std::wstring UserSettingsFileUrl();
@@ -24,11 +25,16 @@
std::wstring FileUrl(const std::wstring& url);
std::wstring GetLocationUrl(IWebBrowser2& browser);
+template<class CharT, class Traits, class Alloc, size_t N>
+bool BeginsWith(const std::basic_string<CharT, Traits, Alloc>& s, const CharT(&beginning)[N])
+{
+ return 0 == s.compare(0, N - 1, beginning);
Oleksandr 2015/10/16 08:03:03 Nit: We try not to use yoda conditions.
+}
+
/**
* Wrapper around Microsoft API 'UrlUnescape'
*
- * This function has modify-in-place semantics.
- * This behavior matches that of the legacy version of this function declared above.
+ * This function has modify-in-place behavior, which matches that of its legacy version.
* At present, callers of this function have no code to handle error conditions that might arise here.
* Because there's no error handling, therefore, this masks failures in UrlUnescape.
*/
« no previous file with comments | « src/plugin/PluginDomTraverserBase.h ('k') | test/plugin/UtilTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld