[llvm-commits] CVS: llvm/include/Support/FileUtilities.h
Chris Lattner
lattner at cs.uiuc.edu
Thu May 27 19:26:01 PDT 2004
Changes in directory llvm/include/Support:
FileUtilities.h updated: 1.16 -> 1.17
---
Log message:
Add a pair of functions to hide system specific details of mapping a file in for reading.
---
Diffs of the changes: (+11 -1)
Index: llvm/include/Support/FileUtilities.h
diff -u llvm/include/Support/FileUtilities.h:1.16 llvm/include/Support/FileUtilities.h:1.17
--- llvm/include/Support/FileUtilities.h:1.16 Wed Feb 18 14:20:52 2004
+++ llvm/include/Support/FileUtilities.h Thu May 27 19:23:11 2004
@@ -42,7 +42,7 @@
/// FileOpenable - Returns true IFF Filename names an existing regular file
/// which we can successfully open.
///
-bool FileOpenable (const std::string &Filename);
+bool FileOpenable(const std::string &Filename);
/// DiffFiles - Compare the two files specified, returning true if they are
/// different or if there is a file error. If you specify a string to fill in
@@ -92,6 +92,16 @@
/// updated since that last time the timestampt was aquired. If the file does
/// not exist or there is an error getting the time-stamp, zero is returned.
unsigned long long getFileTimestamp(const std::string &Filename);
+
+/// ReadFileIntoAddressSpace - Attempt to map the specific file into the
+/// address space of the current process for reading. If this succeeds,
+/// return the address of the buffer and the length of the file mapped. On
+/// failure, return null.
+void *ReadFileIntoAddressSpace(const std::string &Filename, unsigned &Length);
+
+/// UnmapFileFromAddressSpace - Remove the specified file from the current
+/// address space.
+void UnmapFileFromAddressSpace(void *Buffer, unsigned Length);
/// FDHandle - Simple handle class to make sure a file descriptor gets closed
More information about the llvm-commits
mailing list