예제 #1
0
NativePath NativePath::workPath()
{
    if (currentNativeWorkPath.isEmpty())
    {
        currentNativeWorkPath = QDir::currentPath();
    }
    return currentNativeWorkPath;
}
예제 #2
0
void NativePath::createPath(NativePath const &nativePath)
{
    NativePath parentPath = nativePath.fileNamePath();
    if (!parentPath.isEmpty() && !exists(parentPath))
    {
        createPath(parentPath);
    }

    QDir::current().mkdir(nativePath);

    if (!exists(nativePath))
    {
        /// @throw CreateDirError Failed to create directory @a nativePath.
        throw CreateDirError("NativePath::createPath", "Could not create: " + nativePath);
    }
}