From 35b678fb65f9d6a86fcf0b8a4ea8f6c51417df4d Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 5 Aug 2013 20:48:30 +0200 Subject: [PATCH] [DEV] dev add interface n the FSNode 'getChar' --- etk/os/FSNode.cpp | 13 +++++++++++++ etk/os/FSNode.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/etk/os/FSNode.cpp b/etk/os/FSNode.cpp index 1c69bb1..003f612 100644 --- a/etk/os/FSNode.cpp +++ b/etk/os/FSNode.cpp @@ -1485,6 +1485,19 @@ char* etk::FSNode::FileGets(char * _elementLine, int64_t _maxData) #endif return fgets(_elementLine, _maxData, m_PointerFile); } + + +char etk::FSNode::FileGet(void) +{ + char data='\0'; + if (FileRead(&data, 1, 1)!=1) { + return '\0'; + } + return data; +} + + + int64_t etk::FSNode::FileRead(void* _data, int64_t _blockSize, int64_t _nbBlock) { #ifdef __TARGET_OS__Android diff --git a/etk/os/FSNode.h b/etk/os/FSNode.h index f674b11..9f31b59 100644 --- a/etk/os/FSNode.h +++ b/etk/os/FSNode.h @@ -388,6 +388,11 @@ namespace etk * @return the pointer on the end of the cuurent line. */ char* FileGets(char* _elementLine, int64_t _maxData); + /** + * @brief Get a unique data in the file + * @return the next element in the file. + */ + char FileGet(void); /** * @brief Read data from the file * @param[in,out] _data Pointer on the buffer that might be set the data