.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Data::DPath::Context 3pm" .TH Data::DPath::Context 3pm "2019-10-24" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Data::DPath::Context \- Abstraction for a current context that enables incremental searches .SH "API METHODS" .IX Header "API METHODS" .ie n .SS "new ( %args )" .el .SS "new ( \f(CW%args\fP )" .IX Subsection "new ( %args )" Constructor; creates instance. .PP Args: .IP "give_references" 4 .IX Item "give_references" Default 0. If set to true value then results are references to the matched points in the data structure. .ie n .SS "match( $dpath )" .el .SS "match( \f(CW$dpath\fP )" .IX Subsection "match( $dpath )" Return array of all data that match the given DPath. .ie n .SS "matchr( $dpath )" .el .SS "matchr( \f(CW$dpath\fP )" .IX Subsection "matchr( $dpath )" Return array ref of all data that match the given DPath. .ie n .SS "isearch( $path_str )" .el .SS "isearch( \f(CW$path_str\fP )" .IX Subsection "isearch( $path_str )" Searches a path relative to current context and returns an iterator. See Iterator style for usage. .SS "\fBref()\fP" .IX Subsection "ref()" It returns the reference to the actual data from the current context's first element. This mostly makes sense on contexts returned by iterators as there is only one point there. .PP (Having the reference theoretically allows you to even change the data on this point. It's not yet clear what impact this has to currently active iterators, which \fBshould\fR still return the original data but that's not yet tested. So don't rely on that behaviour.) .SS "\fBderef()\fP" .IX Subsection "deref()" This is one dereference step on top of \fI\f(BIref()\fI\fR. It gives you the actual data found. Most of the time you want this. .SS "first_point" .IX Subsection "first_point" On a current context consisting on a set of points it returns the first point. This makes most sense with Iterator style \s-1API\s0 when the current iterator contains exactly one point. .SS "all_points" .IX Subsection "all_points" On a current context consisting on a set of points it returns all those. This method is a functional complement to \fIfirst_point\fR. .SH "UTILITY SUBS/METHODS" .IX Header "UTILITY SUBS/METHODS" .SS "_all" .IX Subsection "_all" Returns all values covered by current context. .PP If \f(CW\*(C`give_references\*(C'\fR is set to true value then results are references to the matched points in the data structure. .ie n .SS "_search( $dpath )" .el .SS "_search( \f(CW$dpath\fP )" .IX Subsection "_search( $dpath )" Return new context for a DPath relative to current context. .SS "_filter_points" .IX Subsection "_filter_points" Evaluates the filter condition in brackets. It differenciates between simple integers, which are taken as array index, and all other conditions, which are taken as evaled perl expression in a grep like expression onto the set of points found by current step. .SS "current_points" .IX Subsection "current_points" Attribute / accessor. .SS "give_references" .IX Subsection "give_references" Attribute / accessor. .SH "aliased classes" .IX Header "aliased classes" That's just to make Pod::Coverage happy which does not handle aliased modules. .SS "Context" .IX Subsection "Context" .SS "Point" .IX Subsection "Point" .SS "Step" .IX Subsection "Step" .SH "AUTHOR" .IX Header "AUTHOR" Steffen Schwigon .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2019 by Steffen Schwigon. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.