class: etk::FSNode


Description:

FS node is for File system IO access This class is independent of the OS, If you acces to a file in windows, it might generate the right loke Linux (it is important to know that windows right is lighter than linux)

Constructor and Destructor:

+                              FSNode                   (const std::string & _path);
+ FSNode (const std::u32string & _path);
+ ~FSNode ();

Synopsis:

+ bool                         exist                    () const;
+ enum typeNode getNodeType () const;
+ etk::FSNodeRight getRight () const;
+ bool setRight (etk::FSNodeRight _newRight);
+ void setName (const std::string & _newName);
+ void setName (const std::u32string & _newName);
+ std::string getFileSystemName () const;
+ std::u32string getUFileSystemName () const;
+ std::string getNameFolder () const;
+ std::u32string getUNameFolder () const;
+ std::string getName () const;
+ std::u32string getUName () const;
+ std::string getNameFile () const;
+ std::u32string getUNameFile () const;
+ std::string getRelativeFolder () const;
+ std::u32string getURelativeFolder () const;
+ bool touch ();
+ bool move (const std::string & _path);
+ bool move (const std::u32string & _path);
+ enum FSNType getTypeAccess () const;
+ bool remove ();
+ uint64_t timeCreated () const;
+ std::string timeCreatedString () const;
+ std::u32string timeUCreatedString () const;
+ uint64_t timeModified () const;
+ std::string timeModifiedString () const;
+ std::u32string timeUModifiedString () const;
+ uint64_t timeAccessed () const;
+ std::string timeAccessedString () const;
+ std::u32string timeUAccessedString () const;
+ const etk::FSNode & operator = (const etk::FSNode & _obj);
+ bool operator == (const etk::FSNode & _obj) const;
+ bool operator != (const etk::FSNode & _obj) const;
+ friendstd::ostream & operator << (std::ostream & _os,
const etk::FSNode & _obj);
+ int64_t folderCount ();
+ std::vector<etk::FSNode*> folderGetSubList (bool _showHidenFile,
bool _getFolderAndOther,
bool _getFile,
bool _temporaryFile);
+ etk::FSNode folderGetParent ();
+ void folderGetRecursiveFiles (std::vector<std::string> & _output,
bool _recursiveEnable);
+ void folderGetRecursiveFiles (std::vector<std::u32string> & _output,
bool _recursiveEnable);
+ bool fileHasExtention ();
+ std::string fileGetExtention ();
+ std::u32string fileUGetExtention ();
+ uint64_t fileSize ();
+ bool fileOpenRead ();
+ bool fileOpenWrite ();
+ bool fileOpenAppend ();
+ bool fileClose ();
+ char* fileGets (char* _elementLine,
int64_t _maxData);
+ char fileGet ();
+ bool fileGets (std::string & _output);
+ bool filePut (char _input);
+ bool filePuts (const std::string & _input);
+ int64_t fileRead (void* _data,
int64_t _blockSize,
int64_t _nbBlock);
+ int64_t fileWrite (const void* _data,
int64_t _blockSize,
int64_t _nbBlock);
+ int64_t fileTell ();
+ bool fileSeek (longint _offset,
enum etk::seekNode _origin);
+ void fileFlush ();
+ std::vector<T> fileReadAll ();
+ std::string fileReadAllString ();
+ std::u32string fileReadAllU32String ();
+ void fileWriteAll (const std::vector<T> & _value);
+ void fileWriteAll (const std::string & _value);
+ void fileWriteAll (const std::u32string & _value);

Detail:

FSNode

+  FSNode (const std::string & _path);
Constructor


FSNode

+  FSNode (const std::u32string & _path);



~FSNode

+  ~FSNode ();
Destructor
Note: you will have some warning if you did not close your files


exist

+ bool exist () const;
Check if the node exist.


getNodeType

+ enum typeNode getNodeType () const;
Get the node type


getRight

+ etk::FSNodeRight getRight () const;
Get the node Right


setRight

+ bool setRight (etk::FSNodeRight _newRight);
Set the specific right of the node


setName

+ void setName (const std::string & _newName);
Change the Node seeing (not rename the node, for this @ref Move)


setName

+ void setName (const std::u32string & _newName);



getFileSystemName

+ std::string getFileSystemName () const;
Get the Generate FileSystem name


getUFileSystemName

+ std::u32string getUFileSystemName () const;



getNameFolder

+ std::string getNameFolder () const;
Get the current folder of the Node. (file system name)
Note: Auto remove of ../../../ and //


getUNameFolder

+ std::u32string getUNameFolder () const;



getName

+ std::string getName () const;
Get the current compleate node name (file system name)
Note: Auto remove of ../../../ and //


getUName

+ std::u32string getUName () const;



getNameFile

+ std::string getNameFile () const;
Get the file or current file name (if it was a file)


getUNameFile

