Chromium Code Reviews| Index: components/enhanced_bookmarks/stars_position.h |
| diff --git a/components/enhanced_bookmarks/stars_position.h b/components/enhanced_bookmarks/stars_position.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..15bf26e10e41f6171f402eef1553059cb865b486 |
| --- /dev/null |
| +++ b/components/enhanced_bookmarks/stars_position.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_ |
| +#define COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +namespace enhanced_bookmarks { |
| + |
| +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.
|
| + public: |
| + ~StarsPosition(); |
| + |
| + static StarsPosition CreateInitialPosition(); |
| + |
| + static StarsPosition CreateBefore(const StarsPosition& other); |
| + static StarsPosition CreateBetween(const StarsPosition& before, |
| + const StarsPosition& after); |
| + static StarsPosition CreateAfter(const StarsPosition& other); |
| + |
| + bool IsValid() const; |
| + |
| + std::string ToString() const; |
| + |
| + private: |
| + typedef std::vector<char> PositionVector; |
| + |
| + StarsPosition(); |
| + explicit StarsPosition(const PositionVector& position); |
| + |
| + static PositionVector CreateBeforeImpl(const PositionVector& before, |
| + size_t from_index); |
| + static PositionVector CreateBetweenImpl(const PositionVector& before, |
| + const PositionVector& after); |
| + static PositionVector CreateAfterImpl(const PositionVector& after, |
| + size_t from_index); |
| + |
| + PositionVector position_; |
| +}; |
| + |
| +} // namespace enhanced_bookmarks |
| + |
| +#endif // COMPONENTS_ENHANCED_BOOKMARKS_STARS_POSITION_H_ |