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

Side by Side Diff: base/i18n/message_formatter.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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
« no previous file with comments | « base/i18n/icu_util.cc ('k') | base/i18n/message_formatter_unittest.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_I18N_MESSAGE_FORMATTER_H_ 5 #ifndef BASE_I18N_MESSAGE_FORMATTER_H_
6 #define BASE_I18N_MESSAGE_FORMATTER_H_ 6 #define BASE_I18N_MESSAGE_FORMATTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9
10 #include <memory>
9 #include <string> 11 #include <string>
10 12
11 #include "base/i18n/base_i18n_export.h" 13 #include "base/i18n/base_i18n_export.h"
12 #include "base/macros.h" 14 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
15 #include "base/strings/string_piece.h" 16 #include "base/strings/string_piece.h"
16 #include "third_party/icu/source/common/unicode/uversion.h" 17 #include "third_party/icu/source/common/unicode/uversion.h"
17 18
18 U_NAMESPACE_BEGIN 19 U_NAMESPACE_BEGIN
19 class Formattable; 20 class Formattable;
20 U_NAMESPACE_END 21 U_NAMESPACE_END
21 22
22 namespace base { 23 namespace base {
23 24
(...skipping 15 matching lines...) Expand all
39 MessageArg(int64_t i); 40 MessageArg(int64_t i);
40 MessageArg(double d); 41 MessageArg(double d);
41 MessageArg(const Time& t); 42 MessageArg(const Time& t);
42 ~MessageArg(); 43 ~MessageArg();
43 44
44 private: 45 private:
45 friend class base::i18n::MessageFormatter; 46 friend class base::i18n::MessageFormatter;
46 MessageArg(); 47 MessageArg();
47 // Tests if this argument has a value, and if so increments *count. 48 // Tests if this argument has a value, and if so increments *count.
48 bool has_value(int* count) const; 49 bool has_value(int* count) const;
49 scoped_ptr<icu::Formattable> formattable; 50 std::unique_ptr<icu::Formattable> formattable;
50 DISALLOW_COPY_AND_ASSIGN(MessageArg); 51 DISALLOW_COPY_AND_ASSIGN(MessageArg);
51 }; 52 };
52 53
53 } // namespace internal 54 } // namespace internal
54 55
55 // Message Formatter with the ICU message format syntax support. 56 // Message Formatter with the ICU message format syntax support.
56 // It can format strings (UTF-8 and UTF-16), numbers and base::Time with 57 // It can format strings (UTF-8 and UTF-16), numbers and base::Time with
57 // plural, gender and other 'selectors' support. This is handy if you 58 // plural, gender and other 'selectors' support. This is handy if you
58 // have multiple parameters of differnt types and some of them require 59 // have multiple parameters of differnt types and some of them require
59 // plural or gender/selector support. 60 // plural or gender/selector support.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 104
104 private: 105 private:
105 MessageFormatter() {} 106 MessageFormatter() {}
106 DISALLOW_COPY_AND_ASSIGN(MessageFormatter); 107 DISALLOW_COPY_AND_ASSIGN(MessageFormatter);
107 }; 108 };
108 109
109 } // namespace i18n 110 } // namespace i18n
110 } // namespace base 111 } // namespace base
111 112
112 #endif // BASE_I18N_MESSAGE_FORMATTER_H_ 113 #endif // BASE_I18N_MESSAGE_FORMATTER_H_
OLDNEW
« no previous file with comments | « base/i18n/icu_util.cc ('k') | base/i18n/message_formatter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698