Skip to main content

easyofd_core/model/
creator.rs

1//! OFD 创建者信息。
2//!
3//! 对应 Java: org.ofdrw.core.basicStructure.ofd.docInfo.CT_DocInfo (Creator/CreatorVersion)
4
5/// 创建应用程序信息(ofd:Creator + ofd:CreatorVersion)。
6///
7/// 对应 Java: ofdrw Creator + CreatorVersion 字段。
8#[derive(Debug, Clone, PartialEq, Eq, Default)]
9pub struct Creator {
10    /// 创建应用程序名称(ofd:Creator)。
11    pub name: Option<String>,
12    /// 创建应用程序版本(ofd:CreatorVersion)。
13    pub version: Option<String>,
14}
15
16impl Creator {
17    /// 创建新的 Creator。
18    pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self {
19        Self {
20            name: Some(name.into()),
21            version: Some(version.into()),
22        }
23    }
24}