1 //===-- SBFile.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 //===----------------------------------------------------------------------===//
10 #define LLDB_SBFile_h_
12 #include "lldb/API/SBDefines.h"
16 class LLDB_API SBFile {
17 friend class SBInstruction;
18 friend class SBInstructionList;
19 friend class SBDebugger;
20 friend class SBCommandReturnObject;
21 friend class SBProcess;
25 SBFile(FileSP file_sp);
26 SBFile(FILE *file, bool transfer_ownership);
27 SBFile(int fd, const char *mode, bool transfer_ownership);
30 SBError Read(uint8_t *buf, size_t num_bytes, size_t *bytes_read);
31 SBError Write(const uint8_t *buf, size_t num_bytes, size_t *bytes_written);
36 operator bool() const;
37 bool operator!() const;
39 FileSP GetFile() const;
47 #endif // LLDB_SBFile_h_