Doxygen
Loading...
Searching...
No Matches
layout.h File Reference
#include <memory>
#include <utility>
#include <vector>
#include "construct.h"
#include "types.h"
Include dependency graph for layout.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LayoutDocEntry
 Base class representing a piece of a documentation page. More...
struct  LayoutDocEntrySimple
 Represents of a piece of a documentation page without configurable parts. More...
struct  LayoutDocEntrySection
struct  LayoutDocEntryMemberDecl
 Represents of a member declaration list with configurable title and subtitle. More...
struct  LayoutDocEntryMemberDef
 Represents of a member definition list with configurable title. More...
struct  LayoutNavEntry
 Base class for the layout of a navigation item at the top of the HTML pages. More...
class  LayoutDocManager
 Singleton providing access to the (user configurable) layout of the documentation. More...

Macros

#define ENTRY_SPECIFICATIONS
#define ESPEC(x)
#define ESPEC(x)
#define NAV_SPECIFICATIONS
#define NSPEC(x, y)
#define NSPEC(x, y)
#define PART_SPECIFICATIONS
#define PSPEC(x, y)
#define PSPEC(x, y)

Typedefs

using LayoutDocEntryPtr = std::unique_ptr<LayoutDocEntry>
using LayoutDocEntryList = std::vector<LayoutDocEntryPtr>
using LayoutNavEntryList = std::vector< std::unique_ptr<LayoutNavEntry> >

Functions

void writeDefaultLayoutFile (const DString &fileName)
void printLayout ()

Macro Definition Documentation

◆ ENTRY_SPECIFICATIONS

#define ENTRY_SPECIFICATIONS
Value:
\
ESPEC(MemberGroups) \
ESPEC(MemberDeclStart) ESPEC(MemberDeclEnd) ESPEC(MemberDecl) \
ESPEC(MemberDefStart) ESPEC(MemberDefEnd) ESPEC(MemberDef) \
ESPEC(BriefDesc) ESPEC(DetailedDesc) \
ESPEC(AuthorSection) \
\
ESPEC(ClassIncludes) ESPEC(ClassInlineClasses) \
ESPEC(ClassInheritanceGraph) ESPEC(ClassNestedClasses) \
ESPEC(ClassCollaborationGraph) ESPEC(ClassAllMembersLink) \
ESPEC(ClassUsedFiles) \
\
ESPEC(ConceptDefinition) \
\
ESPEC(NamespaceNestedNamespaces) ESPEC(NamespaceNestedConstantGroups) \
ESPEC(NamespaceClasses) ESPEC(NamespaceConcepts) ESPEC(NamespaceInterfaces) ESPEC(NamespaceStructs) ESPEC(NamespaceExceptions) \
ESPEC(NamespaceInlineClasses) \
\
ESPEC(FileClasses) ESPEC(FileConcepts) ESPEC(FileInterfaces) ESPEC(FileStructs) ESPEC(FileExceptions) ESPEC(FileConstantGroups) ESPEC(FileNamespaces) \
ESPEC(FileIncludes) ESPEC(FileIncludeGraph) \
ESPEC(FileIncludedByGraph) ESPEC(FileSourceLink) \
ESPEC(FileInlineClasses) \
\
ESPEC(ModuleExports) ESPEC(ModuleClasses) ESPEC(ModuleConcepts) ESPEC(ModuleUsedFiles) \
\
ESPEC(GroupClasses) ESPEC(GroupConcepts) ESPEC(GroupModules) ESPEC(GroupInlineClasses) ESPEC(GroupNamespaces) \
ESPEC(GroupDirs) ESPEC(GroupNestedGroups) ESPEC(GroupFiles) \
ESPEC(GroupGraph) ESPEC(GroupPageDocs) \
\
ESPEC(DirSubDirs) ESPEC(DirFiles) ESPEC(DirGraph)
A model of a class/file/namespace member symbol.
Definition memberdef.h:45
#define ESPEC(x)
Definition layout.h:67

Definition at line 34 of file layout.h.

◆ ESPEC [1/2]

#define ESPEC ( x)
Value:
case x: return #x; break;

Definition at line 67 of file layout.h.

◆ ESPEC [2/2]

#define ESPEC ( x)
Value:
x,

Definition at line 67 of file layout.h.

◆ NAV_SPECIFICATIONS

#define NAV_SPECIFICATIONS

Definition at line 156 of file layout.h.

◆ NSPEC [1/2]

#define NSPEC ( x,
y )
Value:
case x: return #x; break;

Definition at line 193 of file layout.h.

◆ NSPEC [2/2]

#define NSPEC ( x,
y )
Value:
x y,

Definition at line 193 of file layout.h.

◆ PART_SPECIFICATIONS

#define PART_SPECIFICATIONS
Value:
PSPEC(Undefined, = -1) \
PSPEC(Class,) PSPEC(Concept,) PSPEC(Namespace,) PSPEC(File,) PSPEC(Group,) PSPEC(Directory,) PSPEC(Module,) \
PSPEC(NrParts,)
#define PSPEC(x, y)
Definition layout.h:265

