Brian Carlstrom | db4d540 | 2011-08-09 12:18:28 -0700 | [diff] [blame^] | 1 | // Copyright 2009 Google Inc. All Rights Reserved. |
| 2 | |
| 3 | #ifndef ART_SRC_OS_H_ |
| 4 | #define ART_SRC_OS_H_ |
| 5 | |
| 6 | namespace art { |
| 7 | |
| 8 | // Interface to the underlying OS platform. |
| 9 | |
| 10 | class File; |
| 11 | |
| 12 | class OS { |
| 13 | public: |
| 14 | |
| 15 | // Open a file. The returned file must be deleted by the caller. |
| 16 | static File* OpenBinaryFile(const char* name, bool writable); |
| 17 | static File* OpenTextFile(const char* name, bool writable); |
| 18 | |
| 19 | // Create a file from an already open file descriptor |
| 20 | static File* FileFromFd(const char* name, int fd); |
| 21 | |
| 22 | // Check if a file exists. |
| 23 | static bool FileExists(const char* name); |
| 24 | }; |
| 25 | |
| 26 | } // namespace art |
| 27 | |
| 28 | #endif // ART_SRC_OS_H_ |