blob: c36680dfe2c620c2488d8be98f94c2ecc3bda69b [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.
Brian Carlstrom4e777d42011-08-15 13:53:52 -070016 static File* OpenFile(const char* name, bool writable);
Brian Carlstromdb4d5402011-08-09 12:18:28 -070017
18 // Create a file from an already open file descriptor
19 static File* FileFromFd(const char* name, int fd);
20
21 // Check if a file exists.
22 static bool FileExists(const char* name);
Brian Carlstrom16192862011-09-12 17:50:06 -070023
24 // Check if a directory exists.
25 static bool DirectoryExists(const char* name);
Brian Carlstromdb4d5402011-08-09 12:18:28 -070026};
27
28} // namespace art
29
30#endif // ART_SRC_OS_H_