summaryrefslogtreecommitdiff
path: root/Kernel/Library/KLexicalPath.h
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Library/KLexicalPath.h')
-rw-r--r--Kernel/Library/KLexicalPath.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Kernel/Library/KLexicalPath.h b/Kernel/Library/KLexicalPath.h
new file mode 100644
index 0000000000..abf7eb0591
--- /dev/null
+++ b/Kernel/Library/KLexicalPath.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2021, Max Wipfli <max.wipfli@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <AK/StringView.h>
+#include <Kernel/Library/KString.h>
+
+namespace Kernel::KLexicalPath {
+
+bool is_absolute(StringView);
+bool is_canonical(StringView);
+StringView basename(StringView);
+StringView dirname(StringView);
+Vector<StringView> parts(StringView);
+
+ErrorOr<NonnullOwnPtr<KString>> try_join(StringView, StringView);
+
+}