1PFT::Map::Index(3) User Contributed Perl Documentation PFT::Map::Index(3)
2
3
4
6 PFT::Map::Index - Resolve symbols in PFT Entries
7
9 Explicit construction:
10
11 use PFT::Map::Index;
12
13 die unless $map->isa('PFT::Map');
14 my $index = PFT::Map::Index->new($map);
15
16 Using map property:
17
18 my $index = $map->index;
19
20 Resolution:
21
22 die unless $node->isa('PFT::Map::Node');
23 die unless $sym->isa('PFT::Text::Symbol');
24 $index->resolve($node, $sym);
25
27 A "PFT::Map::Index" object handles the unique identifiers of content
28 items mapped in a "PFT::Map" object. It can be used to resolve symbols
29 of a "PFT::Map::Node", or to query the map (e.g. the set of entries
30 between date X and date Y)
31
32 Properties
33 map Reference to the associated map
34
35 Methods
36 content_id
37 Given a PFT::Content::Base (or any subclass) object, returns a
38 string uniquely identifying it across the site. E.g.:
39
40 my $id = $resolver->content_id($content);
41 my $id = $resolver->content_id($virtual_page, $hdr);
42 my $id = $resolver->content_id(undef, $hdr);
43
44 The header is optional for the first two forms: unless supplied it
45 will be retrieved by the content. In the third form the content is
46 not supplied, so the header is mandatory.
47
48 resolve
49 The function resolves a symbol retrieved from the text of a
50 "PFT::Map::Node". The returned value will be one of the following:
51
52 A list of nodes (i.e. a "PFT::Map::Node" instances);
53 A list of strings (e.g. "http://manpages.org");
54 An empty list (meaning: failed resolution).
55
56
57
58perl v5.34.0 2022-01-21 PFT::Map::Index(3)