1 //===-- FileCache.h ---------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
8 #ifndef liblldb_Host_FileCache_h
9 #define liblldb_Host_FileCache_h
14 #include "lldb/lldb-forward.h"
15 #include "lldb/lldb-types.h"
17 #include "lldb/Utility/FileSpec.h"
18 #include "lldb/Utility/Status.h"
20 namespace lldb_private {
25 typedef std::map<lldb::user_id_t, lldb::FileSP> FDToFileMap;
28 static FileCache &GetInstance();
30 lldb::user_id_t OpenFile(const FileSpec &file_spec, uint32_t flags,
31 uint32_t mode, Status &error);
32 bool CloseFile(lldb::user_id_t fd, Status &error);
34 uint64_t WriteFile(lldb::user_id_t fd, uint64_t offset, const void *src,
35 uint64_t src_len, Status &error);
36 uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst,
37 uint64_t dst_len, Status &error);
40 static FileCache *m_instance;