Changeset View
Changeset View
Standalone View
Standalone View
source/lib/file/vfs/vfs.cpp
/* Copyright (C) 2017 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 206 Lines • ▼ Show 20 Lines | virtual Status GetRealPath(const VfsPath& pathname, OsPath& realPathname) | ||||
realPathname = file->Loader()->Path() / pathname.Filename(); | realPathname = file->Loader()->Path() / pathname.Filename(); | ||||
return INFO::OK; | return INFO::OK; | ||||
} | } | ||||
virtual Status GetDirectoryRealPath(const VfsPath& pathname, OsPath& realPathname) | virtual Status GetDirectoryRealPath(const VfsPath& pathname, OsPath& realPathname) | ||||
{ | { | ||||
ScopedLock s; | ScopedLock s; | ||||
VfsDirectory* directory; | VfsDirectory* directory; | ||||
WARN_RETURN_STATUS_IF_ERR(vfs_Lookup(pathname, &m_rootDirectory, directory, NULL)); | WARN_RETURN_STATUS_IF_ERR(vfs_Lookup(pathname, &m_rootDirectory, directory, nullptr)); | ||||
realPathname = directory->AssociatedDirectory()->Path(); | realPathname = directory->AssociatedDirectory()->Path(); | ||||
return INFO::OK; | return INFO::OK; | ||||
} | } | ||||
virtual Status GetVirtualPath(const OsPath& realPathname, VfsPath& pathname) | virtual Status GetVirtualPath(const OsPath& realPathname, VfsPath& pathname) | ||||
{ | { | ||||
ScopedLock s; | ScopedLock s; | ||||
const OsPath realPath = realPathname.Parent()/""; | const OsPath realPath = realPathname.Parent()/""; | ||||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator