Default implementation for file contents based on simple strings.

since 1.3.0

 Methods

constructor

__construct(string $content) 

Parameters

$content

string

for backwards compatibility with vfsStreamFile::bytesRead()

bytesRead() : int
Inherited

inherited_from \org\bovigo\vfs\content\SeekableFileContent::bytesRead()

Returns

int

returns actual content

content() : string

Returns

string

checks whether pointer is at end of file

eof() : bool
Inherited

inherited_from \org\bovigo\vfs\content\FileContent::eof()

Returns

bool

reads the given amount of bytes from content

read(int $count) : string
Inherited

inherited_from \org\bovigo\vfs\content\FileContent::read()

Parameters

$count

int

Returns

string

for backwards compatibility with vfsStreamFile::readUntilEnd()

readUntilEnd() : string
Inherited

inherited_from \org\bovigo\vfs\content\SeekableFileContent::readUntilEnd()

Returns

string

seeks to the given offset

seek(int $offset, int $whence) : bool
Inherited

inherited_from \org\bovigo\vfs\content\FileContent::seek()

Parameters

$offset

int

$whence

int

Returns

bool

returns size of content

size() : int

Returns

int

Truncates a file to a given length

truncate(int $size) : bool

Parameters

$size

int

length to truncate file to

Returns

bool

writes an amount of data

write(string $data) : \org\bovigo\vfs\content\amount
Inherited

inherited_from \org\bovigo\vfs\content\FileContent::write()

Parameters

$data

string

Returns

\org\bovigo\vfs\content\amountof written bytes

actual reading of length starting at given offset

doRead(int $offset, int $count) 

Parameters

$offset

int

$count

int

actual writing of data with specified length at given offset

doWrite(string $data, int $offset, int $length) 

Parameters

$data

string

$offset

int

$length

int

 Properties

 

actual content

$content 

type string
 

current position within content

$offset 
Inherited

type int
inherited_from \org\bovigo\vfs\content\SeekableFileContent::$$offset