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

Side by Side Diff: util/file/file_writer.h

Issue 913223008: Add FileReaderInterface::ReadExactly() and FileSeekerInterface::SeekSet() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 10 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 | « util/file/file_seeker.cc ('k') | util/file/string_file_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 24 matching lines...) Expand all
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
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_
OLDNEW
« no previous file with comments | « util/file/file_seeker.cc ('k') | util/file/string_file_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698