Doxygen XLinks
by
V: 2511R0
Website: doxygen
Loading...
Searching...
No Matches
exclamations.hpp
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of \dxl - A doxygen post-processor that allows to define smarter
4/// <b>Doxygen</b>-links.
5///
6/// \emoji :copyright: 2025-2026 A-Worx GmbH, Germany.
7/// Published under \ref mainpage_license "Boost Software License".
8//==================================================================================================
9#ifndef HPP_DXL_EXCLAMATIONS
10#define HPP_DXL_EXCLAMATIONS
11#pragma once
12#include "ALib.Strings.H"
15#include "ALib.System.H"
16
17namespace dxl {
18
19/// Reads a text file with exclamation definitions. Entries have the format
20/// filename, line [, col]
21/// Method Includes tests a source location for beeing excluded.
23
24 /// An entry of the exclamation file.
25 class Entry {
26 friend struct ExclamationFile;
27
28 protected:
29 /// The path or a portion of it of the HTML file that the exclamation is defined for.
31
32 /// The line number in #FilePath of the exclamation.
33 int Line;
34
35 /// The column in #Line in #FilePath of the exclamation.
36 int Column;
37
38 /// The line number in #FilePath that this entry was defined at.
39 int DefinitionLine; ///< The line number of the exclamation file.
40
41 /// Is set when this entry was used. When the program exits, all entries that have not
42 /// been hit are displayed.
43 bool Used;
44
45 public:
46 /// Constructs an entry.
47 /// @param filePath Assigned to the field member #FilePath.
48 /// @param line Assigned to the field member #Line.
49 /// @param column Assigned to the field member #Column.
50 /// @param definitionLine Assigned to the field member #DefinitionLine.
51 Entry(alib::String filePath, int line, int column, int definitionLine)
52 : FilePath{filePath}, Line{line}, Column{column}, DefinitionLine{definitionLine}
53 , Used{false} {}
54
55 /// Tests if the given pair of \p{line} and \p{colum} are equal to what is defined with
56 /// this rule.
57 /// @param line The line to test.
58 /// @param column The colum to test.
59 /// @return \c true if this exclamation denotes the given position, \c false otherwise.
60 bool Matches(int line, int column ) {
61 if ( Line == line && column == Column) {
62 Used= true;
63 return true;
64 }
65 return false;
66 }
67 };
68
69 /// A simple linear list of entries.
70 alib::ListMA<Entry> List; // todo: make forward list?
71
72 /// Constructor
74 : List{alib::monomem::GLOBAL_ALLOCATOR} {}
75
76 /// Reads an exclamation file.
77 /// @param filePath The path to the file to read.
78 void Read(const alib::CString& filePath);
79
80
81 /// Collects all rules to a given filePath in the given \p{result} vector.
82 /// @param filePath todox
83 /// @param result Filled with all rules defined for the file specified by \p{filePath}.
84 void Get(const alib::system::PathString& filePath, alib::StdVectorMA<Entry*>& result);
85};
86
87
88} //namespace [dxl]
89
90
91#endif // HPP_DXL_EXCLAMATIONS
int Line
The line number in FilePath of the exclamation.
int DefinitionLine
The line number in FilePath that this entry was defined at.
alib::String128 FilePath
The path or a portion of it of the HTML file that the exclamation is defined for.
Entry(alib::String filePath, int line, int column, int definitionLine)
int Column
The column in Line in FilePath of the exclamation.
bool Matches(int line, int column)
strings::TString< PathCharType > PathString
strings::TCString< character > CString
containers::List< T, MonoAllocator, TRecycling > ListMA
strings::TString< character > String
LocalString< 128 > String128
std::vector< T, StdMA< T > > StdVectorMA
todox
Definition doxyfile.cpp:20
ExclamationFile()
Constructor.
void Read(const alib::CString &filePath)
void Get(const alib::system::PathString &filePath, alib::StdVectorMA< Entry * > &result)
alib::ListMA< Entry > List
A simple linear list of entries.