9820a10fcc904016eed885435514bc2e3819df82.svn-base 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4 |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2002 The PHP Group |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.02 of the PHP license, |
  9. // | that is bundled with this package in the file LICENSE, and is |
  10. // | available at through the world-wide-web at |
  11. // | http://www.php.net/license/2_02.txt. |
  12. // | If you did not receive a copy of the PHP license and are unable to |
  13. // | obtain it through the world-wide-web, please send a note to |
  14. // | license@php.net so we can mail you a copy immediately. |
  15. // +----------------------------------------------------------------------+
  16. // | Author: Xavier Noguer <xnoguer@php.net> |
  17. // | Based on OLE::Storage_Lite by Kawai, Takanori |
  18. // +----------------------------------------------------------------------+
  19. //
  20. // $Id: File.php,v 1.11 2007/02/13 21:00:42 schmidt Exp $
  21. /**
  22. * Class for creating File PPS's for OLE containers
  23. *
  24. * @author Xavier Noguer <xnoguer@php.net>
  25. * @category PHPExcel
  26. * @package PHPExcel_Shared_OLE
  27. */
  28. class PHPExcel_Shared_OLE_PPS_File extends PHPExcel_Shared_OLE_PPS
  29. {
  30. /**
  31. * The constructor
  32. *
  33. * @access public
  34. * @param string $name The name of the file (in Unicode)
  35. * @see OLE::Asc2Ucs()
  36. */
  37. public function __construct($name)
  38. {
  39. parent::__construct(
  40. null,
  41. $name,
  42. PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE,
  43. null,
  44. null,
  45. null,
  46. null,
  47. null,
  48. '',
  49. array());
  50. }
  51. /**
  52. * Initialization method. Has to be called right after OLE_PPS_File().
  53. *
  54. * @access public
  55. * @return mixed true on success
  56. */
  57. public function init()
  58. {
  59. return true;
  60. }
  61. /**
  62. * Append data to PPS
  63. *
  64. * @access public
  65. * @param string $data The data to append
  66. */
  67. public function append($data)
  68. {
  69. $this->_data .= $data;
  70. }
  71. /**
  72. * Returns a stream for reading this file using fread() etc.
  73. * @return resource a read-only stream
  74. */
  75. public function getStream()
  76. {
  77. $this->ole->getStream($this);
  78. }
  79. }