Chromium Code Reviews| Index: chrome/common/string_ordinal.h |
| diff --git a/chrome/common/string_ordinal.h b/chrome/common/string_ordinal.h |
| index abe0fe42da124d0408ace5ba171f51d568798a84..757f136700d926ddbfb2c03101921d60e0909755 100644 |
| --- a/chrome/common/string_ordinal.h |
| +++ b/chrome/common/string_ordinal.h |
| @@ -29,6 +29,11 @@ class StringOrdinal { |
| // Creates an invalid StringOrdinal. |
| StringOrdinal(); |
| + // Creates a valid StringOrdinal, this is generally called to create the first |
| + // element of StringOrdinal list (i.e. before we have any other values we can |
| + // generate from). |
| + static StringOrdinal CreateValidOrdinal(); |
|
akalin
2011/11/17 03:06:32
maybe "CreateFirstOrdinal"?
Finnur
2011/11/17 14:59:25
I went back and forth on this.
I vaguely prefer C
csharp
2011/11/17 19:51:58
Changing to CreateInitialOrdinal since that expres
|
| + |
| bool IsValid() const; |
| // All remaining functions can only be called if IsValid() holds. |
| @@ -58,6 +63,13 @@ class StringOrdinal { |
| // string will be valid. |
| std::string ToString() const; |
| + // A comparsion struct that can be use by STL containers that require sorting. |
| + struct Comparsion { |
|
akalin
2011/11/17 03:06:32
Comparsion -> Comparison
Although the usual name
csharp
2011/11/17 19:51:58
Done.
|
| + bool operator() (const StringOrdinal& lhs, const StringOrdinal& rhs) const { |
| + return lhs.LessThan(rhs); |
|
akalin
2011/11/17 03:06:32
de-inline this
csharp
2011/11/17 19:51:58
Done.
|
| + } |
| + }; |
| + |
| // Use of copy constructor and default assignment for this class is allowed. |
| private: |