.\" -*- 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 "LaTeXML::Common::Locator 3pm" .TH LaTeXML::Common::Locator 3pm 2024-02-27 "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 "LaTeXML::Common::Locator" \- represents a reference to a point or range in the source file. .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`LaTeXML::Common::Locator\*(C'\fR contains a reference to a point or range within a source file. This data structure is intended to be used both programtically (for "source references") and to display error messages to the user. .PP It extends LaTeXML::Common::Object. .SS "Locator Creation" .IX Subsection "Locator Creation" .ie n .IP """$locator = LaTeXML::Common::Locator\->new($source, $fromLine, $fromCol, $toLine, $toCol);""" 4 .el .IP "\f(CW$locator = LaTeXML::Common::Locator\->new($source, $fromLine, $fromCol, $toLine, $toCol);\fR" 4 .IX Item "$locator = LaTeXML::Common::Locator->new($source, $fromLine, $fromCol, $toLine, $toCol);" Creates a new locator. \f(CW$source\fR should be a string containing the full path of the source file, an empty string in case of a literal string, or undef in case of an anonymous string. \f(CW$fromLine\fR and \f(CW$fromCol\fR should be integers containing the line and column numbers of the start of the range in the source file, or undef if unknown. \f(CW$toLine\fR and \f(CW$toCol\fR should be the integers containing the line and column numbers of the end of the range, or undef if a point is being referred to. .ie n .IP """$locator = LaTeXML::Common::Locator\->newRange($from, $to);""" 4 .el .IP "\f(CW$locator = LaTeXML::Common::Locator\->newRange($from, $to);\fR" 4 .IX Item "$locator = LaTeXML::Common::Locator->newRange($from, $to);" Creates a new locator, starting at the locator \f(CW$from\fR and ending at the locator \f(CW$to\fR. Either locator may be undef, in which case the other one is returned. .SS Methods .IX Subsection "Methods" .ie n .IP """$str = $locator\->toString;""" 4 .el .IP "\f(CW$str = $locator\->toString;\fR" 4 .IX Item "$str = $locator->toString;" Turns this locator into a short string for output in user messages. .ie n .IP """$str = $locator\->stringify;""" 4 .el .IP "\f(CW$str = $locator\->stringify;\fR" 4 .IX Item "$str = $locator->stringify;" Turns this locator into a long string, including the full filename of the input. .ie n .IP """$attr = $locator\->toAttribute;""" 4 .el .IP "\f(CW$attr = $locator\->toAttribute;\fR" 4 .IX Item "$attr = $locator->toAttribute;" Turns this locator into an XPointer expression, for usage within an XML attribute. .ie n .IP """$isRange = $locator\->isRange;""" 4 .el .IP "\f(CW$isRange = $locator\->isRange;\fR" 4 .IX Item "$isRange = $locator->isRange;" Checks if this locator points to a range or a point. .ie n .IP """$source = $locator\->getShortSource($stringSource);""" 4 .el .IP "\f(CW$source = $locator\->getShortSource($stringSource);\fR" 4 .IX Item "$source = $locator->getShortSource($stringSource);" Gets a short string referring to the source of this locator. \&\f(CW$stringSource\fR will be used if the source refers to an anonymous or literal string input. .ie n .IP """$from = $locator\->getFromLocator;""" 4 .el .IP "\f(CW$from = $locator\->getFromLocator;\fR" 4 .IX Item "$from = $locator->getFromLocator;" Gets a locator pointing to the first point in the range of this locator. Works for both point and range locators. .ie n .IP """$from = $locator\->getToLocator;""" 4 .el .IP "\f(CW$from = $locator\->getToLocator;\fR" 4 .IX Item "$from = $locator->getToLocator;" Gets a locator pointing to the last point in the range of this locator. Does not work for point locators. .SH AUTHOR .IX Header "AUTHOR" Bruce Miller Tom Wiesing .SH COPYRIGHT .IX Header "COPYRIGHT" Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US.