1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

AK: Rename FileSystemPath -> LexicalPath

And move canonicalized_path() to a static method on LexicalPath.

This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
This commit is contained in:
Sergey Bugaev 2020-05-26 14:52:44 +03:00 committed by Andreas Kling
parent f746bbda17
commit 602c3fdb3a
44 changed files with 174 additions and 181 deletions

View file

@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/FileSystemPath.h>
#include <AK/LexicalPath.h>
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <LibCore/StandardPaths.h>
@ -37,12 +37,12 @@ namespace Core {
String StandardPaths::home_directory()
{
if (auto* home_env = getenv("HOME"))
return canonicalized_path(home_env);
return LexicalPath::canonicalized_path(home_env);
auto* pwd = getpwuid(getuid());
String path = pwd ? pwd->pw_dir : "/";
endpwent();
return canonicalized_path(path);
return LexicalPath::canonicalized_path(path);
}
String StandardPaths::desktop_directory()
@ -50,7 +50,7 @@ String StandardPaths::desktop_directory()
StringBuilder builder;
builder.append(home_directory());
builder.append("/Desktop");
return canonicalized_path(builder.to_string());
return LexicalPath::canonicalized_path(builder.to_string());
}
String StandardPaths::downloads_directory()
@ -58,7 +58,7 @@ String StandardPaths::downloads_directory()
StringBuilder builder;
builder.append(home_directory());
builder.append("/Downloads");
return canonicalized_path(builder.to_string());
return LexicalPath::canonicalized_path(builder.to_string());
}
String StandardPaths::tempfile_directory()