Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/StarFile.cpp')
-rw-r--r--source/core/StarFile.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/core/StarFile.cpp b/source/core/StarFile.cpp
index 9153960..75813b4 100644
--- a/source/core/StarFile.cpp
+++ b/source/core/StarFile.cpp
@@ -243,4 +243,15 @@ String File::deviceName() const {
return m_filename;
}
+IODevicePtr File::clone() {
+ auto cloned = make_shared<File>(m_filename);
+ if (isOpen()) {
+ // Open with same mode
+ cloned->open(mode());
+ // Seek to same position
+ cloned->seek(pos());
+ }
+ return cloned;
+}
+
}