Index: util/file/file_io.h |
diff --git a/util/file/file_io.h b/util/file/file_io.h |
index 927bc3cb13319ff5843a613cff77bbfd20588648..3b1adef2b816435ac50a50bb462e950ec51fe135 100644 |
--- a/util/file/file_io.h |
+++ b/util/file/file_io.h |
@@ -15,6 +15,7 @@ |
#ifndef CRASHPAD_UTIL_FILE_FILE_IO_H_ |
#define CRASHPAD_UTIL_FILE_FILE_IO_H_ |
+#include <inttypes.h> |
Mark Mentovai
2014/12/18 19:04:27
We use <stdint.h> to get intxx_t in Crashpad.
But
scottmg
2014/12/18 19:59:20
Done. (removed)
|
#include <sys/types.h> |
#include "build/build_config.h" |
@@ -23,6 +24,10 @@ |
#include <windows.h> |
#endif |
+namespace base { |
+class FilePath; |
+} |
Mark Mentovai
2014/12/18 19:04:27
// namespace base
scottmg
2014/12/18 19:59:20
Done.
|
+ |
namespace crashpad { |
#if defined(OS_POSIX) |
@@ -121,6 +126,26 @@ void CheckedWriteFile(FileHandle file, const void* buffer, size_t size); |
//! \sa ReadFile |
void CheckedReadFileAtEOF(FileHandle file); |
+//! \brief Wraps `open()` or `CreateFile()`, creating a file for output. Logs |
+//! an error if the operation fails. |
+//! |
+//! On a POSIX system, \a mode will be used as the permissions bits. |
+//! |
+//! \return The newly opened FileHandle, or an invalid FileHandle on failure. |
Mark Mentovai
2014/12/18 19:04:27
Aha! We should have a \brief on FileHandle.
None
scottmg
2014/12/18 19:59:20
Done.
|
+//! |
+//! \sa ScopedFD |
+//! \sa ScopedFileHANDLE |
+FileHandle LoggingOpenFileForWrite(const base::FilePath& path, uint32_t mode); |
Mark Mentovai
2014/12/18 19:04:26
I agree that we probably don’t need to worry about
scottmg
2014/12/18 19:59:20
I was thinking a separate LoggingOpenFileForAppend
|
+ |
+//! \brief Wraps `open()` or `CreateFile()`, opening an existing file for |
+//! reading. Logs an error if the operation fails. |
+//! |
+//! \return The newly opened FileHandle, or an invalid FileHandle on failure. |
+//! |
+//! \sa ScopedFD |
+//! \sa ScopedFileHANDLE |
+FileHandle LoggingOpenFileForRead(const base::FilePath& path); |
Mark Mentovai
2014/12/18 19:04:26
On the other hand, I see no problems with an inter
|
+ |
//! \brief Wraps `close()` or `CloseHandle()`, logging an error if the operation |
//! fails. |
//! |