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

Side by Side Diff: src/Utils.h

Issue 29402569: Issue 5074 - fix tests for "is allowed connection" (Closed)
Patch Set: Created April 4, 2017, 10:51 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
« no previous file with comments | « no previous file | test/FilterEngine.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 30 matching lines...) Expand all
41 T trimmed(text); 41 T trimmed(text);
42 trimmed.erase(trimmed.begin(), std::find_if(trimmed.begin(), trimmed.end() , std::not1(std::ptr_fun<int, int>(std::isspace)))); 42 trimmed.erase(trimmed.begin(), std::find_if(trimmed.begin(), trimmed.end() , std::not1(std::ptr_fun<int, int>(std::isspace))));
43 trimmed.erase(std::find_if(trimmed.rbegin(), trimmed.rend(), std::not1(std ::ptr_fun<int, int>(std::isspace))).base(), trimmed.end()); 43 trimmed.erase(std::find_if(trimmed.rbegin(), trimmed.rend(), std::not1(std ::ptr_fun<int, int>(std::isspace))).base(), trimmed.end());
44 return trimmed; 44 return trimmed;
45 } 45 }
46 #ifdef _WIN32 46 #ifdef _WIN32
47 std::wstring ToUtf16String(const std::string& str); 47 std::wstring ToUtf16String(const std::string& str);
48 std::string ToUtf8String(const std::wstring& str); 48 std::string ToUtf8String(const std::wstring& str);
49 std::wstring CanonizeUrl(const std::wstring& url); 49 std::wstring CanonizeUrl(const std::wstring& url);
50 #endif 50 #endif
51 inline bool BeginsWith(const std::string& str, const std::string& beginning)
52 {
53 return 0 == str.compare(0, beginning.size(), beginning);
54 }
51 } 55 }
52 } 56 }
53 57
54 #endif 58 #endif
OLDNEW
« no previous file with comments | « no previous file | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld