mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
LibManual: Refactor SectionNode in preparation for subsections
- Calculate the full name on demand - Make section and name protected - Reorder some members logically - Change the name getter to be fallible, as some implementors need to allocate
This commit is contained in:
parent
f502e24bd7
commit
4625f7aab5
6 changed files with 23 additions and 10 deletions
|
@ -17,6 +17,11 @@ ErrorOr<String> SectionNode::path() const
|
|||
return String::formatted("/usr/share/man/man{}", m_section);
|
||||
}
|
||||
|
||||
ErrorOr<String> SectionNode::name() const
|
||||
{
|
||||
return String::formatted("{}. {}", m_section, m_name);
|
||||
}
|
||||
|
||||
ErrorOr<void> SectionNode::reify_if_needed() const
|
||||
{
|
||||
if (m_reified)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue