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

Side by Side Diff: src/shared/Utils.cpp

Issue 4974480757620736: Issue #1356 - Improve detection of the issuer of the request (Closed)
Patch Set: Refactoring lambda and ExtractHttpHeaders functions. Coding style cleanup. Created Nov. 3, 2014, 11:36 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« src/shared/Utils.h ('K') | « src/shared/Utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <memory> 1 #include <memory>
2 #include <stdexcept> 2 #include <stdexcept>
3 #include <vector> 3 #include <vector>
4 4
5 #include <Windows.h> 5 #include <Windows.h>
6 #include <ShlObj.h> 6 #include <ShlObj.h>
7 7
8 #include "Utils.h" 8 #include "Utils.h"
9 9
10 namespace 10 namespace
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 } 123 }
124 124
125 void ReplaceString(std::wstring& input, const std::wstring placeholder, const st d::wstring replacement) 125 void ReplaceString(std::wstring& input, const std::wstring placeholder, const st d::wstring replacement)
126 { 126 {
127 size_t replaceStart = input.find(placeholder); 127 size_t replaceStart = input.find(placeholder);
128 if (replaceStart != std::string::npos) 128 if (replaceStart != std::string::npos)
129 { 129 {
130 input.replace(replaceStart, placeholder.length(), replacement); 130 input.replace(replaceStart, placeholder.length(), replacement);
131 } 131 }
132 } 132 }
133
134 template <>
135 std::string CreateConstString<std::string>(std::string val)
136 {
137 return val;
138 }
139
140 template <>
141 std::wstring CreateConstString<std::wstring>(std::string val)
142 {
143 return std::wstring(val.begin(), val.end());
144 }
OLDNEW
« src/shared/Utils.h ('K') | « src/shared/Utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld