doxygen
example.h
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 
24 class ClassDef;
25 class MemberName;
26 
28 struct Example
29 {
30  Example(const QCString &a,const QCString &n,const QCString &f) : anchor(a), name(n), file(f) {}
31  QCString anchor;
32  QCString name;
33  QCString file;
34 };
35 
36 class 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
Definition: example.h:36
Data associated with an example.
Definition: example.h:28
Definition: membername.h:24
This is an alternative implementation of QCString.
Definition: qcstring.h:108
A abstract class representing of a compound symbol.
Definition: classdef.h:103