GNU Radio 3.7.1 C++ API
gr::blocks::file_source Class Reference

Read stream from file. More...

#include <file_source.h>

Inheritance diagram for gr::blocks::file_source:

List of all members.

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.

Detailed Description

Read stream from file.


Member Typedef Documentation


Member Function Documentation

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.

Parameters:
itemsizethe size of each item in the file, in bytes
filenamename of the file to source from
repeatrepeat file from start
virtual void gr::blocks::file_source::open ( const char *  filename,
bool  repeat 
) [pure virtual]

Opens a new file.

Parameters:
filenamename of the file to source from
repeatrepeat 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

Parameters:
seek_pointsample offset in file
whenceone of SEEK_SET, SEEK_CUR, SEEK_END (man fseek)

The documentation for this class was generated from the following file: