PHP 클래스 TQ\Vcs\Buffer\StringBuffer

상속: implements TQ\Vcs\Buffer\FileBufferInterface
파일 보기 프로젝트 열기: teqneers/php-stream-wrapper-for-git 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$buffer string The buffer contents
$length integer The buffer length
$mode string The read/write mode
$objectInfo array The object info if available
$position integer The current pointer position

공개 메소드들

메소드 설명
__construct ( string $buffer, array $objectInfo = [], string $mode = 'r+' ) Creates a new file buffer with the given contents
close ( ) Closes the buffer
flush ( ) : boolean Flushes the buffer to the storage media
getBuffer ( ) : string Returns the complete contents of the buffer
getLength ( ) : integer Returns the current length
getPosition ( ) : integer Returns the current pointer position
getStat ( ) : array Returns the stat information for the buffer
isEof ( ) : boolean Returns true if the pointer is at the end of the buffer
read ( integer $count ) : string | null Reads $count bytes from the buffer
setPosition ( integer $position, integer $whence ) : boolean Sets the pointer position
write ( string $data ) : integer Writes the given date into the buffer at the current pointer position

메소드 상세

__construct() 공개 메소드

Creates a new file buffer with the given contents
public __construct ( string $buffer, array $objectInfo = [], string $mode = 'r+' )
$buffer string The buffer content
$objectInfo array The object info
$mode string The file mode

close() 공개 메소드

Closes the buffer
public close ( )

flush() 공개 메소드

Flushes the buffer to the storage media
public flush ( ) : boolean
리턴 boolean

getBuffer() 공개 메소드

Returns the complete contents of the buffer
public getBuffer ( ) : string
리턴 string

getLength() 공개 메소드

Returns the current length
public getLength ( ) : integer
리턴 integer

getPosition() 공개 메소드

Returns the current pointer position
public getPosition ( ) : integer
리턴 integer

getStat() 공개 메소드

Returns the stat information for the buffer
public getStat ( ) : array
리턴 array

isEof() 공개 메소드

Returns true if the pointer is at the end of the buffer
public isEof ( ) : boolean
리턴 boolean

read() 공개 메소드

Reads $count bytes from the buffer
public read ( integer $count ) : string | null
$count integer The number of bytes to read
리턴 string | null

setPosition() 공개 메소드

Sets the pointer position
public setPosition ( integer $position, integer $whence ) : boolean
$position integer The position in bytes
$whence integer The reference from where to measure $position (SEEK_SET, SEEK_CUR or SEEK_END)
리턴 boolean True if the position could be set

write() 공개 메소드

Writes the given date into the buffer at the current pointer position
public write ( string $data ) : integer
$data string The data to write
리턴 integer The number of bytes written

프로퍼티 상세

$buffer 보호되어 있는 프로퍼티

The buffer contents
protected string $buffer
리턴 string

$length 보호되어 있는 프로퍼티

The buffer length
protected int $length
리턴 integer

$mode 보호되어 있는 프로퍼티

The read/write mode
protected string $mode
리턴 string

$objectInfo 보호되어 있는 프로퍼티

The object info if available
protected array $objectInfo
리턴 array

$position 보호되어 있는 프로퍼티

The current pointer position
protected int $position
리턴 integer