-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_database.h
More file actions
72 lines (51 loc) · 1.85 KB
/
Copy pathread_database.h
File metadata and controls
72 lines (51 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// COVTOOL -- test coverage analysis tool.
// Copyright (C) 2002, Lowell Boggs Jr.
// mailto:lowell.boggs@attbi.com
// This file contains free software. You can redistribute it
// and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2, or
// (at your option) any later version.
// This source code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Write to the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA for a copy of the GNU General Public License.
//
#ifndef READ_DATABASE_H_INCLUDED
#define READ_DATABASE_H_INCLUDED
#include <map>
#include <set>
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
class CvT_Database
//
// This class defines the information produced by an
// execution of a program instrumented using covtool.exe.
// A CvT_Database is empty when created, you must use the
// member function, insert(), to get data into it from a
// named dtabase file. Further, multiple insert() calls
// may be made to merge multiple source files.
//
{
public:
bool insert(string filename); // load database from filename
struct File_Info
{
typedef set<int> line_table;
line_table instrumented_lines;
line_table executed_lines;
};
typedef map<string, File_Info> value_type;
private:
value_type data;
public:
typedef value_type::const_iterator const_iterator;
const_iterator find(string f) const { return data.find(f); }
const_iterator begin() const { return data.begin(); }
const_iterator end() const { return data.end(); }
};
ostream& operator<< (ostream&i, CvT_Database const &db);
#endif