blob: 440c997515fe37c595e4ec29a74fc1084addee98 [file] [log] [blame]
Brian Carlstromdb4d5402011-08-09 12:18:28 -07001// Copyright 2009 Google Inc. All Rights Reserved.
2
3#ifndef ART_SRC_OS_H_
4#define ART_SRC_OS_H_
5
6namespace art {
7
8// Interface to the underlying OS platform.
9
10class File;
11
12class 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_