Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'source/core')
-rw-r--r--source/core/StarDirectives.cpp9
-rw-r--r--source/core/StarDirectives.hpp1
2 files changed, 10 insertions, 0 deletions
diff --git a/source/core/StarDirectives.cpp b/source/core/StarDirectives.cpp
index ea18bc9..b72e8ee 100644
--- a/source/core/StarDirectives.cpp
+++ b/source/core/StarDirectives.cpp
@@ -156,6 +156,15 @@ void Directives::parse(String&& directives) {
}
}
+StringView Directives::prefix() const {
+ if (!m_shared)
+ return "";
+ else if (m_shared->empty())
+ return m_shared->string;
+ else
+ return StringView(m_shared->string).substr(0, m_shared->entries.begin()->begin);
+}
+
String Directives::string() const {
if (!m_shared)
return "";
diff --git a/source/core/StarDirectives.hpp b/source/core/StarDirectives.hpp
index 9290649..d83a3e8 100644
--- a/source/core/StarDirectives.hpp
+++ b/source/core/StarDirectives.hpp
@@ -55,6 +55,7 @@ public:
void loadOperations() const;
void parse(String&& directives);
+ StringView prefix() const;
String string() const;
String const* stringPtr() const;
String buildString() const;