1 //===-- SBFileSpec.h --------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SBFileSpec_h_
10 #define LLDB_SBFileSpec_h_
12 #include "lldb/API/SBDefines.h"
16 class LLDB_API SBFileSpec {
20 SBFileSpec(const lldb::SBFileSpec &rhs);
22 SBFileSpec(const char *path); // Deprecated, use SBFileSpec (const char *path,
25 SBFileSpec(const char *path, bool resolve);
29 const SBFileSpec &operator=(const lldb::SBFileSpec &rhs);
31 explicit operator bool() const;
33 bool operator==(const SBFileSpec &rhs) const;
35 bool operator!=(const SBFileSpec &rhs) const;
41 bool ResolveExecutableLocation();
43 const char *GetFilename() const;
45 const char *GetDirectory() const;
47 void SetFilename(const char *filename);
49 void SetDirectory(const char *directory);
51 uint32_t GetPath(char *dst_path, size_t dst_len) const;
53 static int ResolvePath(const char *src_path, char *dst_path, size_t dst_len);
55 bool GetDescription(lldb::SBStream &description) const;
57 void AppendPathComponent(const char *file_or_directory);
60 friend class SBAttachInfo;
62 friend class SBCommandInterpreter;
63 friend class SBCompileUnit;
64 friend class SBDeclaration;
65 friend class SBFileSpecList;
66 friend class SBHostOS;
67 friend class SBLaunchInfo;
68 friend class SBLineEntry;
69 friend class SBModule;
70 friend class SBModuleSpec;
71 friend class SBPlatform;
72 friend class SBProcess;
73 friend class SBProcessInfo;
74 friend class SBSourceManager;
75 friend class SBTarget;
76 friend class SBThread;
78 SBFileSpec(const lldb_private::FileSpec &fspec);
80 void SetFileSpec(const lldb_private::FileSpec &fspec);
82 const lldb_private::FileSpec *operator->() const;
84 const lldb_private::FileSpec *get() const;
86 const lldb_private::FileSpec &operator*() const;
88 const lldb_private::FileSpec &ref() const;
90 std::unique_ptr<lldb_private::FileSpec> m_opaque_up;
95 #endif // LLDB_SBFileSpec_h_