.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 "RDF::vCard::Line 3pm" .TH RDF::vCard::Line 3pm 2024-03-07 "perl v5.38.2" "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 RDF::vCard::Line \- represents a line within a vCard .SH DESCRIPTION .IX Header "DESCRIPTION" Instances of this class correspond to lines within vCards, though they could potentially be used as basis for other RFC 2425\-based formats such as iCalendar. .SS Constructor .IX Subsection "Constructor" .IP \(bu 4 \&\f(CWnew(%options)\fR .Sp Returns a new RDF::vCard::Line object. .Sp The only options worth worrying about are: \fBproperty\fR (case-insensitive property name), \fBvalue\fR (arrayref or single string value), \fBtype_parameters\fR (hashref of property-related parameters). .Sp RDF::vCard::Entity overloads stringification, so you can do the following: .Sp .Vb 6 \& my $line = RDF::vCard::Line\->new( \& property => \*(Aqemail\*(Aq, \& value => \*(Aqjoe@example.net\*(Aq, \& type_parameters => { type=>[\*(AqPREF\*(Aq,\*(AqINTERNET\*(Aq] }, \& ); \& print "$line\en" if $line =~ /internet/i; .Ve .SS Methods .IX Subsection "Methods" .IP \(bu 4 \&\f(CWto_string()\fR .Sp Formats the line according to RFC 2425 and RFC 2426. .IP \(bu 4 \&\f(CW\*(C`add_to_model($model, $node)\*(C'\fR .Sp Given an RDF::Trine::Model and an RDF::Trine::Node representing the entity (i.e. vcard) that this line belongs to, adds triples to the model for this line. .IP \(bu 4 \&\f(CWproperty()\fR .Sp Returns the line's property \- e.g. "EMAIL". .IP \(bu 4 \&\f(CWproperty_node()\fR .Sp Returns the line's property as an RDF::Trine::Node that can be used as an RDF predicate. Returns undef if a sensible URI cannot be found. .IP \(bu 4 \&\f(CWproperty_order()\fR .Sp Returns a string which can be used to sort a list of lines into a sensible order. .IP \(bu 4 \&\f(CWvalue()\fR .Sp Returns an arrayref for the value. Each item in the arrayref could be a plain scalar, or an arrayref of scalars. For example the arrayref representing this name: .Sp .Vb 1 \& N:Smith;John;Edward,James .Ve .Sp which is the vCard representation of somebody with surname Smith, given name John and additional names (middle names) Edward and James, might be represented with the following "value" arrayref: .Sp .Vb 5 \& [ \& \*(AqSmith\*(Aq, \& \*(AqJohn\*(Aq, \& [\*(AqEdward\*(Aq, \*(AqJames\*(Aq], \& ] .Ve .Sp or maybe: .Sp .Vb 5 \& [ \& [\*(AqSmith\*(Aq], \& \*(AqJohn\*(Aq, \& [\*(AqEdward\*(Aq, \*(AqJames\*(Aq], \& ] .Ve .Sp That's why it's sometimes useful to have a normalised version of it... .IP \(bu 4 \&\f(CWnvalue()\fR .Sp Returns a normalised version of the arrayref for the value. It will always be an arrayref of arrayrefs. For example: .Sp .Vb 5 \& [ \& [\*(AqSmith\*(Aq], \& [\*(AqJohn\*(Aq], \& [\*(AqEdward\*(Aq, \*(AqJames\*(Aq], \& ] .Ve .IP \(bu 4 \&\f(CWvalue_node()\fR .Sp Returns the line's value as an RDF::Trine::Node that can be used as an RDF object. For some complex properties (e.g. ADR, GEO, ORG, N, etc) the result is not especially useful. .IP \(bu 4 \&\f(CWvalue_to_string()\fR .Sp Formats the line value according to RFC 2425 and RFC 2426. .IP \(bu 4 \&\f(CWtype_parameters()\fR .Sp Returns the type_parameters hashref. Here be monsters (kinda). .SH "SEE ALSO" .IX Header "SEE ALSO" RDF::vCard. .SH AUTHOR .IX Header "AUTHOR" Toby Inkster . .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright 2011 Toby Inkster .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.