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