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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
use std::fmt;
use super::filespec::SBFileSpec;
use super::stream::SBStream;
use sys;
pub struct SBModuleSpec {
pub raw: sys::SBModuleSpecRef,
}
impl SBModuleSpec {
pub fn wrap(raw: sys::SBModuleSpecRef) -> SBModuleSpec {
SBModuleSpec { raw: raw }
}
pub fn maybe_wrap(raw: sys::SBModuleSpecRef) -> Option<SBModuleSpec> {
if unsafe { sys::SBModuleSpecIsValid(raw) != 0 } {
Some(SBModuleSpec { raw: raw })
} else {
None
}
}
pub fn is_valid(&self) -> bool {
unsafe { sys::SBModuleSpecIsValid(self.raw) != 0 }
}
pub fn filespec(&self) -> SBFileSpec {
SBFileSpec::wrap(unsafe { sys::SBModuleSpecGetFileSpec(self.raw) })
}
pub fn set_filespec(&self, filespec: &SBFileSpec) {
unsafe { sys::SBModuleSpecSetFileSpec(self.raw, filespec.raw) }
}
pub fn platform_filespec(&self) -> SBFileSpec {
SBFileSpec::wrap(unsafe { sys::SBModuleSpecGetPlatformFileSpec(self.raw) })
}
pub fn set_platform_filespec(&self, filespec: &SBFileSpec) {
unsafe { sys::SBModuleSpecSetPlatformFileSpec(self.raw, filespec.raw) }
}
#[allow(missing_docs)]
pub fn symbol_filespec(&self) -> Option<SBFileSpec> {
SBFileSpec::maybe_wrap(unsafe { sys::SBModuleSpecGetSymbolFileSpec(self.raw) })
}
#[allow(missing_docs)]
pub fn set_symbol_filespec(&self, filespec: &SBFileSpec) {
unsafe { sys::SBModuleSpecSetSymbolFileSpec(self.raw, filespec.raw) }
}
#[allow(missing_docs)]
pub fn object_name(&self) -> &str {
unimplemented!();
}
#[allow(missing_docs)]
pub fn set_object_name(&self, _object_name: &str) {
unimplemented!();
}
#[allow(missing_docs)]
pub fn triple(&self) -> &str {
unimplemented!();
}
#[allow(missing_docs)]
pub fn set_triple(&self, _object_name: &str) {
unimplemented!();
}
#[allow(missing_docs)]
pub fn uuid_bytes(&self) -> &str {
unimplemented!();
}
#[allow(missing_docs)]
pub fn set_uuid_bytes(&self, _object_name: &str) {
unimplemented!();
}
}
impl fmt::Debug for SBModuleSpec {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
let stream = SBStream::new();
unsafe { sys::SBModuleSpecGetDescription(self.raw, stream.raw) };
write!(fmt, "SBModuleSpec {{ {} }}", stream.data())
}
}
impl Drop for SBModuleSpec {
fn drop(&mut self) {
unsafe { sys::DisposeSBModuleSpec(self.raw) };
}
}