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.
Return: | | true : The node existed.<br/>false : The node does not exist. |
getNodeType
+ enum typeNode getNodeType () const;
Get the node type
Return: | | the requested type, FSN_UNKNOW if it does not existed |
getRight
+ etk::FSNodeRight getRight () const;
Get the node Right
Return: | | the requested right |
setRight
+ bool setRight (etk::FSNodeRight _newRight);
Set the specific right of the node
Parameter [input]: | _newRight | new right to set |
Return: | | true : action done<br/>false : action not done |
setName
+ void setName (const std::string & _newName);
Change the Node seeing (not rename the node, for this @ref Move)
Parameter [input]: | _newName | New node name to show |
Return: | | true : action done<br/>false : action not done |
setName
+ void setName (const std::u32string & _newName);
getFileSystemName
+ std::string getFileSystemName () const;
Get the Generate FileSystem name
Return: | | the requested filename |
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 //
Return: | | the common name define (like /xxxxx/xxxxx/ or c:/xxxxx/xxxxx/) |
getUNameFolder
+ std::u32string getUNameFolder () const;
getName
+ std::string getName () const;
Get the current compleate node name (file system name)
Note: Auto remove of ../../../ and //
Return: | | All the user name definition (like /xxxxx/xxxxx/myFile.kkk or c:/xxxxx/xxxxx/myFile.kkk) |
getUName
+ std::u32string getUName () const;
getNameFile
+ std::string getNameFile () const;
Get the file or current file name (if it was a file)
Return: | | the name of the node (like myFile.kkk) |
getUNameFile
+ std::u32string getUNameFile () const;
getRelativeFolder
+ std::string getRelativeFolder () const;
Get the current folder of the Node.
Note: Auto remove of ../../../ and //
Return: | | the common name define (like DATA:xxxxx/xxxxx/) |
getURelativeFolder
+ std::u32string getURelativeFolder () const;
touch
+ bool touch ();
update the Time of the file with the current time
Return: | | true : action done<br/>false : action not done |
move
+ bool move (const std::string & _path);
Move the Node at a new path
Parameter [input]: | _path | The new path |
Return: | | true : action done<br/>false : action not done |
move
+ bool move (const std::u32string & _path);
getTypeAccess
+ enum FSNType getTypeAccess () const;
Get the node type (DATA/DIRECT...)
Return: | | the requested type |
remove
+ bool remove ();
Remove the current node ( if folder, this remove all subfolder but not the Link subfolder)
Return: | | true : action done<br/>false : action not done |
timeCreated
+ uint64_t timeCreated () const;
Get the creating time of the File
Return: | | The time requested |
timeCreatedString
+ std::string timeCreatedString () const;
Get the creating time of the File
Return: | | The time requested (in string) |
timeUCreatedString
+ std::u32string timeUCreatedString () const;
timeModified
+ uint64_t timeModified () const;
Get the modifying time of the File
Return: | | The time requested |
timeModifiedString
+ std::string timeModifiedString () const;
Get the modifying time of the File
Return: | | The time requested (in string) |
timeUModifiedString
+ std::u32string timeUModifiedString () const;
timeAccessed
+ uint64_t timeAccessed () const;
Get the Accessed time of the File
Return: | | The time requested |
timeAccessedString
+ std::string timeAccessedString () const;
Get the Accessed time of the File
Return: | | The time requested (in string) |
timeUAccessedString
+ std::u32string timeUAccessedString () const;
operator =
+ const etk::FSNode & operator = (const etk::FSNode & _obj);
copy the other FSnode ==> for vector
Parameter [input]: | _obj | input node |
Return: | | the current modify node |
operator ==
+ bool operator == (const etk::FSNode & _obj) const;
Check if the 2 node are link with the same file
Parameter [input]: | _obj | input node |
Return: | | true : same node, false otherwise |
operator !=
+ bool operator != (const etk::FSNode & _obj) const;
Check if the 2 node are NOT link with the same file
Parameter [input]: | _obj | input node |
Return: | | false : same node, true otherwise |
operator <<
+ friendstd::ostream & operator << (std::ostream & _os,
const etk::FSNode & _obj);
Write in the statard debug IO the current node
Parameter [input]: | _os | std debug IO |
Parameter [input]: | _obj | Node to display |
Return: | | std debug IO |
folderCount
+ int64_t folderCount ();
Count the number of subFolder in the curent Folder
Return: | | >=0 nb of subElement<br/>-1 an error occured ==> not a 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
Return: | | The requested 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)
Return: | | true The file have an extention.<br/>false The file have NO extention. |
fileGetExtention
+ std::string fileGetExtention ();
Get the extention of the Node
Return: | | the requested extention |
fileUGetExtention
+ std::u32string fileUGetExtention ();
fileSize
+ uint64_t fileSize ();
Get the File size
Return: | | the requested size |
fileOpenRead
+ bool fileOpenRead ();
Open the file in Read mode
Return: | | true : action done<br/>false : action not done |
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)
Return: | | true : action done<br/>false : action not done |
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)
Return: | | true : action done<br/>false : action not done |
fileClose
+ bool fileClose ();
Close the cuurent file
Return: | | true : action done<br/>false : action not done |
fileGets
+ char* fileGets (char* _elementLine,
int64_t _maxData);
Get the pointer on the start line and the next line (or null)
Parameter [input] [output]: | _elementLine | Pointer to an array of chars where the string read is copied. |
Parameter [input]: | _maxData | Maximum number of characters to be copied into str (including the terminating null-character). |
Return: | | the pointer on the end of the cuurent line. |
fileGet
+ char fileGet ();
Get a unique data in the file
Return: | | the next element 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
Parameter [input]: | _input | data to write. |
Return: | | true Write done corectly.<br/>false ErrorOn write. |
filePuts
+ bool filePuts (const std::string & _input);
Write data on the file
Parameter [input]: | _input | data to write. |
Return: | | true Write done corectly.<br/>false ErrorOn write. |
fileRead
+ int64_t fileRead (void* _data,
int64_t _blockSize,
int64_t _nbBlock);
Read data from the file
Parameter [input] [output]: | _data | Pointer on the buffer that might be set the data |
Parameter [input]: | _blockSize | Size of one block of data |
Parameter [input]: | _nbBlock | Number of block needed |
Return: | | Number of element read (in block number) |
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.
Return: | | the requested position. |
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);