[DEV] add generic get file size
This commit is contained in:
parent
249c8a4ea3
commit
6cf1b62ceb
@ -2412,6 +2412,19 @@ std::string etk::theme::getNameDefault(const std::string& _refName) {
|
||||
* Simple direct wrapper on the FileSystem node access :
|
||||
*
|
||||
* -------------------------------------------------------------------------- */
|
||||
uint64_t etk::FSNodeGetSize(const std::string& _path) {
|
||||
etk::FSNode tmpNode(_path);
|
||||
if (false==tmpNode.exist()) {
|
||||
return 0;
|
||||
}
|
||||
return tmpNode.fileSize();
|
||||
}
|
||||
#if __CPP_VERSION__ >= 2011
|
||||
uint64_t etk::FSNodeGetSize(const std::u32string& _path) {
|
||||
return FSNodeGetSize(etk::to_string(_path));
|
||||
}
|
||||
#endif
|
||||
|
||||
bool etk::FSNodeRemove(const std::string& _path) {
|
||||
etk::FSNode tmpNode(_path);
|
||||
if (false==tmpNode.exist()) {
|
||||
|
@ -735,6 +735,15 @@ namespace etk {
|
||||
std::vector<std::u32string> listU();
|
||||
#endif
|
||||
};
|
||||
/**
|
||||
* @brief Get the size of a specific file
|
||||
* @param[in] _path Folder/File/Pipe path of the node
|
||||
* @return size of the file
|
||||
*/
|
||||
uint64_t FSNodeGetSize(const std::string& _path);
|
||||
#if __CPP_VERSION__ >= 2011
|
||||
uint64_t FSNodeGetSize(const std::u32string& _path);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Simple access for : Remove folder and subFolder, files pipes ...
|
||||
|
Loading…
x
Reference in New Issue
Block a user