Documentation for OpenFLUID 2.2.0
WareSrcDocalyzer.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30  */
31 
32 
33 /**
34  @file WareSrcDocalyzer.hpp
35 
36  @author Jean-Christophe Fabre <jean-christophe.fabre@inrae.fr>
37 */
38 
39 
40 #ifndef __OPENFLUID_WARESDEV_WARESRCDOCALYZER_HPP__
41 #define __OPENFLUID_WARESDEV_WARESRCDOCALYZER_HPP__
42 
43 
44 #include <string>
45 #include <vector>
46 
49 #include <openfluid/dllexport.hpp>
50 
51 
52 namespace openfluid { namespace waresdev {
53 
54 
55 /**
56  Class to check wares source code
57 */
59 {
60  private:
61 
62  const openfluid::tools::FilesystemPath m_SrcPathObj;
63 
64  const openfluid::tools::FilesystemPath m_OutPathObj;
65 
66  const openfluid::tools::FilesystemPath m_DocalyzerSharePathObj;
67 
68  WareSrcDocalyzerListener* mp_Listener;
69 
70  std::vector<std::string> m_InputFormats;
71 
73 
74  struct DocData
75  {
76 
78 
80 
81  std::string Signature;
82 
83  std::string Content;
84 
85  void clear()
86  {
87  ID.clear();
89  Signature.clear();
90  Content.clear();
91  }
92 
93  std::string getTypeAsText() const;
94 
95  } m_DocData;
96 
97  void clear();
98 
99  const std::vector<std::string> getMainFileRelativePath(const std::string& Format) const;
100 
101  static std::string getGeneratedFileName(const std::string& FilePart, const std::string& FileExt = "");
102 
103  const openfluid::tools::FilesystemPath getGeneratedFilePath(const std::string& FilePart,
104  const std::string& FileExt = "tex") const;
105 
106  const std::string detectFormat() const;
107 
108  void processSignature(bool IgnoreEmptyFields);
109 
110  void processLatexContent();
111 
112  void processRmarkdownContent();
113 
114  void processMarkdownContent();
115 
116  void processReadmeContent();
117 
118  void processContent(const std::string& Format);
119 
120  void integrateDocument(const std::string& Format) const;
121 
122  void buildDocument() const;
123 
124  void releaseDocument() const;
125 
126 
127  public:
128 
130 
131  /**
132  Constructs a docalyzer
133  @param[in] SrcPath The path to the sources to docalyze
134  @param[in] OutputPath The path where to put the built documentation
135  @param Listener The Listener for Docalyzer actions
136  @param[in] InputFormats The doc format searched by the docalyzer (searches for all possible formats if empty)
137  */
138  WareSrcDocalyzer(const std::string& SrcPath, const std::string& OutputPath, WareSrcDocalyzerListener* Listener,
139  std::vector<std::string> InputFormats);
140 
141  void performDocalyze(bool KeepWorkData = false, bool IncludeEmptyFields = false);
142 
143 };
144 
145 
146 } } // namespaces
147 
148 
149 #endif /* __OPENFLUID_WARESDEV_WARESRCDOCALYZER_HPP__ */
Definition: FilesystemPath.hpp:62
Definition: WareSrcDocalyzerListener.hpp:52
Definition: WareSrcDocalyzer.hpp:59
WareSrcDocalyzer(const std::string &SrcPath, const std::string &OutputPath, WareSrcDocalyzerListener *Listener, std::vector< std::string > InputFormats)
void performDocalyze(bool KeepWorkData=false, bool IncludeEmptyFields=false)
#define OPENFLUID_API
Definition: dllexport.hpp:86
WareType
Definition: TypeDefs.hpp:61
std::string WareID_t
Definition: TypeDefs.hpp:49
Definition: ApplicationException.hpp:47