summaryrefslogtreecommitdiff
path: root/include/lldb/API/SBFileSpec.h
blob: c3e7d91441dee20d40d834e79a817c0d5af158f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//===-- SBFileSpec.h --------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_SBFileSpec_h_
#define LLDB_SBFileSpec_h_

#include "lldb/API/SBDefines.h"

namespace lldb {

class LLDB_API SBFileSpec {
public:
  SBFileSpec();

  SBFileSpec(const lldb::SBFileSpec &rhs);

  SBFileSpec(const char *path); // Deprecated, use SBFileSpec (const char *path,
                                // bool resolve)

  SBFileSpec(const char *path, bool resolve);

  ~SBFileSpec();

  const SBFileSpec &operator=(const lldb::SBFileSpec &rhs);

  bool IsValid() const;

  bool Exists() const;

  bool ResolveExecutableLocation();

  const char *GetFilename() const;

  const char *GetDirectory() const;

  void SetFilename(const char *filename);

  void SetDirectory(const char *directory);

  uint32_t GetPath(char *dst_path, size_t dst_len) const;

  static int ResolvePath(const char *src_path, char *dst_path, size_t dst_len);

  bool GetDescription(lldb::SBStream &description) const;

  void AppendPathComponent(const char *file_or_directory);

private:
  friend class SBAttachInfo;
  friend class SBBlock;
  friend class SBCommandInterpreter;
  friend class SBCompileUnit;
  friend class SBDeclaration;
  friend class SBFileSpecList;
  friend class SBHostOS;
  friend class SBInitializerOptions;
  friend class SBLaunchInfo;
  friend class SBLineEntry;
  friend class SBModule;
  friend class SBModuleSpec;
  friend class SBPlatform;
  friend class SBProcess;
  friend class SBProcessInfo;
  friend class SBSourceManager;
  friend class SBTarget;
  friend class SBThread;

  SBFileSpec(const lldb_private::FileSpec &fspec);

  void SetFileSpec(const lldb_private::FileSpec &fspec);

  const lldb_private::FileSpec *operator->() const;

  const lldb_private::FileSpec *get() const;

  const lldb_private::FileSpec &operator*() const;

  const lldb_private::FileSpec &ref() const;

  std::unique_ptr<lldb_private::FileSpec> m_opaque_ap;
};

} // namespace lldb

#endif // LLDB_SBFileSpec_h_