
This is a first step in deduplicating code within and across Help and man. Because LibManual also doesn't contain any DeprecatedString, some adjustments to Help's string handling is included, just to interoperate with LibManual better. Further work in this area mostly requires String APIs in LibGUI.
29 lines
567 B
C++
29 lines
567 B
C++
/*
|
|
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "PageNode.h"
|
|
#include "SectionNode.h"
|
|
|
|
namespace Manual {
|
|
|
|
Node const* PageNode::parent() const
|
|
{
|
|
return m_section.ptr();
|
|
}
|
|
|
|
NonnullRefPtrVector<Node>& PageNode::children() const
|
|
{
|
|
static NonnullRefPtrVector<Node> empty_vector;
|
|
return empty_vector;
|
|
}
|
|
|
|
ErrorOr<String> PageNode::path() const
|
|
{
|
|
return TRY(String::formatted("{}/{}.md", TRY(m_section->path()), m_page));
|
|
}
|
|
|
|
}
|