windows_metadata/
value.rs

1use super::*;
2
3#[derive(Debug, PartialEq)]
4pub enum Value {
5    Bool(bool),
6    U8(u8),
7    I8(i8),
8    U16(u16),
9    I16(i16),
10    U32(u32),
11    I32(i32),
12    U64(u64),
13    I64(i64),
14    F32(f32),
15    F64(f64),
16    Utf8(String),
17    Utf16(String),
18    AttributeEnum(String, i32),
19}
20
21impl Value {
22    pub fn ty(&self) -> Type {
23        match self {
24            Self::Bool(..) => Type::Bool,
25            Self::U8(..) => Type::U8,
26            Self::I8(..) => Type::I8,
27            Self::U16(..) => Type::U16,
28            Self::I16(..) => Type::I16,
29            Self::U32(..) => Type::U32,
30            Self::I32(..) => Type::I32,
31            Self::U64(..) => Type::U64,
32            Self::I64(..) => Type::I64,
33            Self::F32(..) => Type::F32,
34            Self::F64(..) => Type::F64,
35            Self::Utf8(..) => Type::String,
36            Self::Utf16(..) => Type::String,
37            Self::AttributeEnum(..) => Type::AttributeEnum,
38        }
39    }
40}