forked from QuantStack/git2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathannotated_commit_wrapper.hpp
More file actions
52 lines (32 loc) · 1.27 KB
/
Copy pathannotated_commit_wrapper.hpp
File metadata and controls
52 lines (32 loc) · 1.27 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
#pragma once
#include <string_view>
#include <vector>
#include <git2.h>
#include "../wrapper/wrapper_base.hpp"
class annotated_commit_wrapper : public wrapper_base<git_annotated_commit>
{
public:
using base_type = wrapper_base<git_annotated_commit>;
~annotated_commit_wrapper();
annotated_commit_wrapper(annotated_commit_wrapper&&) noexcept = default;
annotated_commit_wrapper& operator=(annotated_commit_wrapper&&) noexcept = default;
const git_oid& oid() const;
std::string_view reference_name() const;
private:
annotated_commit_wrapper(git_annotated_commit* commit);
friend class repository_wrapper;
};
class annotated_commit_list_wrapper : public wrapper_base<git_annotated_commit*>
{
public:
using base_type = wrapper_base<git_annotated_commit*>;
explicit annotated_commit_list_wrapper(std::vector<annotated_commit_wrapper> annotated_commit_list);
~annotated_commit_list_wrapper();
annotated_commit_list_wrapper(annotated_commit_list_wrapper&&) noexcept = default;
annotated_commit_list_wrapper& operator=(annotated_commit_list_wrapper&&) noexcept = default;
size_t size() const;
annotated_commit_wrapper front();
void print() const;
private:
std::vector<annotated_commit_wrapper> m_annotated_commit_list;
};