Plugins
ugdocu_misc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2016: G-CSC, Goethe University Frankfurt
3  * Author: Martin Rupp
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __UG__UGDOCU_MISC_H__
34 #define __UG__UGDOCU_MISC_H__
35 
37 #include "registry/class_helper.h"
38 
39 namespace ug
40 {
41 namespace DocuGen
42 {
43 
46 
47 bool IsPluginGroup(std::string g);
48 std::string GetFilenameForGroup(std::string s, std::string dir="");
51 
55  const bridge::ExportedFunction *j);
56 
57 std::string tohtmlstring(const std::string &str);
58 
59 void ParameterToString(std::ostream &file, const bridge::ParameterInfo &par, int i, bool bHTML);
60 
61 template<typename T>
62 static void WriteParametersIn(std::ostream &file, const T &thefunc, bool bHTML=true)
63 {
64  file << "(";
65  for(size_t i=0; i < (size_t)thefunc.params_in().size(); ++i)
66  {
67  if(i>0) file << ", ";
68  ParameterToString(file, thefunc.params_in(), i, bHTML);
69  if(i<thefunc.num_parameter())
70  file << thefunc.parameter_name(i);
71  }
72  file << ")";
73 }
74 template<typename T>
75 static void WriteParametersOut(std::ostream &file, const T &thefunc, bool bHTML=true)
76 {
77  if(thefunc.params_out().size() == 1)
78  {
79  ParameterToString(file, thefunc.params_out(), 0, bHTML);
80  //file << " " << thefunc.return_name();
81  }
82  else if(thefunc.params_out().size() > 1)
83  {
84  file << "(";
85  for(int i=0; i < thefunc.params_out().size(); ++i)
86  {
87  if(i>0) file << ", ";
88  ParameterToString(file, thefunc.params_out(), i, bHTML);
89  }
90  file << ")";
91  }
92  else
93  {
94  file << "void ";
95  }
96 }
97 
98 
99 void WriteClassHierarchy(std::ostream &file, bridge::ClassHierarchy &c);
100 
101 
103 {
104 public:
105  std::vector<UGDocuClassDescription> classesAndGroups;
106  std::vector<bridge::ExportedFunction*> functions;
107 };
108 
109 
110 std::string GetBeautifiedTag(std::string tag);
111 
112 // end group apps_ugdocu
114 
115 } // namespace DocuGen
116 } // namespace ug
117 
118 #endif /* __UG__UGDOCU_MISC_H__ */
Definition: ugdocu_misc.h:103
std::vector< UGDocuClassDescription > classesAndGroups
Definition: ugdocu_misc.h:105
std::vector< bridge::ExportedFunction * > functions
Definition: ugdocu_misc.h:106
bool ExportedFunctionsGroupSort(const bridge::ExportedFunction *i, const bridge::ExportedFunction *j)
Definition: ugdocu_misc.cpp:85
void WriteClassHierarchy(const char *dir, ClassHierarchy &hierarchy)
Definition: html_generation.cpp:371
bool ExportedClassSort(const IExportedClass *i, const IExportedClass *j)
Definition: ugdocu_misc.cpp:75
bool ExportedFunctionsSort(const bridge::ExportedFunctionBase *i, const bridge::ExportedFunctionBase *j)
Definition: ugdocu_misc.cpp:80
static void WriteParametersOut(std::ostream &file, const T &thefunc, bool bHTML=true)
Definition: ugdocu_misc.h:75
static void WriteParametersIn(std::ostream &file, const T &thefunc, bool bHTML=true)
Definition: ugdocu_misc.h:62
bool ClassGroupDescSort(const ClassGroupDesc *i, const ClassGroupDesc *j)
Definition: ugdocu_misc.cpp:70
StringTable s
void ParameterToString(ostream &file, const bridge::ParameterInfo &par, int i, bool bHTML)
Definition: ugdocu_misc.cpp:129
string tohtmlstring(const string &str)
Definition: ugdocu_misc.cpp:96
bool IsPluginGroup(string g)
Definition: ugdocu_misc.cpp:60
string GetBeautifiedTag(string tag)
Definition: ugdocu_misc.cpp:157
string GetFilenameForGroup(string s, string dir)
Definition: ugdocu_misc.cpp:64