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

Side by Side Diff: minidump/minidump_string_writer.h

Issue 700143004: C++11: Use type aliases instead of typedefs (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month 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 | « compat/mac/mach-o/getsect.cc ('k') | minidump/minidump_thread_writer_test.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 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 12 matching lines...) Expand all
23 #include "base/strings/string16.h" 23 #include "base/strings/string16.h"
24 #include "minidump/minidump_extensions.h" 24 #include "minidump/minidump_extensions.h"
25 #include "minidump/minidump_writable.h" 25 #include "minidump/minidump_writable.h"
26 26
27 namespace crashpad { 27 namespace crashpad {
28 namespace internal { 28 namespace internal {
29 29
30 //! \cond 30 //! \cond
31 31
32 struct MinidumpStringWriterUTF16Traits { 32 struct MinidumpStringWriterUTF16Traits {
33 typedef string16 StringType; 33 using StringType = string16;
34 typedef MINIDUMP_STRING MinidumpStringType; 34 using MinidumpStringType = MINIDUMP_STRING;
35 }; 35 };
36 36
37 struct MinidumpStringWriterUTF8Traits { 37 struct MinidumpStringWriterUTF8Traits {
38 typedef std::string StringType; 38 using StringType = std::string;
39 typedef MinidumpUTF8String MinidumpStringType; 39 using MinidumpStringType = MinidumpUTF8String;
40 }; 40 };
41 41
42 //! \endcond 42 //! \endcond
43 43
44 //! \brief Writes a variable-length string to a minidump file in accordance with 44 //! \brief Writes a variable-length string to a minidump file in accordance with
45 //! the string type’s characteristics. 45 //! the string type’s characteristics.
46 //! 46 //!
47 //! MinidumpStringWriter objects should not be instantiated directly. To write 47 //! MinidumpStringWriter objects should not be instantiated directly. To write
48 //! strings to minidump file, use the MinidumpUTF16StringWriter and 48 //! strings to minidump file, use the MinidumpUTF16StringWriter and
49 //! MinidumpUTF8StringWriter subclasses instead. 49 //! MinidumpUTF8StringWriter subclasses instead.
50 template <typename Traits> 50 template <typename Traits>
51 class MinidumpStringWriter : public MinidumpWritable { 51 class MinidumpStringWriter : public MinidumpWritable {
52 public: 52 public:
53 MinidumpStringWriter(); 53 MinidumpStringWriter();
54 ~MinidumpStringWriter() override; 54 ~MinidumpStringWriter() override;
55 55
56 protected: 56 protected:
57 typedef typename Traits::MinidumpStringType MinidumpStringType; 57 using MinidumpStringType = typename Traits::MinidumpStringType;
58 typedef typename Traits::StringType StringType; 58 using StringType = typename Traits::StringType;
59 59
60 bool Freeze() override; 60 bool Freeze() override;
61 size_t SizeOfObject() override; 61 size_t SizeOfObject() override;
62 bool WriteObject(FileWriterInterface* file_writer) override; 62 bool WriteObject(FileWriterInterface* file_writer) override;
63 63
64 //! \brief Sets the string to be written. 64 //! \brief Sets the string to be written.
65 //! 65 //!
66 //! \note Valid in #kStateMutable. 66 //! \note Valid in #kStateMutable.
67 void set_string(const StringType& string) { string_.assign(string); } 67 void set_string(const StringType& string) { string_.assign(string); }
68 68
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 const std::string& UTF8() const { return string(); } 121 const std::string& UTF8() const { return string(); }
122 122
123 private: 123 private:
124 DISALLOW_COPY_AND_ASSIGN(MinidumpUTF8StringWriter); 124 DISALLOW_COPY_AND_ASSIGN(MinidumpUTF8StringWriter);
125 }; 125 };
126 126
127 } // namespace internal 127 } // namespace internal
128 } // namespace crashpad 128 } // namespace crashpad
129 129
130 #endif // CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_ 130 #endif // CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_
OLDNEW
« no previous file with comments | « compat/mac/mach-o/getsect.cc ('k') | minidump/minidump_thread_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698