Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9486)

Unified Diff: chrome/install_static/install_util.h

Issue 2017853002: Add functionality to the install_static library to tokenize strings and compare versions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add install_static_unittests to other windows bots Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/install_static/install_util.h
diff --git a/chrome/install_static/install_util.h b/chrome/install_static/install_util.h
index b7a4ffb0fbc05d7996d356a1575778693a13a120..32f36e9dccc2eac26bcd3b98cd16805dd3d5d326 100644
--- a/chrome/install_static/install_util.h
+++ b/chrome/install_static/install_util.h
@@ -9,6 +9,9 @@
#ifndef CHROME_INSTALL_STATIC_INSTALL_UTIL_H_
#define CHROME_INSTALL_STATIC_INSTALL_UTIL_H_
+#include <string>
+#include <vector>
+
#include "base/strings/string16.h"
namespace install_static {
@@ -156,6 +159,28 @@ base::string16 GetBrowserCrashDumpAttemptsRegistryPath();
// as '*xyz*'.
bool MatchPattern(const base::string16& source, const base::string16& pattern);
+// UTF8 to UTF16 and vice versa conversion helpers.
+base::string16 UTF8ToUTF16(const std::string& source);
+
+std::string UTF16ToUTF8(const base::string16& source);
+
+// Tokenizes a string |str| based on single character delimiter.
+// The tokens are returned in a vector. The |trim_spaces| parameter indicates
+// whether the function should optionally trim spaces throughout the string.
+std::vector<std::string> TokenizeString(const std::string& str,
+ char delimiter,
+ bool trim_spaces);
+
+// Compares version strings of the form "X.X.X.X" and returns the result of the
+// comparison in the |result| parameter. The result is as below:
+// 0 if the versions are equal.
+// -1 if version1 < version2.
+// 1 if version1 > version2.
+// Returns true on success, false on invalid strings being passed, etc.
+bool CompareVersionStrings(const std::string& version1,
+ const std::string& version2,
+ int* result);
+
// Caches the |ProcessType| of the current process.
extern ProcessType g_process_type;

Powered by Google App Engine
This is Rietveld 408576698