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 (void );

Synopsis:

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

Detail:

FSNode

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


FSNode

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



~FSNode

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


exist

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


getNodeType

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


getRight

+ etk::FSNodeRight getRight (void ) 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 (void ) const;
Get the Generate FileSystem name


getUFileSystemName

+ std::u32string getUFileSystemName (void ) const;



getNameFolder

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


getUNameFolder

+ std::u32string getUNameFolder (void ) const;



getName

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


getUName

+ std::u32string getUName (void ) const;



getNameFile

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


getUNameFile

+ std::u32string getUNameFile (void ) const;



getRelativeFolder

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


getURelativeFolder

+ std::u32string getURelativeFolder (void ) const;



touch

+ bool touch (void );
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 (void ) const;
Get the node type (DATA/DIRECT...)


remove

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


timeCreated

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


timeCreatedString

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


timeUCreatedString

+ std::u32string timeUCreatedString (void ) const;



timeModified

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


timeModifiedString

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


timeUModifiedString

+ std::u32string timeUModifiedString (void ) const;



timeAccessed

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


timeAccessedString

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


timeUAccessedString

+ std::u32string timeUAccessedString (void ) 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 <<

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


folderCount

+ int64_t folderCount (void );
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 (void );
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 (void );
Check if the file have an extention (.ccc)


fileGetExtention

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


fileUGetExtention

+ std::u32string fileUGetExtention (void );



fileSize

+ uint64_t fileSize (void );
Get the File size


fileOpenRead

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


fileOpenWrite

+ bool fileOpenWrite (void );
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 (void );
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 (void );
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 (void );
Get a unique data in the file


fileRead

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


fileWrite

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


fileSeek

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


fileFlush

+ void fileFlush (void );
Flush the current file