add more trivial types
parent
8a37b359ca
commit
2a8664e9bf
|
@ -254,6 +254,14 @@ pub enum SimpleType {
|
||||||
QUint32,
|
QUint32,
|
||||||
#[serde(rename = "quint64")]
|
#[serde(rename = "quint64")]
|
||||||
QUint64,
|
QUint64,
|
||||||
|
#[serde(rename = "qintptr")]
|
||||||
|
QIntPtr,
|
||||||
|
#[serde(rename = "quintptr")]
|
||||||
|
QUintPtr,
|
||||||
|
#[serde(rename = "*mut void")]
|
||||||
|
VoidPtrMut,
|
||||||
|
#[serde(rename = "*const void")]
|
||||||
|
VoidPtrConst,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SimpleTypePrivate for SimpleType {
|
impl SimpleTypePrivate for SimpleType {
|
||||||
|
@ -273,6 +281,10 @@ impl SimpleTypePrivate for SimpleType {
|
||||||
SimpleType::QUint16 => "quint16",
|
SimpleType::QUint16 => "quint16",
|
||||||
SimpleType::QUint32 => "quint32",
|
SimpleType::QUint32 => "quint32",
|
||||||
SimpleType::QUint64 => "quint64",
|
SimpleType::QUint64 => "quint64",
|
||||||
|
SimpleType::QIntPtr => "qintptr",
|
||||||
|
SimpleType::QUintPtr => "quintptr",
|
||||||
|
SimpleType::VoidPtrMut => "void*",
|
||||||
|
SimpleType::VoidPtrConst => "void const*",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn cpp_set_type(&self) -> &str {
|
fn cpp_set_type(&self) -> &str {
|
||||||
|
@ -305,6 +317,10 @@ impl SimpleTypePrivate for SimpleType {
|
||||||
SimpleType::QUint16 => "u16",
|
SimpleType::QUint16 => "u16",
|
||||||
SimpleType::QUint32 => "u32",
|
SimpleType::QUint32 => "u32",
|
||||||
SimpleType::QUint64 => "u64",
|
SimpleType::QUint64 => "u64",
|
||||||
|
SimpleType::QIntPtr => "isize",
|
||||||
|
SimpleType::QUintPtr => "usize",
|
||||||
|
SimpleType::VoidPtrMut => "*mut std::ffi::c_void",
|
||||||
|
SimpleType::VoidPtrConst => "*const std::ffi::c_void",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn rust_type_init(&self) -> &str {
|
fn rust_type_init(&self) -> &str {
|
||||||
|
@ -314,6 +330,8 @@ impl SimpleTypePrivate for SimpleType {
|
||||||
SimpleType::Bool => "false",
|
SimpleType::Bool => "false",
|
||||||
SimpleType::Float | SimpleType::Double => "0.0",
|
SimpleType::Float | SimpleType::Double => "0.0",
|
||||||
SimpleType::Void => "()",
|
SimpleType::Void => "()",
|
||||||
|
SimpleType::VoidPtrMut => "std::ptr::null_mut()",
|
||||||
|
SimpleType::VoidPtrConst => "std::ptr::null()",
|
||||||
_ => "0",
|
_ => "0",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue