-
Notifications
You must be signed in to change notification settings - Fork 1
/
line.hpp
48 lines (35 loc) · 1.01 KB
/
line.hpp
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
#pragma once
#include <set>
#include <string>
#include <regex>
#include <vector>
#include <iostream>
#include <iterator>
class Line {
public:
Line(const std::string& s);
std::string line() const;
std::set<std::string> in() const;
std::set<std::string> out() const;
std::set<std::string> use() const;
std::set<std::string> def() const;
void set_in(const std::set<std::string>& in);
void set_out(const std::set<std::string>& out);
void print_use() const;
void print_def() const;
void print_in() const;
void print_out() const;
bool operator== (const Line& l) const;
bool operator!= (const Line& l) const;
void clean();
friend std::ostream& operator<< (std::ostream& out, const Line& l);
private:
std::set<std::string> def(const std::string& s);
std::set<std::string> use(const std::string& s);
std::string m_content;
std::set<std::string> m_in;
std::set<std::string> m_out;
std::set<std::string> m_use;
std::set<std::string> m_def;
};
std::ostream& operator<< (std::ostream& out, const Line& l);