From 381dad6f1acd5d420982dc50ab5f725d3c53472f Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sun, 11 Nov 2012 20:40:14 +0100 Subject: [PATCH] [DEV] add the possibility to flush data on files --- etk/os/FSNode.cpp | 14 ++++++++++++++ etk/os/FSNode.h | 1 + 2 files changed, 15 insertions(+) diff --git a/etk/os/FSNode.cpp b/etk/os/FSNode.cpp index 289ffef..70745bf 100644 --- a/etk/os/FSNode.cpp +++ b/etk/os/FSNode.cpp @@ -1229,6 +1229,20 @@ bool etk::FSNode::FileSeek(long int offset, int origin) } } +void etk::FSNode::FileFlush(void) +{ + #ifdef __TARGET_OS__Android + if( etk::FSN_TYPE_DATA == m_type + || etk::FSN_TYPE_THEME_DATA == m_type) { + return; + } + #endif + if (NULL != m_PointerFile) { + fflush(m_PointerFile); + } +} + + // TODO : Add an INIT to reset all allocated parameter : diff --git a/etk/os/FSNode.h b/etk/os/FSNode.h index accc3b7..4413288 100644 --- a/etk/os/FSNode.h +++ b/etk/os/FSNode.h @@ -202,6 +202,7 @@ namespace etk int32_t FileRead(void * data, int32_t blockSize, int32_t nbBlock); int32_t FileWrite(void * data, int32_t blockSize, int32_t nbBlock); bool FileSeek(long int offset, int origin); + void FileFlush(void); private: void SortElementList(etk::Vector &list); };