forked from AndreyG/libgit2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.h
More file actions
45 lines (35 loc) · 967 Bytes
/
Copy pathobject.h
File metadata and controls
45 lines (35 loc) · 967 Bytes
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
#pragma once
#include <git2/types.h>
#include <memory>
struct git_object;
struct git_oid;
struct git_tree;
struct git_tag;
namespace git
{
struct Repository;
struct Blob;
struct Commit;
struct Tree;
struct Tag;
struct Object
{
Object() = default;
Object(git_object * obj, Repository const &);
explicit operator bool() const { return obj_.operator bool(); }
git_otype type() const;
git_oid const & id() const;
git_blob const * as_blob() const;
git_commit const * as_commit() const;
git_tree const * as_tree() const;
git_tag const * as_tag() const;
Commit to_commit() /*&&*/;
Tree to_tree() /*&&*/;
Blob to_blob() /*&&*/;
Tag to_tag() /*&&*/;
private:
struct Destroy { void operator() (git_object*) const; };
std::unique_ptr<git_object, Destroy> obj_;
Repository const * repo_ = nullptr;
};
}