Doxygen
Loading...
Searching...
No Matches
layout.h File Reference

#include <src/layout.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

Definition at line 34 of file layout.h.

◆ ESPEC [1/2]

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

Definition at line 68 of file layout.h.

◆ ESPEC [2/2]

#define ESPEC ( x)
Value:
x,

Definition at line 68 of file layout.h.

◆ NAV_SPECIFICATIONS

#define NAV_SPECIFICATIONS

Definition at line 157 of file layout.h.

◆ NSPEC [1/2]

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

Definition at line 197 of file layout.h.

◆ NSPEC [2/2]

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

Definition at line 197 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:270

Definition at line 259 of file layout.h.

◆ PSPEC [1/2]

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

Definition at line 270 of file layout.h.

◆ PSPEC [2/2]

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

Definition at line 270 of file layout.h.

Typedef Documentation

◆ LayoutDocEntryList

using LayoutDocEntryList = std::vector<LayoutDocEntryPtr>

Definition at line 148 of file layout.h.

◆ LayoutDocEntryPtr

using LayoutDocEntryPtr = std::unique_ptr<LayoutDocEntry>

Definition at line 147 of file layout.h.

◆ LayoutNavEntryList

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

Definition at line 152 of file layout.h.

Function Documentation

◆ printLayout()

void printLayout ( )

Definition at line 1861 of file layout.cpp.

1862{
1863 bool extraIndent = false;
1864
1865 auto &mgr = LayoutDocManager::instance();
1866 Debug::print(Debug::Layout,0,"Layout version {}.{}\n",mgr.majorVersion(),mgr.minorVersion());
1867
1868 Debug::print(Debug::Layout,0,"Part: Navigation index\n");
1869 for (const auto &e : mgr.rootNavEntry()->children())
1870 {
1871 printNavLayout(e.get(),2);
1872 }
1873
1874 for (int i = 0; i < LayoutDocManager::NrParts; i++)
1875 {
1877 for (const auto &lde : mgr.docEntries(static_cast<LayoutDocManager::LayoutPart>(i)))
1878 {
1879 if (const LayoutDocEntrySimple *ldes = dynamic_cast<const LayoutDocEntrySimple*>(lde.get()))
1880 {
1881 if (lde->kind() == LayoutDocEntry::MemberDeclEnd || lde->kind() == LayoutDocEntry::MemberDefEnd) extraIndent = false;
1882 Debug::print(Debug::Layout,0," {}kind: {}, visible={}\n",
1883 extraIndent? " " : "",lde->entryToString(), ldes->visible());
1884 if (lde->kind() == LayoutDocEntry::MemberDeclStart || lde->kind() == LayoutDocEntry::MemberDefStart) extraIndent = true;
1885 }
1886 else if (const LayoutDocEntryMemberDecl *lmdecl = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get()))
1887 {
1888 Debug::print(Debug::Layout,0," {}complex kind: {}, visible={}, type: {}\n",
1889 extraIndent? " " : "",lde->entryToString(),lmdecl->visible(),lmdecl->type.to_string());
1890 }
1891 else if (const LayoutDocEntryMemberDef *lmdef = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get()))
1892 {
1893 Debug::print(Debug::Layout,0," {}complex kind: {}, visible={}, type: {}\n",
1894 extraIndent? " " : "",lde->entryToString(),lmdef->visible(),lmdef->type.to_string());
1895 }
1896 else
1897 {
1898 // should not happen
1899 Debug::print(Debug::Layout,0," {}not handled kind: {}\n",extraIndent? " " : "",lde->entryToString());
1900 }
1901 }
1902 }
1903}
@ 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:276
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1476
static void printNavLayout(LayoutNavEntry *root, int indent)
Definition layout.cpp:1846
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:112
Represents of a member definition list with configurable title.
Definition layout.h:132
Represents of a piece of a documentation page without configurable parts.
Definition layout.h:89

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 1773 of file layout.cpp.

1774{
1775 std::ofstream f;
1776 if (openOutputFile(fileName,f))
1777 {
1778 TextStream t(&f);
1779 DString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
1780 t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
1781 }
1782 else
1783 {
1784 err("Failed to open file {} for writing!\n",fileName);
1785 return;
1786 }
1787 f.close();
1788}
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
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:485
#define err(fmt,...)
Definition message.h:127
bool openOutputFile(const DString &outFile, std::ofstream &f)
Definition util.cpp:5122

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

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