Source for file Parse.php

Documentation is available at Parse.php

  1. <?PHP
  2. /**
  3. * FIT custom exception
  4. *
  5. * $Id$
  6. *
  7. * @author Luis A. Floreani <luis.floreani@gmail.com>
  8. * @author gERD Schaufelberger <gerd@php-tools.net>
  9. * @package FIT
  10. * @subpackage FileRunner
  11. * @license LGPL http://www.gnu.org/copyleft/lesser.html
  12. * @copyright Copyright (c) 2002-2005 Cunningham & Cunningham, Inc.
  13. */
  14.  
  15. /**
  16. * FIT custom exception: FileIO
  17. *
  18. * $e = new PHPFIT_Exception_FileIO( 'Message', 'path/to/file' );
  19. *
  20. * @version 0.1.0
  21. * @package FIT
  22. * @subpackage Exception
  23. */
  24. class PHPFIT_Exception_Parse extends Exception
  25. {
  26. /**
  27. * Exception string offset of parser
  28. * @var string
  29. */
  30. protected $offset = 0;
  31.  
  32. /**
  33. * constructor
  34. *
  35. * @param string $message exception message
  36. * @param string $offset
  37. * @see Exception
  38. */
  39. public function __construct( $msg, $offset )
  40. {
  41. $this->offset = $offset;
  42. $this->message = $msg;
  43. parent::__construct($message);
  44. }
  45. /**
  46. * receive offset
  47. * @return int parser offset
  48. */
  49. public function getOffset()
  50. {
  51. return $this->offset;
  52. }
  53.  
  54. /**
  55. * output as string
  56. * @return string of error message including offest
  57. */
  58. public function __toString() {
  59. return $this->message .' at ' . $this->offset;
  60. }
  61. }
  62. ?>

Documentation generated on Sun, 02 Apr 2006 23:21:39 +0000 by phpDocumentor 1.3.0RC5