Doxygen
Toggle main menu visibility
Loading...
Searching...
No Matches
example.h
Go to the documentation of this file.
1
/******************************************************************************
2
*
3
* Copyright (C) 1997-2021 by Dimitri van Heesch.
4
*
5
* Permission to use, copy, modify, and distribute this software and its
6
* documentation under the terms of the GNU General Public License is hereby
7
* granted. No representations are made about the suitability of this software
8
* for any purpose. It is provided "as is" without express or implied warranty.
9
* See the GNU General Public License for more details.
10
*
11
* Documents produced by Doxygen are derivative works derived from the
12
* input used in their production; they are not affected by this license.
13
*
14
*/
15
16
#ifndef EXAMPLE_H
17
#define EXAMPLE_H
18
19
#include <algorithm>
20
#include <vector>
21
22
#include "
dstring.h
"
23
24
class
ClassDef
;
25
class
MemberName
;
26
27
/** Data associated with an example. */
28
struct
Example
29
{
30
Example
(
const
DString
&a,
const
DString
&n,
const
DString
&f) :
anchor
(a),
name
(n),
file
(f) {}
31
DString
anchor
;
32
DString
name
;
33
DString
file
;
34
};
35
36
class
ExampleList
final :
public
std::vector<Example>
37
{
38
public
:
39
bool
inSort
(
const
Example
& ex )
40
{
41
auto
it = std::find_if(
begin
(),
end
(),[&ex](
const
Example
&e) {
return
e.
name
==ex.
name
; });
42
if
(it==
end
())
43
{
44
insert( std::upper_bound(
begin
(),
end
(), ex,
45
[](
const
auto
&e1,
const
auto
&e2) {
return
e1.name < e2.name; }
46
), ex
47
);
48
return
true
;
49
}
50
return
false
;
51
}
52
};
53
54
#endif
ClassDef
A abstract class representing of a compound symbol.
Definition
classdef.h:100
DString
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition
dstring.h:88
ExampleList
Definition
example.h:37
ExampleList::inSort
bool inSort(const Example &ex)
Definition
example.h:39
MemberName
Definition
membername.h:23
begin
DirIterator begin(DirIterator it) noexcept
Definition
dir.cpp:171
end
DirIterator end(const DirIterator &) noexcept
Definition
dir.cpp:176
dstring.h
Example
Data associated with an example.
Definition
example.h:29
Example::Example
Example(const DString &a, const DString &n, const DString &f)
Definition
example.h:30
Example::anchor
DString anchor
Definition
example.h:31
Example::name
DString name
Definition
example.h:32
Example::file
DString file
Definition
example.h:33
src
example.h
Generated by
1.19.0