summaryrefslogtreecommitdiff
path: root/gr-blocks/include/blocks/file_source.h
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-12-11 22:48:03 -0500
committerTom Rondeau <trondeau@vt.edu>2012-12-11 22:48:03 -0500
commit2011e07a5b45254be65c6cd4104fa04b65f64e03 (patch)
tree7fdf1c341cf7625fd29418444510519b2ea763d0 /gr-blocks/include/blocks/file_source.h
parent95111ed54bebee4726b8c444632cd1bc5f65c28d (diff)
blocks: apply changes to file source in core to one in gr-blocks.
Diffstat (limited to 'gr-blocks/include/blocks/file_source.h')
-rw-r--r--gr-blocks/include/blocks/file_source.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/gr-blocks/include/blocks/file_source.h b/gr-blocks/include/blocks/file_source.h
index 6207cdf700..1a12aa905d 100644
--- a/gr-blocks/include/blocks/file_source.h
+++ b/gr-blocks/include/blocks/file_source.h
@@ -40,6 +40,21 @@ namespace gr {
// gr::blocks::file_source::sptr
typedef boost::shared_ptr<file_source> sptr;
+ /*!
+ * \brief Create a file source.
+ *
+ * Opens \p filename as a source of items into a flowgraph. The
+ * data is expected to be in binary format, item after item. The
+ * \p itemsize of the block determines the conversion from bits
+ * to items.
+ *
+ * If \p repeat is turned on, the file will repeat the file after
+ * it's reached the end.
+ *
+ * \param itemsize the size of each item in the file, in bytes
+ * \param filename name of the file to source from
+ * \param repeat repeat file from start
+ */
static sptr make(size_t itemsize, const char *filename, bool repeat = false);
/*!
@@ -49,6 +64,19 @@ namespace gr {
* \param whence one of SEEK_SET, SEEK_CUR, SEEK_END (man fseek)
*/
virtual bool seek(long seek_point, int whence) = 0;
+
+ /*!
+ * \brief Opens a new file.
+ *
+ * \param filename name of the file to source from
+ * \param repeat repeat file from start
+ */
+ virtual void open(const char *filename, bool repeat) = 0;
+
+ /*!
+ * \brief Close the file handle.
+ */
+ virtual void close() = 0;
};
} /* namespace blocks */