It would be really convenient if somebody could simply pass a SplFileObject into the Reader/Writer classes. In order to make this possible, I need to adjust the Readable, Writable, and Seekable interfaces.
From issue #77
The more I think about this the more I think extending SplFileObject the way I am is a bad idea. I think a better way to go would be to rewrite the Writable interface to fit with SplFileObject so that any SplFileObject can be passed to the Reader/Writer as-is. I could maybe write specialized versions of them just for clarity and to restrict access to certain methods or whatever, but you wouldn't have to use my file object(s). So basically I would just change the Readable interface to...
Readable
interface Readable
{
public function fgets() (or getCurrentLine());
public function fread($length);
public function eof();
public function rewind();
}
Writable
interface Writable
{
public function fwrite($string);
}
In fact I could probably still keep my CSVelte\IO\File object for convenience if I want it. But I just need ot adjust the interfaces. Probably want to add this one too:
Seekable
interface Seekable
{
public function fseek($pos);
}
[x] Create refactor/96 branch
[ ] Adjust Readable interface
[ ] Make changes in Reader to use new methods
[ ] Either write new or adjust existing CSVelte\Input* classes (see issue #97)
[ ] Update any relevant unit tests
[ ] Update new CSVelte\IO\File class (or delete it)
It would be really convenient if somebody could simply pass a SplFileObject into the Reader/Writer classes. In order to make this possible, I need to adjust the Readable, Writable, and Seekable interfaces.
From issue #77