ifc_classification/library/
information.rs1use crate::view::{
3 borrowed_entity, optional_ref, optional_text, required_text, ClassificationView,
4};
5use crate::ClassificationResult;
6borrowed_entity!(LibraryInformation, "IFCLIBRARYINFORMATION");
7impl<'m> LibraryInformation<'m> {
8 pub fn name(self) -> ClassificationResult<&'m str> {
10 required_text("IFCLIBRARYINFORMATION", self.id(), self.entity(), 0, "Name")
11 }
12 pub fn version(self) -> ClassificationResult<Option<&'m str>> {
14 optional_text(
15 "IFCLIBRARYINFORMATION",
16 self.id(),
17 self.entity(),
18 1,
19 "Version",
20 )
21 }
22 pub fn publisher_id(self) -> ClassificationResult<Option<ifc_model::EntityId>> {
24 optional_ref(
25 "IFCLIBRARYINFORMATION",
26 self.id(),
27 self.entity(),
28 2,
29 "Publisher",
30 )
31 }
32 pub fn version_date(self) -> ClassificationResult<Option<&'m str>> {
34 optional_text(
35 "IFCLIBRARYINFORMATION",
36 self.id(),
37 self.entity(),
38 3,
39 "VersionDate",
40 )
41 }
42 pub fn location(self) -> ClassificationResult<Option<&'m str>> {
44 optional_text(
45 "IFCLIBRARYINFORMATION",
46 self.id(),
47 self.entity(),
48 4,
49 "Location",
50 )
51 }
52 pub fn description(self) -> ClassificationResult<Option<&'m str>> {
54 optional_text(
55 "IFCLIBRARYINFORMATION",
56 self.id(),
57 self.entity(),
58 5,
59 "Description",
60 )
61 }
62}
63impl<'m> ClassificationView<'m> {
64 pub fn libraries(self) -> impl Iterator<Item = LibraryInformation<'m>> + 'm {
66 self.model()
67 .of_type("IFCLIBRARYINFORMATION")
68 .map(|(id, e)| LibraryInformation::from_known(id, e))
69 }
70}