Documentation.
[qshowdiff.git] / hunk.cpp
blobf233fa5b4b00e5fbf6b5c2432f25061664f9ddb7
1 #include "hunk.h"
2 using namespace std;
4 Hunk::iterator Hunk::begin() const
6 Hunk::iterator iter;
7 iter.it = _snippets.begin();
8 return iter;
10 Hunk::iterator Hunk::end() const
12 Hunk::iterator iter;
13 iter.it = _snippets.end();
14 return iter;
17 //private:
18 void Hunk::_copy(const Hunk &h)
20 _original_from_line = h._original_from_line;
21 _modified_from_line = h._modified_from_line;
23 vector<Snippet *>::const_iterator it = h._snippets.begin();
24 vector<Snippet *>::const_iterator it_end = h._snippets.end();
25 for(;it != it_end; it++){
26 _snippets.push_back(new Snippet(**it));
30 void Hunk::_free()
32 vector<Snippet *>::const_iterator it = _snippets.begin();
33 vector<Snippet *>::const_iterator it_end = _snippets.end();
34 for(;it != it_end; it++){
35 delete *it;
37 _snippets.clear();