mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
Add a simple FileSystemPath class that can canonicalize paths.
Also a simple StringBuilder to help him out.
This commit is contained in:
parent
43475f248b
commit
88ad59bfb1
6 changed files with 102 additions and 6 deletions
15
AK/test.cpp
15
AK/test.cpp
|
@ -10,13 +10,26 @@
|
|||
#include "Weakable.h"
|
||||
#include "WeakPtr.h"
|
||||
#include "CircularQueue.h"
|
||||
#include "FileSystemPath.h"
|
||||
|
||||
static void testWeakPtr();
|
||||
|
||||
int main(int, char**)
|
||||
int main(int c, char** v)
|
||||
{
|
||||
StringImpl::initializeGlobals();
|
||||
|
||||
{
|
||||
const char* testpath = "/proc/../proc/1/../../proc/1/vm";
|
||||
if (c == 2)
|
||||
testpath = v[1];
|
||||
FileSystemPath p(testpath);
|
||||
if (p.string().isNull())
|
||||
printf("canonicalized path is null\n");
|
||||
else
|
||||
printf("%s\n", p.string().characters());
|
||||
return 0;
|
||||
}
|
||||
|
||||
{
|
||||
struct entry {
|
||||
String s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue