MCPcopy Create free account
hub / github.com/crownengine/crown / makeAll

Function makeAll

3rdparty/bx/src/file.cpp:821–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819 }
820
821 bool makeAll(const FilePath& _filePath, Error* _err)
822 {
823 BX_ERROR_SCOPE(_err);
824
825 if (!_err->isOk() )
826 {
827 return false;
828 }
829
830 FileInfo fi;
831
832 if (stat(fi, _filePath) )
833 {
834 if (FileType::Dir == fi.type)
835 {
836 return true;
837 }
838
839 BX_ERROR_SET(_err, kErrorNotDirectory, "File already exist, and is not directory.");
840 return false;
841 }
842
843 const StringView dir = strRTrim(_filePath, "/");
844 const StringView slash = strRFind(dir, '/');
845
846 if (!slash.isEmpty()
847 && slash.getPtr() - dir.getPtr() > 1)
848 {
849 if (!makeAll(StringView(dir.getPtr(), slash.getPtr() ), _err) )
850 {
851 return false;
852 }
853 }
854
855 FilePath path(dir);
856 return make(path, _err);
857 }
858
859 bool remove(const FilePath& _filePath, Error* _err)
860 {

Callers

nothing calls this directly

Calls 6

strRTrimFunction · 0.85
strRFindFunction · 0.85
makeFunction · 0.85
statFunction · 0.70
StringViewClass · 0.50
isEmptyMethod · 0.45

Tested by

no test coverage detected