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_BASE_RANGE_RANGE_H_ | 5 #ifndef UI_BASE_RANGE_RANGE_H_ |
6 #define UI_BASE_RANGE_RANGE_H_ | 6 #define UI_BASE_RANGE_RANGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <iosfwd> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "ui/base/ui_export.h" | 12 #include "ui/base/ui_export.h" |
13 | 13 |
14 #if defined(OS_MACOSX) | 14 #if defined(OS_MACOSX) |
15 #if __OBJC__ | 15 #if __OBJC__ |
16 #import <Foundation/Foundation.h> | 16 #import <Foundation/Foundation.h> |
17 #else | 17 #else |
18 typedef struct _NSRange NSRange; | 18 typedef struct _NSRange NSRange; |
19 #endif | 19 #endif |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 Range& operator=(const NSRange& range); | 96 Range& operator=(const NSRange& range); |
97 | 97 |
98 // NSRange does not store the directionality of a range, so if this | 98 // NSRange does not store the directionality of a range, so if this |
99 // is_reversed(), the range will get flipped when converted to an NSRange. | 99 // is_reversed(), the range will get flipped when converted to an NSRange. |
100 NSRange ToNSRange() const; | 100 NSRange ToNSRange() const; |
101 #elif defined(OS_WIN) | 101 #elif defined(OS_WIN) |
102 CHARRANGE ToCHARRANGE() const; | 102 CHARRANGE ToCHARRANGE() const; |
103 #endif | 103 #endif |
104 // GTK+ has no concept of a range. | 104 // GTK+ has no concept of a range. |
105 | 105 |
| 106 std::string ToString() const; |
| 107 |
106 private: | 108 private: |
107 size_t start_; | 109 size_t start_; |
108 size_t end_; | 110 size_t end_; |
109 }; | 111 }; |
110 | 112 |
111 UI_EXPORT std::ostream& operator<<(std::ostream& out, const ui::Range& range); | 113 } // namespace ui |
112 | |
113 } // namespace gfx | |
114 | 114 |
115 #endif // UI_BASE_RANGE_RANGE_H_ | 115 #endif // UI_BASE_RANGE_RANGE_H_ |
OLD | NEW |