SBFileSpec.h revision 03c8ee5aeafcd6c43f10002a4f8096af01780f86
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#ifndef SWIG
31    const SBFileSpec &
32    operator = (const lldb::SBFileSpec &rhs);
33#endif
34
35    bool
36    IsValid() const;
37
38    bool
39    Exists () const;
40
41    bool
42    ResolveExecutableLocation ();
43
44    const char *
45    GetFilename() const;
46
47    const char *
48    GetDirectory() const;
49
50    uint32_t
51    GetPath (char *dst_path, size_t dst_len) const;
52
53    static int
54    ResolvePath (const char *src_path, char *dst_path, size_t dst_len);
55
56    bool
57    GetDescription (lldb::SBStream &description) const;
58
59private:
60    friend class SBBlock;
61    friend class SBCompileUnit;
62    friend class SBFileSpecList;
63    friend class SBHostOS;
64    friend class SBLineEntry;
65    friend class SBModule;
66    friend class SBProcess;
67    friend class SBSourceManager_impl;
68    friend class SBThread;
69    friend class SBTarget;
70
71    void
72    SetFileSpec (const lldb_private::FileSpec& fs);
73#ifndef SWIG
74
75    const lldb_private::FileSpec *
76    operator->() const;
77
78    const lldb_private::FileSpec *
79    get() const;
80
81    const lldb_private::FileSpec &
82    operator*() const;
83
84    const lldb_private::FileSpec &
85    ref() const;
86
87#endif
88
89    std::auto_ptr <lldb_private::FileSpec> m_opaque_ap;
90};
91
92
93} // namespace lldb
94
95#endif // LLDB_SBFileSpec_h_
96