Default implementation for file contents based on simple strings.

since 1.3.0

 Methods

for backwards compatibility with vfsStreamFile::bytesRead()

bytesRead() : int

deprecated

Returns

int

returns actual content

content() : string
Inherited

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

Returns

string

checks whether pointer is at end of file

eof() : bool

Returns

bool

reads the given amount of bytes from content

read(int $count) : string

Parameters

$count

int

Returns

string

for backwards compatibility with vfsStreamFile::readUntilEnd()

readUntilEnd() : string

deprecated

Returns

string

seeks to the given offset

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

Parameters

$offset

int

$whence

int

Returns

bool

returns size of content

size() : int
Inherited

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

Returns

int

Truncates a file to a given length

truncate(int $size) : bool
Inherited

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

Parameters

$size

int

length to truncate file to

Returns

bool

writes an amount of data

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

Parameters

$data

string

Returns

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

actual reading of given byte count 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

 

current position within content

$offset 

type int