mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 12:18:25 +00:00
LibManual: Add SubsectionNode
This commit is contained in:
committed by
Andrew Kaster
parent
2aa374eba1
commit
a9fe80550d
26
Userland/Libraries/LibManual/SubsectionNode.cpp
Normal file
26
Userland/Libraries/LibManual/SubsectionNode.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "SubsectionNode.h"
|
||||
|
||||
namespace Manual {
|
||||
|
||||
SubsectionNode::SubsectionNode(NonnullRefPtr<SectionNode> parent, StringView name)
|
||||
: SectionNode(name, name)
|
||||
, m_parent(move(parent))
|
||||
{
|
||||
}
|
||||
|
||||
Node const* SubsectionNode::parent() const { return m_parent; }
|
||||
|
||||
ErrorOr<String> SubsectionNode::name() const { return m_name; }
|
||||
|
||||
ErrorOr<String> SubsectionNode::path() const
|
||||
{
|
||||
return String::formatted("{}/{}", TRY(m_parent->path()), m_section);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user