]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/Host/posix/HostInfoPosix.h
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / include / lldb / Host / posix / HostInfoPosix.h
1 //===-- HostInfoPosix.h -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef lldb_Host_posix_HostInfoPosix_h_
11 #define lldb_Host_posix_HostInfoPosix_h_
12
13 #include "lldb/Host/FileSpec.h"
14 #include "lldb/Host/HostInfoBase.h"
15
16 namespace lldb_private {
17
18 class HostInfoPosix : public HostInfoBase {
19   friend class HostInfoBase;
20
21 public:
22   static size_t GetPageSize();
23   static bool GetHostname(std::string &s);
24   static const char *LookupUserName(uint32_t uid, std::string &user_name);
25   static const char *LookupGroupName(uint32_t gid, std::string &group_name);
26
27   static uint32_t GetUserID();
28   static uint32_t GetGroupID();
29   static uint32_t GetEffectiveUserID();
30   static uint32_t GetEffectiveGroupID();
31
32   static FileSpec GetDefaultShell();
33
34   static bool GetEnvironmentVar(const std::string &var_name, std::string &var);
35
36 protected:
37   static bool ComputeSupportExeDirectory(FileSpec &file_spec);
38   static bool ComputeHeaderDirectory(FileSpec &file_spec);
39   static bool ComputePythonDirectory(FileSpec &file_spec);
40   static bool ComputeClangDirectory(FileSpec &file_spec);
41   static bool ComputePathRelativeToLibrary(FileSpec &file_spec,
42                                            llvm::StringRef dir);
43 };
44 }
45
46 #endif