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
3 // found in the LICENSE file.
5 #ifndef BASE_NULLABLE_STRING16_H_
6 #define BASE_NULLABLE_STRING16_H_
9 #include "base/string16.h"
11 // This class is a simple wrapper for string16 which also contains a null
12 // state. This should be used only where the difference between null and
13 // empty is meaningful.
14 class NullableString16
{
16 NullableString16() : is_null_(false) { }
17 explicit NullableString16(bool is_null
) : is_null_(is_null
) { }
18 NullableString16(const string16
& string
, bool is_null
)
19 : string_(string
), is_null_(is_null
) {
22 const string16
& string() const { return string_
; }
23 bool is_null() const { return is_null_
; }
30 #endif // BASE_NULLABLE_STRING16_H_