aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Host/FileSystem.h
blob: 794308ff4244e52cefa72dc8dc83a33d6e0b555d (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
//===-- FileSystem.h --------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_Host_FileSystem_h
#define liblldb_Host_FileSystem_h

#include "lldb/Utility/Error.h"
#include "lldb/Utility/FileSpec.h"
#include "llvm/Support/Chrono.h"

#include "lldb/lldb-types.h"

#include <stdint.h>
#include <stdio.h>
#include <sys/stat.h>

namespace lldb_private {
class FileSystem {
public:
  static const char *DEV_NULL;
  static const char *PATH_CONVERSION_ERROR;

  static Error Symlink(const FileSpec &src, const FileSpec &dst);
  static Error Readlink(const FileSpec &src, FileSpec &dst);

  static Error ResolveSymbolicLink(const FileSpec &src, FileSpec &dst);

  /// Wraps ::fopen in a platform-independent way. Once opened, FILEs can be
  /// manipulated and closed with the normal ::fread, ::fclose, etc. functions.
  static FILE *Fopen(const char *path, const char *mode);

  static llvm::sys::TimePoint<> GetModificationTime(const FileSpec &file_spec);
};
}

#endif