Doxygen
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 "qcstring.h"
23
24class ClassDef;
25class MemberName;
26
27/** Data associated with an example. */
28struct Example
29{
30 Example(const QCString &a,const QCString &n,const QCString &f) : anchor(a), name(n), file(f) {}
34};
35
36class ExampleList : 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
A abstract class representing of a compound symbol.
Definition classdef.h:104
bool inSort(const Example &ex)
Definition example.h:39
This is an alternative implementation of QCString.
Definition qcstring.h:101
DirIterator begin(DirIterator it) noexcept
Definition dir.cpp:170
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:175
Data associated with an example.
Definition example.h:29
QCString name
Definition example.h:32
Example(const QCString &a, const QCString &n, const QCString &f)
Definition example.h:30
QCString file
Definition example.h:33
QCString anchor
Definition example.h:31