1 //===-- SBPlatform.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 LLDB_SBPlatform_h_
11 #define LLDB_SBPlatform_h_
13 #include "lldb/API/SBDefines.h"
17 struct PlatformConnectOptions;
18 struct PlatformShellCommand;
24 class LLDB_API SBPlatformConnectOptions
27 SBPlatformConnectOptions (const char *url);
29 SBPlatformConnectOptions (const SBPlatformConnectOptions &rhs);
31 ~SBPlatformConnectOptions ();
34 operator=(const SBPlatformConnectOptions &rhs);
40 SetURL(const char *url);
46 EnableRsync (const char *options,
47 const char *remote_path_prefix,
48 bool omit_remote_hostname);
54 GetLocalCacheDirectory();
57 SetLocalCacheDirectory(const char *path);
59 PlatformConnectOptions *m_opaque_ptr;
62 class LLDB_API SBPlatformShellCommand
65 SBPlatformShellCommand (const char *shell_command);
67 SBPlatformShellCommand (const SBPlatformShellCommand &rhs);
69 ~SBPlatformShellCommand();
78 SetCommand(const char *shell_command);
81 GetWorkingDirectory ();
84 SetWorkingDirectory (const char *path);
90 SetTimeoutSeconds (uint32_t sec);
102 friend class SBPlatform;
104 PlatformShellCommand *m_opaque_ptr;
107 class LLDB_API SBPlatform
113 SBPlatform (const char *platform_name);
124 GetWorkingDirectory();
127 SetWorkingDirectory(const char *path);
133 ConnectRemote (SBPlatformConnectOptions &connect_options);
141 //----------------------------------------------------------------------
142 // The following functions will work if the platform is connected
143 //----------------------------------------------------------------------
157 GetOSMajorVersion ();
160 GetOSMinorVersion ();
163 GetOSUpdateVersion ();
166 Put (SBFileSpec &src, SBFileSpec &dst);
169 Get (SBFileSpec &src, SBFileSpec &dst);
172 Install (SBFileSpec& src, SBFileSpec& dst);
175 Run (SBPlatformShellCommand &shell_command);
178 Launch (SBLaunchInfo &launch_info);
181 Kill (const lldb::pid_t pid);
184 MakeDirectory (const char *path, uint32_t file_permissions = eFilePermissionsDirectoryDefault);
187 GetFilePermissions (const char *path);
190 SetFilePermissions (const char *path, uint32_t file_permissions);
193 GetUnixSignals() const;
197 friend class SBDebugger;
198 friend class SBTarget;
204 SetSP (const lldb::PlatformSP& platform_sp);
207 ExecuteConnected (const std::function<lldb_private::Error(const lldb::PlatformSP&)>& func);
209 lldb::PlatformSP m_opaque_sp;
214 #endif // LLDB_SBPlatform_h_