OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_ | |
6 #define COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 namespace enhanced_bookmarks { | |
12 | |
13 class StarsPosition { | |
Mark
2014/09/04 21:51:24
Please add class level comment as to what this is
Rune Fevang
2014/09/04 22:56:47
Done.
| |
14 public: | |
15 ~StarsPosition(); | |
16 | |
17 static StarsPosition CreateInitialPosition(); | |
18 | |
19 static StarsPosition CreateBefore(const StarsPosition& other); | |
20 static StarsPosition CreateBetween(const StarsPosition& before, | |
21 const StarsPosition& after); | |
22 static StarsPosition CreateAfter(const StarsPosition& other); | |
23 | |
24 bool IsValid() const; | |
25 | |
26 std::string ToString() const; | |
27 | |
28 private: | |
29 typedef std::vector<char> PositionVector; | |
30 | |
31 StarsPosition(); | |
32 explicit StarsPosition(const PositionVector& position); | |
33 | |
34 static PositionVector CreateBeforeImpl(const PositionVector& before, | |
35 size_t from_index); | |
36 static PositionVector CreateBetweenImpl(const PositionVector& before, | |
37 const PositionVector& after); | |
38 static PositionVector CreateAfterImpl(const PositionVector& after, | |
39 size_t from_index); | |
40 | |
41 PositionVector position_; | |
42 }; | |
43 | |
44 } // namespace enhanced_bookmarks | |
45 | |
46 #endif // COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_ | |
OLD | NEW |