GNU Radio 3.7.1 C++ API
|
Read stream from file. More...
#include <file_source.h>
Public Types | |
typedef boost::shared_ptr < file_source > | sptr |
Public Member Functions | |
virtual bool | seek (long seek_point, int whence)=0 |
seek file to seek_point relative to whence | |
virtual void | open (const char *filename, bool repeat)=0 |
Opens a new file. | |
virtual void | close ()=0 |
Close the file handle. | |
Static Public Member Functions | |
static sptr | make (size_t itemsize, const char *filename, bool repeat=false) |
Create a file source. |
Read stream from file.
virtual void gr::blocks::file_source::close | ( | ) | [pure virtual] |
Close the file handle.
static sptr gr::blocks::file_source::make | ( | size_t | itemsize, |
const char * | filename, | ||
bool | repeat = false |
||
) | [static] |
Create a file source.
Opens filename
as a source of items into a flowgraph. The data is expected to be in binary format, item after item. The itemsize
of the block determines the conversion from bits to items.
If repeat
is turned on, the file will repeat the file after it's reached the end.
itemsize | the size of each item in the file, in bytes |
filename | name of the file to source from |
repeat | repeat file from start |
virtual void gr::blocks::file_source::open | ( | const char * | filename, |
bool | repeat | ||
) | [pure virtual] |
Opens a new file.
filename | name of the file to source from |
repeat | repeat file from start |
virtual bool gr::blocks::file_source::seek | ( | long | seek_point, |
int | whence | ||
) | [pure virtual] |
seek file to seek_point
relative to whence
seek_point | sample offset in file |
whence | one of SEEK_SET, SEEK_CUR, SEEK_END (man fseek) |