summaryrefslogtreecommitdiff
path: root/src/file.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-04-13 23:30:26 +0200
committerCarl Hetherington <cth@carlh.net>2022-05-05 21:46:30 +0200
commit9fb1f4d59aa56c0f04a43ad83c152eaa12600e74 (patch)
tree7185cb634b18d9bde7fe4d976f69d07bb7a61888 /src/file.h
parent6387446a183cf99803beb1bc68af8788601b73ce (diff)
Add ::take().
Diffstat (limited to 'src/file.h')
-rw-r--r--src/file.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/file.h b/src/file.h
index e0564cae..7dae44a6 100644
--- a/src/file.h
+++ b/src/file.h
@@ -72,6 +72,15 @@ public:
*/
void close();
+ boost::filesystem::path path() const {
+ return _path;
+ }
+
+ /** Take ownership of the underlying FILE*;
+ * the File object will not closed it after this call.
+ */
+ FILE* take();
+
private:
boost::filesystem::path _path;
FILE* _file = nullptr;