| OLD | NEW |
| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 template <typename Traits> | 53 template <typename Traits> |
| 54 class MinidumpStringWriter : public MinidumpWritable { | 54 class MinidumpStringWriter : public MinidumpWritable { |
| 55 public: | 55 public: |
| 56 MinidumpStringWriter(); | 56 MinidumpStringWriter(); |
| 57 ~MinidumpStringWriter(); | 57 ~MinidumpStringWriter(); |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 typedef typename Traits::MinidumpStringType MinidumpStringType; | 60 typedef typename Traits::MinidumpStringType MinidumpStringType; |
| 61 typedef typename Traits::StringType StringType; | 61 typedef typename Traits::StringType StringType; |
| 62 | 62 |
| 63 virtual bool Freeze() override; | 63 bool Freeze() override; |
| 64 virtual size_t SizeOfObject() override; | 64 size_t SizeOfObject() override; |
| 65 virtual bool WriteObject(FileWriterInterface* file_writer) override; | 65 bool WriteObject(FileWriterInterface* file_writer) override; |
| 66 | 66 |
| 67 //! \brief Sets the string to be written. | 67 //! \brief Sets the string to be written. |
| 68 //! | 68 //! |
| 69 //! \note Valid in #kStateMutable. | 69 //! \note Valid in #kStateMutable. |
| 70 void set_string(const StringType& string) { string_.assign(string); } | 70 void set_string(const StringType& string) { string_.assign(string); } |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 MinidumpStringType string_base_; | 73 MinidumpStringType string_base_; |
| 74 StringType string_; | 74 StringType string_; |
| 75 | 75 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void SetUTF8(const std::string& string_utf8) { set_string(string_utf8); } | 114 void SetUTF8(const std::string& string_utf8) { set_string(string_utf8); } |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 DISALLOW_COPY_AND_ASSIGN(MinidumpUTF8StringWriter); | 117 DISALLOW_COPY_AND_ASSIGN(MinidumpUTF8StringWriter); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace internal | 120 } // namespace internal |
| 121 } // namespace crashpad | 121 } // namespace crashpad |
| 122 | 122 |
| 123 #endif // CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_ | 123 #endif // CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_ |
| OLD | NEW |