OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 BASE_NULLABLE_STRING16_H_ | 5 // This file has moved, please use the new location. |
6 #define BASE_NULLABLE_STRING16_H_ | 6 // TODO(avi) remove this file when all users have been updated. |
7 | 7 #include "base/strings/nullable_string16.h" |
8 #include "base/strings/string16.h" | |
9 | |
10 // This class is a simple wrapper for string16 which also contains a null | |
11 // state. This should be used only where the difference between null and | |
12 // empty is meaningful. | |
13 class NullableString16 { | |
14 public: | |
15 NullableString16() : is_null_(false) { } | |
16 explicit NullableString16(bool is_null) : is_null_(is_null) { } | |
17 NullableString16(const string16& string, bool is_null) | |
18 : string_(string), is_null_(is_null) { | |
19 } | |
20 | |
21 const string16& string() const { return string_; } | |
22 bool is_null() const { return is_null_; } | |
23 | |
24 private: | |
25 string16 string_; | |
26 bool is_null_; | |
27 }; | |
28 | |
29 #endif // BASE_NULLABLE_STRING16_H_ | |
OLD | NEW |