. */ /** * Stores the file name and line number of a XML file * * @author Andreas Aderhold * @copyright © 2001,2002 THYRELL. All rights reserved * @version $Revision: 905 $ $Date: 2010-10-05 18:28:03 +0200 (Tue, 05 Oct 2010) $ * @access public * @package phing.parser */ class Location { private $fileName; private $lineNumber; private $columnNumber; /** * Constructs the location consisting of a file name and line number * * @param string the filename * @param integer the line number * @param integer the column number * @access public */ function Location($fileName = null, $lineNumber = null, $columnNumber = null) { $this->fileName = $fileName; $this->lineNumber = $lineNumber; $this->columnNumber = $columnNumber; } /** * Returns the file name, line number and a trailing space. * * An error message can be appended easily. For unknown locations, * returns empty string. * * @return string the string representation of this Location object * @access public */ function toString() { $buf = ""; if ($this->fileName !== null) { $buf.=$this->fileName; if ($this->lineNumber !== null) { $buf.= ":".$this->lineNumber; } $buf.=":".$this->columnNumber; } return (string) $buf; } function __toString () { return $this->toString(); } }