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

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

Issue 5171515343503360: Issue #41 - Bring method of determining IE version up to date (Closed)
Patch Set: Second version Created June 25, 2014, 6:53 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
OLDNEW
1 #ifndef UTILS_H 1 #ifndef UTILS_H
2 #define UTILS_H 2 #define UTILS_H
3 3
4 #include <algorithm> 4 #include <algorithm>
5 #include <locale> 5 #include <locale>
6 #include <functional> 6 #include <functional>
7 #include <string> 7 #include <string>
8 8
9 #define WM_ALREADY_UP_TO_DATE WM_APP+1 9 #define WM_ALREADY_UP_TO_DATE WM_APP+1
10 #define WM_UPDATE_CHECK_ERROR WM_APP+2 10 #define WM_UPDATE_CHECK_ERROR WM_APP+2
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 T TrimString(T text) 43 T TrimString(T text)
44 { 44 {
45 // Via http://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-st dstring 45 // Via http://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-st dstring
46 T trimmed(text); 46 T trimmed(text);
47 std::function<bool(T::value_type)> isspace = std::bind(&std::isspace<T::value_ type>, std::placeholders::_1, std::locale::classic()); 47 std::function<bool(T::value_type)> isspace = std::bind(&std::isspace<T::value_ type>, std::placeholders::_1, std::locale::classic());
48 trimmed.erase(trimmed.begin(), std::find_if(trimmed.begin(), trimmed.end(), st d::not1(isspace))); 48 trimmed.erase(trimmed.begin(), std::find_if(trimmed.begin(), trimmed.end(), st d::not1(isspace)));
49 trimmed.erase(std::find_if(trimmed.rbegin(), trimmed.rend(), std::not1(isspace )).base(), trimmed.end()); 49 trimmed.erase(std::find_if(trimmed.rbegin(), trimmed.rend(), std::not1(isspace )).base(), trimmed.end());
50 return trimmed; 50 return trimmed;
51 } 51 }
52 52
53 namespace ABP
54 {
55 namespace IE
56 {
57 /**
58 * Retrieve the full version string of the currently installed IE.
59 *
60 * C++11 noexcept.
61 * Returns an empty string if there was a problem retrieving the version str ing.
62 */
63 std::wstring installed_version_string();
64
65 /**
66 * Retrieve the major version number of the currently installed IE.
67 *
68 * C++11 noexcept.
69 * Returns 0 if there was a problem retrieving the version string.
70 */
71 int installed_major_version();
72 }
73 }
74
53 #endif // UTILS_H 75 #endif // UTILS_H
OLDNEW

Powered by Google App Engine
This is Rietveld