SBFileSpec.h revision 0a8dcacde404c520f1131c641041dceb9f68b6fa
1//===-- SBFileSpec.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_SBFileSpec_h_
11#define LLDB_SBFileSpec_h_
12
13#include "lldb/API/SBDefines.h"
14
15namespace lldb {
16
17class SBFileSpec
18{
19public:
20    SBFileSpec ();
21
22    SBFileSpec (const lldb::SBFileSpec &rhs);
23
24    SBFileSpec (const char *path);// Deprected, use SBFileSpec (const char *path, bool resolve)
25
26    SBFileSpec (const char *path, bool resolve);
27
28    ~SBFileSpec ();
29
30    const SBFileSpec &
31    operator = (const lldb::SBFileSpec &rhs);
32
33    bool
34    IsValid() const;
35
36    bool
37    Exists () const;
38
39    bool
40    ResolveExecutableLocation ();
41
42    const char *
43    GetFilename() const;
44
45    const char *
46    GetDirectory() const;
47
48    uint32_t
49    GetPath (char *dst_path, size_t dst_len) const;
50
51    static int
52    ResolvePath (const char *src_path, char *dst_path, size_t dst_len);
53
54    bool
55    GetDescription (lldb::SBStream &description) const;
56
57private:
58    friend class SBAttachInfo;
59    friend class SBBlock;
60    friend class SBCompileUnit;
61    friend class SBFileSpecList;
62    friend class SBHostOS;
63    friend class SBLaunchInfo;
64    friend class SBLineEntry;
65    friend class SBModule;
66    friend class SBProcess;
67    friend class SBSourceManager;
68    friend class SBThread;
69    friend class SBTarget;
70
71    void
72    SetFileSpec (const lldb_private::FileSpec& fs);
73
74    const lldb_private::FileSpec *
75    operator->() const;
76
77    const lldb_private::FileSpec *
78    get() const;
79
80    const lldb_private::FileSpec &
81    operator*() const;
82
83    const lldb_private::FileSpec &
84    ref() const;
85
86    std::auto_ptr <lldb_private::FileSpec> m_opaque_ap;
87};
88
89
90} // namespace lldb
91
92#endif // LLDB_SBFileSpec_h_
93