FSNode.hpp
Go to the documentation of this file.
128 {libName}DATA:folder/File.ccc ==> try to read in appl data and in next in "libName" lib data folder
434 std::vector<std::string> folderGetSub(bool _getFolder, bool _getFile, const std::string& _filter);
758 bool FSNodeCreate(const std::string& _path, etk::FSNodeRight _right, enum etk::typeNode _type=etk::typeNode_folder);
760 bool FSNodeCreate(const std::u32string& _path, etk::FSNodeRight _right, enum etk::typeNode _type=etk::typeNode_folder);
912 template<typename TTT> void FSNodeWriteAllDataType(const std::string& _path, const std::vector<TTT>& _data) {
char * fileGets(char *_elementLine, int64_t _maxData)
Get the pointer on the start line and the next line (or null)
etk::FSNodeRight FSNodeGetRight(const std::string &_path)
Simple access for : Get right of the current Node.
bool FSNodeMove(const std::string &_path1, const std::string &_path2)
Simple access for : chexk the exestance of an element.
void setName(const std::string &_newName)
Change the Node seeing (not rename the node, for this etk::FSNodeMove)
void setBaseFolderDataUser(const char *_folder)
Set the user data folder (like /home/machin/.local/applName/ for linux)
std::vector< std::string > folderGetSub(bool _getFolder, bool _getFile, const std::string &_filter)
Get the List of all node inside a node (folder only)
bool FSNodeRemove(const std::string &_path)
Simple access for : Remove folder and subFolder, files pipes ...
bool FSNodeCreate(const std::string &_path, etk::FSNodeRight _right, enum etk::typeNode _type=etk::typeNode_folder)
Simple access for : Create a file or a folder depending of the request.
basic namespace of the etk library. (it might contain all the etk fuctions/class/structures without m...
Definition: Archive.hpp:16
acces at the home path of the system (with name of the current user)
Definition: FSNode.hpp:87
std::vector< TTT > FSNodeReadAllDataType(const std::string &_path)
Read all the data from a file.
Definition: FSNode.hpp:891
void folderGetRecursiveFiles(std::vector< std::string > &_output, bool _recursiveEnable=true)
Get all the File inside a Folder (done recursively)
uint64_t FSNodeGetTimeModified(const std::string &_path)
Simple access for : Getting Modification time of the current node.
bool FSNodeTouch(const std::string &_path)
Simple access for : Update Modification time with the current time of the node (>) ...
Access on the application temporary path (remove when user want and whe the compter restart or have n...
Definition: FSNode.hpp:105
bool fileSeek(long int _offset, enum etk::seekNode _origin)
Move in the file Position.
void FSNodeWriteAllDataType(const std::string &_path, const std::vector< TTT > &_data)
Write all the data in a file.
Definition: FSNode.hpp:912
request seek position start at the CURRENT position in the file
Definition: FSNode.hpp:72
std::string simplifyPath(std::string _input)
Simplify a path with all the complication that mean ".." or "///\//".
Access on the application data (internal application data are the one provided with the binary) ...
Definition: FSNode.hpp:93
int64_t FSNodeGetCount(const std::string &_path)
Simple access for : count the number of element in a path (if it is not a path ==> return -1) ...
bool FSNodeEcho(const std::string &_path, const std::string &_dataTowrite)
Simple access for : Basic write on the node (like console echo)
bool operator!=(const etk::FSNode &_obj) const
Check if the 2 node are NOT link with the same file.
std::string timeAccessedString() const
Get the Accessed time of the File.
void setArgZero(const std::string &_val)
Set the firt argument of the application start (this permit to get the real position of the execution...
void FSNodeWriteAllData(const std::string &_path, const std::string &_data)
Write all the data in a file.
The node is a Char device type (Not availlable on Windows)
Definition: FSNode.hpp:57
Access at the file System with a relative naming like "../plop/xxx.txt".
Definition: FSNode.hpp:81
void FSNodeHistory(const std::string &_path, int32_t _historyCount)
move file to generate an history of the current file
std::vector< T > fileReadAll()
Read all element in a file and set it in a generic vector.
Definition: FSNode.hpp:588
enum etk::typeNode FSNodeGetType(const std::string &_path)
Simple access for : Get type of the current node.
std::string fileReadAllString()
Read all element in a file and set it in a generic std::string.
Definition: FSNode.hpp:598
std::string getNameFolder() const
Get the current folder of the Node. (file system name)
std::string FSNodeGetRealName(const std::string &_path)
get the system name of the current path
const etk::FSNode & operator=(const etk::FSNode &_obj)
copy the other FSnode ==> for vector
bool FSNodeEchoAdd(const std::string &_path, const std::string &_dataTowrite)
Simple access for : Basic write on the node (like console echo) in adding mode (>>) ...
std::vector< std::string > FSNodeExplodeMultiplePath(const std::string &_path)
Get all the Path contain in the specidy path:
int64_t fileRead(void *_data, int64_t _blockSize, int64_t _nbBlock)
Read data from the file.
The node is a block aceess device (Not availlable on Windows)
Definition: FSNode.hpp:56
Access at the file System with a direct naming like "/home/plop/xxx.txt".
Definition: FSNode.hpp:80
void setBaseFolderData(const char *_folder, const char *_applName=nullptr)
Set manualy the folder of the Data.(like /usr/shared/applName/ for linux)
std::string getFileSystemName() const
Get the Generate FileSystem name.
std::string timeModifiedString() const
Get the modifying time of the File.
std::vector< etk::FSNode * > folderGetSubList(bool _showHidenFile=true, bool _getFolderAndOther=true, bool _getFile=true, bool _temporaryFile=true)
Get the List of all node inside a node (folder only)
void fileWriteAll(const std::string &_value)
Write all the vector in a file.
Definition: FSNode.hpp:621
void fileWriteAll(const std::vector< T > &_value)
Write all the vector in a file.
Definition: FSNode.hpp:614
void initDefaultFolder(const char *_applName)
Initialyse all the subFolder usable by the user like DATA/HOME/CACHE/USERDATA.
enum typeNode getNodeType() const
Get the node type.
Definition: FSNode.hpp:233
void setBaseFolderCache(const char *_folder)
Set the Cach folder for the application (like /tmp)
FS node is for File System IO access (named classicly "node in linux EXT) This class is independent o...
Definition: FSNode.hpp:163
std::string FSNodeReadAllData(const std::string &_path)
Read all the data from a file.
std::string timeCreatedString() const
Get the creating time of the File.
std::string getRelativeFolder() const
Get the current folder of the Node.
enum FSNType getTypeAccess() const
Get the node type (DATA/DIRECT...)
Definition: FSNode.hpp:323
Access on the user application data (where the data are stored when the application stop) ...
Definition: FSNode.hpp:99
std::string getNameFile() const
Get the file or current file name (if it was a file)
std::string getName() const
Get the current compleate node name (file system name)
etk::FSNodeRight getRight() const
Get the node Right.
Definition: FSNode.hpp:240
uint64_t FSNodeGetTimeAccessed(const std::string &_path)
Simple access for : Getting Accessing time of the current node.
typeNode
List of Type that a node can have (this wrap some type that not exist on Windows) ...
Definition: FSNode.hpp:54
bool operator==(const etk::FSNode &_obj) const
Check if the 2 node are link with the same file.
uint64_t FSNodeGetTimeCreated(const std::string &_path)
Simple access for : Getting creation time of the current node.
int64_t fileWrite(const void *_data, int64_t _blockSize, int64_t _nbBlock)
Write data on the file.
bool FSNodeExist(const std::string &_path)
Simple access for : chexk the exestance of an element.