File indexing completed on 2026-05-10 08:42:48
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_HOST_FILEACTION_H
0010 #define LLDB_HOST_FILEACTION_H
0011
0012 #include "lldb/Utility/FileSpec.h"
0013 #include <string>
0014
0015 namespace lldb_private {
0016
0017 class FileAction {
0018 public:
0019 enum Action {
0020 eFileActionNone,
0021 eFileActionClose,
0022 eFileActionDuplicate,
0023 eFileActionOpen
0024 };
0025
0026 FileAction();
0027
0028 void Clear();
0029
0030 bool Close(int fd);
0031
0032 bool Duplicate(int fd, int dup_fd);
0033
0034 bool Open(int fd, const FileSpec &file_spec, bool read, bool write);
0035
0036 int GetFD() const { return m_fd; }
0037
0038 Action GetAction() const { return m_action; }
0039
0040 int GetActionArgument() const { return m_arg; }
0041
0042 llvm::StringRef GetPath() const;
0043
0044 const FileSpec &GetFileSpec() const;
0045
0046 void Dump(Stream &stream) const;
0047
0048 protected:
0049 Action m_action = eFileActionNone;
0050 int m_fd = -1;
0051 int m_arg = -1;
0052 FileSpec
0053 m_file_spec;
0054 };
0055
0056 }
0057
0058 #endif