SBFileSpec.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. #ifndef LLDB_API_SBFILESPEC_H
  9. #define LLDB_API_SBFILESPEC_H
  10. #include "lldb/API/SBDefines.h"
  11. namespace lldb {
  12. class LLDB_API SBFileSpec {
  13. public:
  14. SBFileSpec();
  15. SBFileSpec(const lldb::SBFileSpec &rhs);
  16. SBFileSpec(const char *path); // Deprecated, use SBFileSpec (const char *path,
  17. // bool resolve)
  18. SBFileSpec(const char *path, bool resolve);
  19. ~SBFileSpec();
  20. const SBFileSpec &operator=(const lldb::SBFileSpec &rhs);
  21. explicit operator bool() const;
  22. bool operator==(const SBFileSpec &rhs) const;
  23. bool operator!=(const SBFileSpec &rhs) const;
  24. bool IsValid() const;
  25. bool Exists() const;
  26. bool ResolveExecutableLocation();
  27. const char *GetFilename() const;
  28. const char *GetDirectory() const;
  29. void SetFilename(const char *filename);
  30. void SetDirectory(const char *directory);
  31. uint32_t GetPath(char *dst_path, size_t dst_len) const;
  32. static int ResolvePath(const char *src_path, char *dst_path, size_t dst_len);
  33. bool GetDescription(lldb::SBStream &description) const;
  34. void AppendPathComponent(const char *file_or_directory);
  35. private:
  36. friend class SBAttachInfo;
  37. friend class SBBlock;
  38. friend class SBCommandInterpreter;
  39. friend class SBCompileUnit;
  40. friend class SBDeclaration;
  41. friend class SBFileSpecList;
  42. friend class SBHostOS;
  43. friend class SBLaunchInfo;
  44. friend class SBLineEntry;
  45. friend class SBModule;
  46. friend class SBModuleSpec;
  47. friend class SBPlatform;
  48. friend class SBProcess;
  49. friend class SBProcessInfo;
  50. friend class SBSourceManager;
  51. friend class SBTarget;
  52. friend class SBThread;
  53. SBFileSpec(const lldb_private::FileSpec &fspec);
  54. void SetFileSpec(const lldb_private::FileSpec &fspec);
  55. const lldb_private::FileSpec *operator->() const;
  56. const lldb_private::FileSpec *get() const;
  57. const lldb_private::FileSpec &operator*() const;
  58. const lldb_private::FileSpec &ref() const;
  59. std::unique_ptr<lldb_private::FileSpec> m_opaque_up;
  60. };
  61. } // namespace lldb
  62. #endif // LLDB_API_SBFILESPEC_H