|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00033 class Zend_Gdata_MimeBodyString 00034 { 00035 00041 protected $_sourceString = ''; 00042 00047 protected $_bytesRead = 0; 00048 00054 public function __construct($sourceString) 00055 { 00056 $this->_sourceString = $sourceString; 00057 $this->_bytesRead = 0; 00058 } 00059 00066 public function read($bytesRequested) 00067 { 00068 $len = strlen($this->_sourceString); 00069 if($this->_bytesRead == $len) { 00070 return FALSE; 00071 } else if($bytesRequested > $len - $this->_bytesRead) { 00072 $bytesRequested = $len - $this->_bytesRead; 00073 } 00074 00075 $buffer = substr($this->_sourceString, $this->_bytesRead, $bytesRequested); 00076 $this->_bytesRead += $bytesRequested; 00077 00078 return $buffer; 00079 } 00080 00086 public function getSize() 00087 { 00088 return strlen($this->_sourceString); 00089 } 00090 00091 00092 }