| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 public: | 92 public: |
| 93 MinidumpUTF16StringWriter() : MinidumpStringWriter() {} | 93 MinidumpUTF16StringWriter() : MinidumpStringWriter() {} |
| 94 ~MinidumpUTF16StringWriter() override; | 94 ~MinidumpUTF16StringWriter() override; |
| 95 | 95 |
| 96 //! \brief Converts a UTF-8 string to UTF-16 and sets it as the string to be | 96 //! \brief Converts a UTF-8 string to UTF-16 and sets it as the string to be |
| 97 //! written. | 97 //! written. |
| 98 //! | 98 //! |
| 99 //! \note Valid in #kStateMutable. | 99 //! \note Valid in #kStateMutable. |
| 100 void SetUTF8(const std::string& string_utf8); | 100 void SetUTF8(const std::string& string_utf8); |
| 101 | 101 |
| 102 //! \brief Sets the given UTF-16 string as the string to be written. | |
| 103 //! | |
| 104 //! \note Valid in #kStateMutable. | |
| 105 void SetUTF16(const base::string16& string_utf16) { | |
| 106 set_string(string_utf16); | |
| 107 } | |
| 108 | |
| 109 private: | 102 private: |
| 110 DISALLOW_COPY_AND_ASSIGN(MinidumpUTF16StringWriter); | 103 DISALLOW_COPY_AND_ASSIGN(MinidumpUTF16StringWriter); |
| 111 }; | 104 }; |
| 112 | 105 |
| 113 //! \brief Writes a variable-length UTF-8-encoded MinidumpUTF8String to a | 106 //! \brief Writes a variable-length UTF-8-encoded MinidumpUTF8String to a |
| 114 //! minidump file. | 107 //! minidump file. |
| 115 //! | 108 //! |
| 116 //! MinidumpUTF8StringWriter objects should not be instantiated directly outside | 109 //! MinidumpUTF8StringWriter objects should not be instantiated directly outside |
| 117 //! of the MinidumpWritable family of classes. | 110 //! of the MinidumpWritable family of classes. |
| 118 class MinidumpUTF8StringWriter final | 111 class MinidumpUTF8StringWriter final |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } // namespace internal | 174 } // namespace internal |
| 182 | 175 |
| 183 using MinidumpUTF16StringListWriter = internal::MinidumpStringListWriter< | 176 using MinidumpUTF16StringListWriter = internal::MinidumpStringListWriter< |
| 184 internal::MinidumpUTF16StringWriter>; | 177 internal::MinidumpUTF16StringWriter>; |
| 185 using MinidumpUTF8StringListWriter = internal::MinidumpStringListWriter< | 178 using MinidumpUTF8StringListWriter = internal::MinidumpStringListWriter< |
| 186 internal::MinidumpUTF8StringWriter>; | 179 internal::MinidumpUTF8StringWriter>; |
| 187 | 180 |
| 188 } // namespace crashpad | 181 } // namespace crashpad |
| 189 | 182 |
| 190 #endif // CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_ | 183 #endif // CRASHPAD_MINIDUMP_MINIDUMP_STRING_WRITER_H_ |
| OLD | NEW |