1 //===-- PlatformPOSIX.h -----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_PlatformPOSIX_h_
11 #define liblldb_PlatformPOSIX_h_
18 // Other libraries and framework includes
20 #include "lldb/Interpreter/Options.h"
21 #include "lldb/Target/Platform.h"
23 class PlatformPOSIX : public lldb_private::Platform
26 PlatformPOSIX (bool is_host);
31 //------------------------------------------------------------
32 // lldb_private::Platform functions
33 //------------------------------------------------------------
34 virtual lldb_private::OptionGroupOptions*
35 GetConnectionOptions (lldb_private::CommandInterpreter& interpreter);
37 virtual lldb_private::Error
38 PutFile (const lldb_private::FileSpec& source,
39 const lldb_private::FileSpec& destination,
40 uint32_t uid = UINT32_MAX,
41 uint32_t gid = UINT32_MAX);
43 virtual lldb::user_id_t
44 OpenFile (const lldb_private::FileSpec& file_spec,
47 lldb_private::Error &error);
50 CloseFile (lldb::user_id_t fd,
51 lldb_private::Error &error);
54 ReadFile (lldb::user_id_t fd,
58 lldb_private::Error &error);
61 WriteFile (lldb::user_id_t fd,
65 lldb_private::Error &error);
67 virtual lldb::user_id_t
68 GetFileSize (const lldb_private::FileSpec& file_spec);
70 virtual lldb_private::Error
71 CreateSymlink(const char *src, const char *dst);
73 virtual lldb_private::Error
74 GetFile (const lldb_private::FileSpec& source,
75 const lldb_private::FileSpec& destination);
77 virtual lldb_private::ConstString
78 GetRemoteWorkingDirectory();
81 SetRemoteWorkingDirectory(const lldb_private::ConstString &path);
83 virtual lldb_private::Error
84 RunShellCommand (const char *command, // Shouldn't be NULL
85 const char *working_dir, // Pass NULL to use the current working directory
86 int *status_ptr, // Pass NULL if you don't want the process exit status
87 int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
88 std::string *command_output, // Pass NULL if you don't want the command output
89 uint32_t timeout_sec); // Timeout in seconds to wait for shell program to finish
91 virtual lldb_private::Error
92 MakeDirectory (const char *path, uint32_t mode);
94 virtual lldb_private::Error
95 GetFilePermissions (const char *path, uint32_t &file_permissions);
97 virtual lldb_private::Error
98 SetFilePermissions (const char *path, uint32_t file_permissions);
101 GetFileExists (const lldb_private::FileSpec& file_spec);
103 virtual lldb_private::Error
104 Unlink (const char *path);
107 GetPlatformSpecificConnectionInformation();
110 CalculateMD5 (const lldb_private::FileSpec& file_spec,
115 std::auto_ptr<lldb_private::OptionGroupOptions> m_options;
117 lldb::PlatformSP m_remote_platform_sp; // Allow multiple ways to connect to a remote POSIX-compliant OS
120 DISALLOW_COPY_AND_ASSIGN (PlatformPOSIX);
124 #endif // liblldb_PlatformPOSIX_h_