From 1bd40ce2d0b684b5d0707414d7809c5f61008a44 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 31 Mar 2014 20:32:33 +0200 Subject: [PATCH] [DEV] add fileTell --- etk/os/FSNode.cpp | 13 +++++++++++++ etk/os/FSNode.h | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/etk/os/FSNode.cpp b/etk/os/FSNode.cpp index e698688..6b759fa 100644 --- a/etk/os/FSNode.cpp +++ b/etk/os/FSNode.cpp @@ -1693,6 +1693,19 @@ bool etk::FSNode::fileSeek(long int _offset, enum etk::seekNode _origin) return true; } } +int64_t etk::FSNode::fileTell(void) { + #ifdef __TARGET_OS__Android + if( m_type == etk::FSN_TYPE_DATA + || m_type == etk::FSN_TYPE_THEME_DATA) { + if (NULL == m_zipContent) { + return false; + } + return m_zipReadingOffset; + } + #endif + return ftell(m_PointerFile); + +} void etk::FSNode::fileFlush(void) { #ifdef __TARGET_OS__Android diff --git a/etk/os/FSNode.h b/etk/os/FSNode.h index 8a1fbef..2c1cb0b 100644 --- a/etk/os/FSNode.h +++ b/etk/os/FSNode.h @@ -453,7 +453,11 @@ namespace etk { * @return Number of element written (in block number) */ int64_t fileWrite(void* _data, int64_t _blockSize, int64_t _nbBlock); - + /** + * @brief Get the position in the file. + * @return the requested position. + */ + int64_t fileTell(void); /** * @brief Move in the file Position * @param[in] _offset Offset to apply at the file