forked from QuantStack/git2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit_wrapper.hpp
More file actions
52 lines (32 loc) · 1.06 KB
/
Copy pathcommit_wrapper.hpp
File metadata and controls
52 lines (32 loc) · 1.06 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 <git2.h>
#include <vector>
#include <string>
#include "../wrapper/wrapper_base.hpp"
class commit_wrapper : public wrapper_base<git_commit>
{
public:
using base_type = wrapper_base<git_commit>;
~commit_wrapper();
commit_wrapper(commit_wrapper&&) noexcept = default;
commit_wrapper& operator=(commit_wrapper&&) noexcept = default;
operator git_object*() const noexcept;
const git_oid& oid() const;
std::string commit_oid_tostr() const;
private:
commit_wrapper(git_commit* commit);
friend class repository_wrapper;
friend class reference_wrapper;
};
class commit_list_wrapper : public wrapper_base<git_commit*>
{
public:
using base_type = wrapper_base<git_commit*>;
explicit commit_list_wrapper(std::vector<commit_wrapper> commit_list);
~commit_list_wrapper();
commit_list_wrapper(commit_list_wrapper&&) noexcept = default;
commit_list_wrapper& operator=(commit_list_wrapper&&) noexcept = default;
size_t size() const;
private:
std::vector<commit_wrapper> m_commit_list;
};