606fe5ecbcc2cd38a1da32a698efd0dd63490383
[yaffs-website] / vendor / mikey179 / vfsStream / src / main / php / org / bovigo / vfs / content / FileContent.php
1 <?php
2 /**
3  * This file is part of vfsStream.
4  *
5  * For the full copyright and license information, please view the LICENSE
6  * file that was distributed with this source code.
7  *
8  * @package  org\bovigo\vfs
9  */
10 namespace org\bovigo\vfs\content;
11 /**
12  * Interface for actual file contents.
13  *
14  * @since  1.3.0
15  */
16 interface FileContent
17 {
18     /**
19      * returns actual content
20      *
21      * @return  string
22      */
23     public function content();
24
25     /**
26      * returns size of content
27      *
28      * @return  int
29      */
30     public function size();
31
32     /**
33      * reads the given amount of bytes from content
34      *
35      * @param   int     $count
36      * @return  string
37      */
38     public function read($count);
39
40     /**
41      * seeks to the given offset
42      *
43      * @param   int   $offset
44      * @param   int   $whence
45      * @return  bool
46      */
47     public function seek($offset, $whence);
48
49     /**
50      * checks whether pointer is at end of file
51      *
52      * @return  bool
53      */
54     public function eof();
55
56     /**
57      * writes an amount of data
58      *
59      * @param   string  $data
60      * @return  amount of written bytes
61      */
62     public function write($data);
63
64     /**
65      * Truncates a file to a given length
66      *
67      * @param   int  $size length to truncate file to
68      * @return  bool
69      */
70     public function truncate($size);
71 }