LLDB mainline
SBFile.h
Go to the documentation of this file.
1//===-- SBFile.h --------------------------------------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_API_SBFILE_H
10#define LLDB_API_SBFILE_H
11
12#include "lldb/API/SBDefines.h"
13
14#include <cstdio>
15
16namespace lldb {
17
19 friend class SBInstruction;
20 friend class SBInstructionList;
21 friend class SBDebugger;
23 friend class SBProcess;
24
25public:
26 SBFile();
27 SBFile(FileSP file_sp);
28#ifndef SWIG
29 SBFile(const SBFile &rhs);
30 SBFile(FILE *file, bool transfer_ownership);
31#endif
32 SBFile(int fd, const char *mode, bool transfer_ownership);
34
35 SBFile &operator=(const SBFile &rhs);
36
37 SBError Read(uint8_t *buf, size_t num_bytes, size_t *OUTPUT);
38 SBError Write(const uint8_t *buf, size_t num_bytes, size_t *OUTPUT);
39 SBError Flush();
40 bool IsValid() const;
41 SBError Close();
42
43 operator bool() const;
44#ifndef SWIG
45 bool operator!() const;
46#endif
47
48 FileSP GetFile() const;
49
50private:
52};
53
54} // namespace lldb
55
56#endif // LLDB_API_SBFILE_H
#define LLDB_API
Definition: SBDefines.h:28
FileSP m_opaque_sp
Definition: SBFile.h:51
Definition: SBAddress.h:15
std::shared_ptr< lldb_private::File > FileSP
Definition: lldb-forward.h:348