| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_RANGE_RANGE_H_ | 5 #ifndef UI_GFX_RANGE_RANGE_H_ |
| 6 #define UI_GFX_RANGE_RANGE_H_ | 6 #define UI_GFX_RANGE_RANGE_H_ |
| 7 | 7 |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 explicit Range(const NSRange& range); | 47 explicit Range(const NSRange& range); |
| 48 #elif defined(OS_WIN) | 48 #elif defined(OS_WIN) |
| 49 // The |total_length| paramater should be used if the CHARRANGE is set to | 49 // The |total_length| paramater should be used if the CHARRANGE is set to |
| 50 // {0,-1} to indicate the whole range. | 50 // {0,-1} to indicate the whole range. |
| 51 Range(const CHARRANGE& range, LONG total_length = -1); | 51 Range(const CHARRANGE& range, LONG total_length = -1); |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 // Returns a range that is invalid, which is {size_t_max,size_t_max}. | 54 // Returns a range that is invalid, which is {size_t_max,size_t_max}. |
| 55 static const Range InvalidRange(); | 55 static const Range InvalidRange(); |
| 56 | 56 |
| 57 // Checks if the range is valid through comparision to InvalidRange(). | 57 // Checks if the range is valid through comparison to InvalidRange(). |
| 58 bool IsValid() const; | 58 bool IsValid() const; |
| 59 | 59 |
| 60 // Getters and setters. | 60 // Getters and setters. |
| 61 size_t start() const { return start_; } | 61 size_t start() const { return start_; } |
| 62 void set_start(size_t start) { start_ = start; } | 62 void set_start(size_t start) { start_ = start; } |
| 63 | 63 |
| 64 size_t end() const { return end_; } | 64 size_t end() const { return end_; } |
| 65 void set_end(size_t end) { end_ = end; } | 65 void set_end(size_t end) { end_ = end; } |
| 66 | 66 |
| 67 // Returns the absolute value of the length. | 67 // Returns the absolute value of the length. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 private: | 108 private: |
| 109 size_t start_; | 109 size_t start_; |
| 110 size_t end_; | 110 size_t end_; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 GFX_EXPORT std::ostream& operator<<(std::ostream& os, const Range& range); | 113 GFX_EXPORT std::ostream& operator<<(std::ostream& os, const Range& range); |
| 114 | 114 |
| 115 } // namespace gfx | 115 } // namespace gfx |
| 116 | 116 |
| 117 #endif // UI_GFX_RANGE_RANGE_H_ | 117 #endif // UI_GFX_RANGE_RANGE_H_ |
| OLD | NEW |