summaryrefslogtreecommitdiff
path: root/src/os.h
blob: c36680dfe2c620c2488d8be98f94c2ecc3bda69b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2009 Google Inc. All Rights Reserved.

#ifndef ART_SRC_OS_H_
#define ART_SRC_OS_H_

namespace art {

// Interface to the underlying OS platform.

class File;

class OS {
 public:

  // Open a file. The returned file must be deleted by the caller.
  static File* OpenFile(const char* name, bool writable);

  // Create a file from an already open file descriptor
  static File* FileFromFd(const char* name, int fd);

  // Check if a file exists.
  static bool FileExists(const char* name);

  // Check if a directory exists.
  static bool DirectoryExists(const char* name);
};

}  // namespace art

#endif  // ART_SRC_OS_H_