.\" 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 "YAML::PP::Emitter 3pm" .TH YAML::PP::Emitter 3pm "2020-09-11" "perl v5.30.3" "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" YAML::PP::Emitter \- Emitting events .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& my $emitter = YAML::PP::Emitter\->new( \& indent => 4, \& ); \& \& $emitter\->init; \& \& $emitter\->stream_start_event; \& $emitter\->document_start_event({ implicit => 1 }); \& $emitter\->sequence_start_event; \& $emitter\->scalar_event({ value => $input, style => $style }); \& $emitter\->sequence_end_event; \& $emitter\->document_end_event({ implicit => 1 }); \& $emitter\->stream_end_event; \& \& my $yaml = $emitter\->writer\->output; \& $emitter\->finish; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The emitter emits events to \s-1YAML.\s0 It provides methods for each event type. The arguments are mostly the same as the events from YAML::PP::Parser. .SH "METHODS" .IX Header "METHODS" .IP "new" 4 .IX Item "new" .Vb 3 \& my $emitter = YAML::PP::Emitter\->new( \& indent => 4, \& ); .Ve .Sp Constructor. Currently takes these options: .RS 4 .IP "indent" 4 .IX Item "indent" .PD 0 .IP "writer" 4 .IX Item "writer" .RE .RS 4 .RE .IP "stream_start_event, stream_end_event, document_start_event, document_end_event, sequence_start_event, sequence_end_event, mapping_start_event, mapping_end_event, scalar_event, alias_event" 4 .IX Item "stream_start_event, stream_end_event, document_start_event, document_end_event, sequence_start_event, sequence_end_event, mapping_start_event, mapping_end_event, scalar_event, alias_event" .IP "indent, set_indent" 4 .IX Item "indent, set_indent" .PD Getter/setter for number of indentation spaces. .Sp \&\s-1TODO:\s0 Currently sequences are always zero-indented. .IP "writer, set_writer" 4 .IX Item "writer, set_writer" Getter/setter for the writer object. By default YAML::PP::Writer. You can pass your own writer if you want to output the resulting \s-1YAML\s0 yorself. .IP "init" 4 .IX Item "init" Initialize .IP "finish" 4 .IX Item "finish"