Changeset View
Changeset View
Standalone View
Standalone View
source/lib/file/vfs/vfs_lookup.cpp
/* Copyright (C) 2013 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* | * | ||||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | ||||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | ||||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | ||||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | ||||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | ||||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | ||||
* the following conditions: | * the following conditions: | ||||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | if(!subdirectory) | ||||
else | else | ||||
return ERR::VFS_DIR_NOT_FOUND; // NOWARN | return ERR::VFS_DIR_NOT_FOUND; // NOWARN | ||||
} | } | ||||
if(createMissingDirectories && (!subdirectory->AssociatedDirectory() | if(createMissingDirectories && (!subdirectory->AssociatedDirectory() | ||||
|| (createAlways && (subdirectory->AssociatedDirectory()->Flags() & VFS_MOUNT_REPLACEABLE) != 0))) | || (createAlways && (subdirectory->AssociatedDirectory()->Flags() & VFS_MOUNT_REPLACEABLE) != 0))) | ||||
{ | { | ||||
OsPath currentPath; | OsPath currentPath; | ||||
if(directory->AssociatedDirectory()) // (is NULL when mounting into root) | if(directory->AssociatedDirectory()) // (is nullptr when mounting into root) | ||||
currentPath = directory->AssociatedDirectory()->Path(); | currentPath = directory->AssociatedDirectory()->Path(); | ||||
currentPath = currentPath / subdirectoryName; | currentPath = currentPath / subdirectoryName; | ||||
RETURN_STATUS_IF_ERR(CreateDirectory(currentPath)); | RETURN_STATUS_IF_ERR(CreateDirectory(currentPath)); | ||||
PRealDirectory realDirectory(new RealDirectory(currentPath, 0, 0)); | PRealDirectory realDirectory(new RealDirectory(currentPath, 0, 0)); | ||||
RETURN_STATUS_IF_ERR(vfs_Attach(subdirectory, realDirectory)); | RETURN_STATUS_IF_ERR(vfs_Attach(subdirectory, realDirectory)); | ||||
} | } | ||||
Show All 18 Lines |
Wildfire Games · Phabricator