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

Unified Diff: chrome/common/string_ordinal.cc

Issue 8198003: Convert app_launch_index and page_index from int to StringOrdinal. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixing clang compile Created 9 years 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
« no previous file with comments | « chrome/common/string_ordinal.h ('k') | chrome/common/string_ordinal_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/string_ordinal.cc
diff --git a/chrome/common/string_ordinal.cc b/chrome/common/string_ordinal.cc
index f07002639174353624db6cb6d9de3f82592720b1..069afd25c70baba49e1e1cf5120c548f1041faa8 100644
--- a/chrome/common/string_ordinal.cc
+++ b/chrome/common/string_ordinal.cc
@@ -174,6 +174,10 @@ StringOrdinal::StringOrdinal() : string_ordinal_(""),
is_valid_(false) {
}
+StringOrdinal StringOrdinal::CreateInitialOrdinal() {
+ return StringOrdinal(std::string(1, kMidDigit));
+}
+
bool StringOrdinal::IsValid() const {
return is_valid_;
}
@@ -184,6 +188,12 @@ bool StringOrdinal::LessThan(const StringOrdinal& other) const {
return string_ordinal_ < other.string_ordinal_;
}
+bool StringOrdinal::GreaterThan(const StringOrdinal& other) const {
+ CHECK(IsValid());
+ CHECK(other.IsValid());
+ return string_ordinal_ > other.string_ordinal_;
+}
+
bool StringOrdinal::Equal(const StringOrdinal& other) const {
CHECK(IsValid());
CHECK(other.IsValid());
@@ -238,3 +248,8 @@ std::string StringOrdinal::ToString() const {
CHECK(IsValid());
return string_ordinal_;
}
+
+bool StringOrdinalLessThan::operator() (const StringOrdinal& lhs,
+ const StringOrdinal& rhs) const {
+ return lhs.LessThan(rhs);
+}
« no previous file with comments | « chrome/common/string_ordinal.h ('k') | chrome/common/string_ordinal_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698