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 24 matching lines...) Expand all Loading... |
35 struct WritableIoVec { | 35 struct WritableIoVec { |
36 //! \brief The base address of a memory region for output. | 36 //! \brief The base address of a memory region for output. |
37 const void* iov_base; | 37 const void* iov_base; |
38 | 38 |
39 //! \brief The size of the memory pointed to by #iov_base. | 39 //! \brief The size of the memory pointed to by #iov_base. |
40 size_t iov_len; | 40 size_t iov_len; |
41 }; | 41 }; |
42 | 42 |
43 //! \brief An interface to write to files and other file-like objects with | 43 //! \brief An interface to write to files and other file-like objects with |
44 //! semantics matching the underlying platform (POSIX or Windows). | 44 //! semantics matching the underlying platform (POSIX or Windows). |
45 class FileWriterInterface : public FileSeekerInterface { | 45 class FileWriterInterface : public virtual FileSeekerInterface { |
46 public: | 46 public: |
47 //! \brief Wraps LoggingWriteFile(), or provides an implementation with | 47 //! \brief Wraps LoggingWriteFile(), or provides an implementation with |
48 //! identical semantics. | 48 //! identical semantics. |
49 //! | 49 //! |
50 //! \return `true` if the operation succeeded, `false` if it failed, with an | 50 //! \return `true` if the operation succeeded, `false` if it failed, with an |
51 //! error message logged. | 51 //! error message logged. |
52 virtual bool Write(const void* data, size_t size) = 0; | 52 virtual bool Write(const void* data, size_t size) = 0; |
53 | 53 |
54 //! \brief Wraps `writev()` on POSIX or provides an alternate implementation | 54 //! \brief Wraps `writev()` on POSIX or provides an alternate implementation |
55 //! with identical semantics. This method will write entire buffers, | 55 //! with identical semantics. This method will write entire buffers, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 private: | 164 private: |
165 ScopedFileHandle file_; | 165 ScopedFileHandle file_; |
166 WeakFileHandleFileWriter weak_file_handle_file_writer_; | 166 WeakFileHandleFileWriter weak_file_handle_file_writer_; |
167 | 167 |
168 DISALLOW_COPY_AND_ASSIGN(FileWriter); | 168 DISALLOW_COPY_AND_ASSIGN(FileWriter); |
169 }; | 169 }; |
170 | 170 |
171 } // namespace crashpad | 171 } // namespace crashpad |
172 | 172 |
173 #endif // CRASHPAD_UTIL_FILE_FILE_WRITER_H_ | 173 #endif // CRASHPAD_UTIL_FILE_FILE_WRITER_H_ |
OLD | NEW |