Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:42

0001 //===-- SBFile.h --------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_API_SBFILE_H
0010 #define LLDB_API_SBFILE_H
0011 
0012 #include "lldb/API/SBDefines.h"
0013 
0014 #include <cstdio>
0015 
0016 namespace lldb {
0017 
0018 class LLDB_API SBFile {
0019   friend class SBInstruction;
0020   friend class SBInstructionList;
0021   friend class SBDebugger;
0022   friend class SBCommandReturnObject;
0023   friend class SBProcess;
0024 
0025 public:
0026   SBFile();
0027   SBFile(FileSP file_sp);
0028 #ifndef SWIG
0029   SBFile(const SBFile &rhs);
0030   SBFile(FILE *file, bool transfer_ownership);
0031 #endif
0032   SBFile(int fd, const char *mode, bool transfer_ownership);
0033   ~SBFile();
0034 
0035   SBFile &operator=(const SBFile &rhs);
0036 
0037   SBError Read(uint8_t *buf, size_t num_bytes, size_t *OUTPUT);
0038   SBError Write(const uint8_t *buf, size_t num_bytes, size_t *OUTPUT);
0039   SBError Flush();
0040   bool IsValid() const;
0041   SBError Close();
0042 
0043   operator bool() const;
0044 #ifndef SWIG
0045   bool operator!() const;
0046 #endif
0047 
0048   FileSP GetFile() const;
0049 
0050 private:
0051   FileSP m_opaque_sp;
0052 };
0053 
0054 } // namespace lldb
0055 
0056 #endif // LLDB_API_SBFILE_H