+ std::u32string getUNameFile () const;



getRelativeFolder

+ std::string getRelativeFolder () const;
Get the current folder of the Node.
Note: Auto remove of ../../../ and //


getURelativeFolder

+ std::u32string getURelativeFolder () const;



touch

+ bool touch ();
update the Time of the file with the current time


move

+ bool move (const std::string & _path);
Move the Node at a new path


move

+ bool move (const std::u32string & _path);



getTypeAccess

+ enum FSNType getTypeAccess () const;
Get the node type (DATA/DIRECT...)


remove

+ bool remove ();
Remove the current node ( if folder, this remove all subfolder but not the Link subfolder)


timeCreated

+ uint64_t timeCreated () const;
Get the creating time of the File


timeCreatedString

+ std::string timeCreatedString () const;
Get the creating time of the File


timeUCreatedString

+ std::u32string timeUCreatedString () const;



timeModified

+ uint64_t timeModified () const;
Get the modifying time of the File


timeModifiedString

+ std::string timeModifiedString () const;
Get the modifying time of the File


timeUModifiedString

+ std::u32string timeUModifiedString () const;



timeAccessed

+ uint64_t timeAccessed () const;
Get the Accessed time of the File


timeAccessedString

+ std::string timeAccessedString () const;
Get the Accessed time of the File


timeUAccessedString

+ std::u32string timeUAccessedString () const;



operator =

+ const etk::FSNode & operator = (const etk::FSNode & _obj);
copy the other FSnode ==> for vector


operator ==

+ bool operator == (const etk::FSNode & _obj) const;
Check if the 2 node are link with the same file


operator !=

+ bool operator != (const etk::FSNode & _obj) const;
Check if the 2 node are NOT link with the same file


operator <<

+ friendstd::ostream & operator << (std::ostream & _os,
const
etk::FSNode & _obj);
Write in the statard debug IO the current node


folderCount

+ int64_t folderCount ();
Count the number of subFolder in the curent Folder


folderGetSubList

+ std::vector<etk::FSNode*> folderGetSubList (bool _showHidenFile,
bool _getFolderAndOther,
bool _getFile,
bool _temporaryFile);
Get the List of all node inside a node (folder only)


folderGetParent

+ etk::FSNode folderGetParent ();
Get the father node of this node


folderGetRecursiveFiles

+ void folderGetRecursiveFiles (std::vector<std::string> & _output,
bool _recursiveEnable);
Get all the File inside a Folder (done recursively)


folderGetRecursiveFiles

+ void folderGetRecursiveFiles (std::vector<std::u32string> & _output,
bool _recursiveEnable);



fileHasExtention

+ bool fileHasExtention ();
Check if the file have an extention (.ccc)


fileGetExtention

+ std::string fileGetExtention ();
Get the extention of the Node


fileUGetExtention

+ std::u32string fileUGetExtention ();



fileSize

+ uint64_t fileSize ();
Get the File size


fileOpenRead

+ bool fileOpenRead ();
Open the file in Read mode


fileOpenWrite

+ bool fileOpenWrite ();
Open the file in write Mode
Note: You can not do it with the DATA: file ==> this is not allowed in some Board like Android)


fileOpenAppend

+ bool fileOpenAppend ();
Open the file in write Append Mode
Note: You can not do it with the DATA: file ==> this is not allowed in some Board like Android)


fileClose

+ bool fileClose ();
Close the cuurent file


fileGets

+ char* fileGets (char* _elementLine,
int64_t _maxData);
Get the pointer on the start line and the next line (or null)


fileGet

+ char fileGet ();
Get a unique data in the file


fileGets

+ bool fileGets (std::string & _output);
Get a compleate line in a text file


filePut

+ bool filePut (char _input);
Write data on the file


filePuts

+ bool filePuts (const std::string & _input);
Write data on the file


fileRead

+ int64_t fileRead (void* _data,
int64_t _blockSize,
int64_t _nbBlock);
Read data from the file


fileWrite

+ int64_t fileWrite (const void* _data,
int64_t _blockSize,
int64_t _nbBlock);
Write data on the file


fileTell

+ int64_t fileTell ();
Get the position in the file.


fileSeek

+ bool fileSeek (longint _offset,
enum
etk::seekNode _origin);
Move in the file Position


fileFlush

+ void fileFlush ();
Flush the current file


fileReadAll

+ std::vector<T> fileReadAll ();
Read all element in a file and set it in a generic vector


fileReadAllString

+ std::string fileReadAllString ();



fileReadAllU32String

+ std::u32string fileReadAllU32String ();



fileWriteAll

+ void fileWriteAll (const std::vector<T> & _value);
Write all the vector in a file


fileWriteAll

+ void fileWriteAll (const std::string & _value);



fileWriteAll

+ void fileWriteAll (const std::u32string & _value);