Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: base/strings/nullable_string16.h

Issue 16415016: Move nullable_string16.h to the string subdirectory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/nullable_string16.h ('k') | content/browser/dom_storage/dom_storage_message_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef BASE_STRINGS_NULLABLE_STRING16_H_
6 #define BASE_NULLABLE_STRING16_H_ 6 #define BASE_STRINGS_NULLABLE_STRING16_H_
7 7
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 9
10 namespace base {
11
10 // This class is a simple wrapper for string16 which also contains a null 12 // 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 13 // state. This should be used only where the difference between null and
12 // empty is meaningful. 14 // empty is meaningful.
13 class NullableString16 { 15 class NullableString16 {
14 public: 16 public:
15 NullableString16() : is_null_(false) { } 17 NullableString16() : is_null_(false) { }
16 explicit NullableString16(bool is_null) : is_null_(is_null) { } 18 explicit NullableString16(bool is_null) : is_null_(is_null) { }
17 NullableString16(const string16& string, bool is_null) 19 NullableString16(const string16& string, bool is_null)
18 : string_(string), is_null_(is_null) { 20 : string_(string), is_null_(is_null) {
19 } 21 }
20 22
21 const string16& string() const { return string_; } 23 const string16& string() const { return string_; }
22 bool is_null() const { return is_null_; } 24 bool is_null() const { return is_null_; }
23 25
24 private: 26 private:
25 string16 string_; 27 string16 string_;
26 bool is_null_; 28 bool is_null_;
27 }; 29 };
28 30
29 #endif // BASE_NULLABLE_STRING16_H_ 31 } // namespace
32
33 // TODO(avi) update users of NullableString16 to use the namespace and remove
34 // this "using".
35 using base::NullableString16;
36
37 #endif // BASE_STRINGS_NULLABLE_STRING16_H_
OLDNEW
« no previous file with comments | « base/nullable_string16.h ('k') | content/browser/dom_storage/dom_storage_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698