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

Unified Diff: base/file_util.h

Issue 6005: Cross-platform equivalent of fopen, _wfopen_s etc.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: base/file_util.h
===================================================================
--- base/file_util.h (revision 2711)
+++ base/file_util.h (working copy)
@@ -16,6 +16,8 @@
#include <fts.h>
#endif
+#include <stdio.h>
+
#include <stack>
#include <string>
#include <vector>
@@ -246,6 +248,13 @@
// Returns information about the given file path.
bool GetFileInfo(const std::wstring& file_path, FileInfo* info);
+// Wrapper for fopen-like calls. Returns non-NULL FILE* on success.
+FILE* OpenFile(const std::string& filename, const char* mode);
+FILE* OpenFile(const std::wstring& filename, const char* mode);
+
+// Closes file opened by OpenFile. Returns true on success.
+bool CloseFile(FILE* file);
+
// Reads the given number of bytes from the file into the buffer. Returns
// the number of read bytes, or -1 on error.
int ReadFile(const std::wstring& filename, char* data, int size);
« no previous file with comments | « base/event_recorder.cc ('k') | base/file_util.cc » ('j') | base/file_util_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698