summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-04-16 01:01:53 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-15 19:06:43 +0300
commit25288281d1e72c8e6c264525926a200511407ac7 (patch)
tree4f1f47493c14a0ad70654e65209f90fac88f620e /include
parentd5446e9f327ab4eaef38249b0907f11fbf52be45 (diff)
libcamera: file: Add read/write support
Add basic support to read and write data from/to a file, along with retrieving and setting the current read/write position. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/file.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/libcamera/internal/file.h b/include/libcamera/internal/file.h
index e3e72132..9b6d011f 100644
--- a/include/libcamera/internal/file.h
+++ b/include/libcamera/internal/file.h
@@ -49,6 +49,12 @@ public:
int error() const { return error_; }
ssize_t size() const;
+ off_t pos() const;
+ off_t seek(off_t pos);
+
+ ssize_t read(const Span<uint8_t> &data);
+ ssize_t write(const Span<const uint8_t> &data);
+
Span<uint8_t> map(off_t offset = 0, ssize_t size = -1,
MapFlag flags = MapNoOption);
bool unmap(uint8_t *addr);