Definition at line 254 of file layout.h.

◆ PSPEC [1/2]

#define PSPEC ( x,
y )
Value:
case x: return #x; break;

Definition at line 265 of file layout.h.

◆ PSPEC [2/2]

#define PSPEC ( x,
y )
Value:
x y,

Definition at line 265 of file layout.h.

Typedef Documentation

◆ LayoutDocEntryList

using LayoutDocEntryList = std::vector<LayoutDocEntryPtr>

Definition at line 147 of file layout.h.

◆ LayoutDocEntryPtr

using LayoutDocEntryPtr = std::unique_ptr<LayoutDocEntry>

Definition at line 146 of file layout.h.

◆ LayoutNavEntryList

using LayoutNavEntryList = std::vector< std::unique_ptr<LayoutNavEntry> >

Definition at line 151 of file layout.h.

Function Documentation

◆ printLayout()

void printLayout ( )

Definition at line 1821 of file layout.cpp.

1822{
1823 bool extraIndent = false;
1824
1825 auto &mgr = LayoutDocManager::instance();
1826 Debug::print(Debug::Layout,0,"Layout version {}.{}\n",mgr.majorVersion(),mgr.minorVersion());
1827
1828 Debug::print(Debug::Layout,0,"Part: Navigation index\n");
1829 for (const auto &e : mgr.rootNavEntry()->children())
1830 {
1831 printNavLayout(e.get(),2);
1832 }
1833
1834 for (int i = 0; i < LayoutDocManager::NrParts; i++)
1835 {
1837 for (const auto &lde : mgr.docEntries(static_cast<LayoutDocManager::LayoutPart>(i)))
1838 {
1839 if (const LayoutDocEntrySimple *ldes = dynamic_cast<const LayoutDocEntrySimple*>(lde.get()))
1840 {
1841 if (lde->kind() == LayoutDocEntry::MemberDeclEnd || lde->kind() == LayoutDocEntry::MemberDefEnd) extraIndent = false;
1842 Debug::print(Debug::Layout,0," {}kind: {}, visible={}\n",
1843 extraIndent? " " : "",lde->entryToString(), ldes->visible());
1844 if (lde->kind() == LayoutDocEntry::MemberDeclStart || lde->kind() == LayoutDocEntry::MemberDefStart) extraIndent = true;
1845 }
1846 else if (const LayoutDocEntryMemberDecl *lmdecl = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get()))
1847 {
1848 Debug::print(Debug::Layout,0," {}complex kind: {}, visible={}, type: {}\n",
1849 extraIndent? " " : "",lde->entryToString(),lmdecl->visible(),lmdecl->type.to_string());
1850 }
1851 else if (const LayoutDocEntryMemberDef *lmdef = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get()))
1852 {
1853 Debug::print(Debug::Layout,0," {}complex kind: {}, visible={}, type: {}\n",
1854 extraIndent? " " : "",lde->entryToString(),lmdef->visible(),lmdef->type.to_string());
1855 }
1856 else
1857 {
1858 // should not happen
1859 Debug::print(Debug::Layout,0," {}not handled kind: {}\n",extraIndent? " " : "",lde->entryToString());
1860 }
1861 }
1862 }
1863}
@ Layout
Definition debug.h:51
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
Definition debug.h:78
static std::string partToString(int k)
Definition layout.h:271
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1436
static void printNavLayout(LayoutNavEntry *root, int indent)
Definition layout.cpp:1806
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:111
Represents of a member definition list with configurable title.
Definition layout.h:131
Represents of a piece of a documentation page without configurable parts.
Definition layout.h:88

References LayoutDocManager::instance(), Debug::Layout, LayoutDocManager::partToString(), Debug::print(), and printNavLayout().

Referenced by LayoutDocManager::LayoutParser, and parseInput().

◆ writeDefaultLayoutFile()

void writeDefaultLayoutFile ( const DString & fileName)

Definition at line 1733 of file layout.cpp.

1734{
1735 std::ofstream f;
1736 if (openOutputFile(fileName,f))
1737 {
1738 TextStream t(&f);
1739 DString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
1740 t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
1741 }
1742 else
1743 {
1744 err("Failed to open file {} for writing!\n",fileName);
1745 return;
1746 }
1747 f.close();
1748}
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:88
static ResourceMgr & instance()
Returns the one and only instance of this class.
DString getAsString(const DString &name) const
Gets the resource data as a C string.
Text streaming class that buffers data.
Definition textstream.h:36
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
Definition dstring.cpp:481
#define err(fmt,...)
Definition message.h:127
bool openOutputFile(const DString &outFile, std::ofstream &f)
Definition util.cpp:4973

References err, ResourceMgr::getAsString(), ResourceMgr::instance(), openOutputFile(), and substitute().

Referenced by LayoutDocManager::LayoutParser, and readConfiguration().