From 25288281d1e72c8e6c264525926a200511407ac7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 16 Apr 2020 01:01:53 +0300 Subject: 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 Reviewed-by: Kieran Bingham --- include/libcamera/internal/file.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') 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 &data); + ssize_t write(const Span &data); + Span map(off_t offset = 0, ssize_t size = -1, MapFlag flags = MapNoOption); bool unmap(uint8_t *addr); -- cgit v1.2.1