Newer
Older
/******************************************************************************
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Balasko, Jeno
* Kovacs, Ferenc
* Raduly, Csaba
*
******************************************************************************/
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef TCOV2LCOV_HH
#define TCOV2LCOV_HH
#include <string>
#include <map>
#include <vector>
// File specific data.
class TcovData
{
public:
void inc_function(const std::string& function, int n);
void inc_line(int line, int n);
inline const std::map<std::string, int>& get_functions() const { return m_functions; }
inline const std::map<int, int>& get_lines() const { return m_lines; }
private:
std::map<std::string, int> m_functions;
std::map<int, int> m_lines;
};
class Tcov2Lcov {
public:
Tcov2Lcov(const char *code_base, const char *input_dir, const char *output_file, const char *xsd_file);
~Tcov2Lcov();
int collect();
int validate() const;
int merge();
int generate();
void d_print_files() const;
private:
int collect_dir(std::string dir);
std::map<std::string, TcovData *> m_data;
std::vector<std::string> m_files; // Relative paths.
std::string m_code_base;
std::string m_input_dir;
std::string m_output_file;
std::string m_xsd_file;
int m_ver_major;
int m_ver_minor;
};
#endif // TCOV2LCOV_HH