MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / createDirectories

Method createDirectories

lib/Utilities/src/FileUtil.cpp:75–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73 *****************************************************************************/
74
75bool FileUtil::createDirectories(const String& path)
76{
77 bool status = true;
78 uint8_t idx = 0U;
79 String currentPath;
80
81 while ((true == status) && (path.length() > idx))
82 {
83 if ('/' == path[idx])
84 {
85 if (0U < currentPath.length())
86 {
87 if (false == FILESYSTEM.exists(currentPath))
88 {
89 status = FILESYSTEM.mkdir(currentPath);
90 }
91 }
92 }
93
94 currentPath += path[idx];
95
96 ++idx;
97 }
98
99 return status;
100}
101
102String FileUtil::getFileName(const String& filePath)
103{

Callers

nothing calls this directly

Calls 3

existsMethod · 0.80
mkdirMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected