LLDB mainline
SBFileSpec.h
Go to the documentation of this file.
1//===-- SBFileSpec.h --------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_API_SBFILESPEC_H
10#define LLDB_API_SBFILESPEC_H
11
12#include "lldb/API/SBDefines.h"
13
14namespace lldb {
15
17public:
18 SBFileSpec();
19
20 SBFileSpec(const lldb::SBFileSpec &rhs);
21
23 "Use the other constructor to determine if this the file "
24 "spec should be resolved",
25 "SBFileSpec(const char *, bool)")
26 SBFileSpec(const char *path);
27
28 SBFileSpec(const char *path, bool resolve);
29
31
32 const SBFileSpec &operator=(const lldb::SBFileSpec &rhs);
33
34 explicit operator bool() const;
35
36 bool operator==(const SBFileSpec &rhs) const;
37
38 bool operator!=(const SBFileSpec &rhs) const;
39
40 bool IsValid() const;
41
42 bool Exists() const;
43
45
46 const char *GetFilename() const;
47
48 const char *GetDirectory() const;
49
50 void SetFilename(const char *filename);
51
52 void SetDirectory(const char *directory);
53
54 uint32_t GetPath(char *dst_path, size_t dst_len) const;
55
56 static int ResolvePath(const char *src_path, char *dst_path, size_t dst_len);
57
58 bool GetDescription(lldb::SBStream &description) const;
59
60 void AppendPathComponent(const char *file_or_directory);
61
62private:
63 friend class SBAttachInfo;
64 friend class SBBlock;
66 friend class SBCompileUnit;
67 friend class SBDeclaration;
68 friend class SBFileSpecList;
69 friend class SBHostOS;
70 friend class SBLaunchInfo;
71 friend class SBLineEntry;
72 friend class SBModule;
73 friend class SBModuleSpec;
74 friend class SBPlatform;
75 friend class SBProcess;
76 friend class SBProcessInfo;
77 friend class SBSourceManager;
78 friend class SBTarget;
79 friend class SBThread;
80 friend class SBTrace;
81 friend class SBSaveCoreOptions;
82
83 SBFileSpec(const lldb_private::FileSpec &fspec);
84
85 void SetFileSpec(const lldb_private::FileSpec &fspec);
86
87 const lldb_private::FileSpec *operator->() const;
88
89 const lldb_private::FileSpec *get() const;
90
91 const lldb_private::FileSpec &operator*() const;
92
93 const lldb_private::FileSpec &ref() const;
94
96};
97
98} // namespace lldb
99
100#endif // LLDB_API_SBFILESPEC_H
#define LLDB_API
Definition SBDefines.h:28
void SetFilename(const char *filename)
void SetFileSpec(const lldb_private::FileSpec &fspec)
friend class SBLaunchInfo
Definition SBFileSpec.h:70
void AppendPathComponent(const char *file_or_directory)
static int ResolvePath(const char *src_path, char *dst_path, size_t dst_len)
bool IsValid() const
friend class SBProcess
Definition SBFileSpec.h:75
LLDB_DEPRECATED_FIXME("Use the other constructor to determine if this the file " "spec should be resolved", "SBFileSpec(const char *, bool)") SBFileSpec(const char *path)
friend class SBSaveCoreOptions
Definition SBFileSpec.h:81
friend class SBTarget
Definition SBFileSpec.h:78
friend class SBModule
Definition SBFileSpec.h:72
friend class SBDeclaration
Definition SBFileSpec.h:67
friend class SBProcessInfo
Definition SBFileSpec.h:76
const lldb_private::FileSpec & ref() const
friend class SBTrace
Definition SBFileSpec.h:80
uint32_t GetPath(char *dst_path, size_t dst_len) const
bool Exists() const
const lldb_private::FileSpec * get() const
const char * GetFilename() const
friend class SBThread
Definition SBFileSpec.h:79
friend class SBModuleSpec
Definition SBFileSpec.h:73
bool GetDescription(lldb::SBStream &description) const
friend class SBLineEntry
Definition SBFileSpec.h:71
friend class SBBlock
Definition SBFileSpec.h:64
bool ResolveExecutableLocation()
friend class SBHostOS
Definition SBFileSpec.h:69
void SetDirectory(const char *directory)
const char * GetDirectory() const
friend class SBCompileUnit
Definition SBFileSpec.h:66
friend class SBFileSpecList
Definition SBFileSpec.h:68
friend class SBSourceManager
Definition SBFileSpec.h:77
std::unique_ptr< lldb_private::FileSpec > m_opaque_up
Definition SBFileSpec.h:95
friend class SBPlatform
Definition SBFileSpec.h:74
friend class SBAttachInfo
Definition SBFileSpec.h:63
friend class SBCommandInterpreter
Definition SBFileSpec.h:65
A class that represents a running process on the host machine.