-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkout.h
120 lines (101 loc) · 3.44 KB
/
checkout.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
* checkout.h
*
* Copyright (C) Roger P. Gee
*/
#ifndef PHPGIT2_CHECKOUT_H
#define PHPGIT2_CHECKOUT_H
#include "stubs/checkout_arginfo.h"
namespace php_git2
{
class php_git_checkout_options:
public php_option_array
{
public:
php_git_checkout_options()
{
git_checkout_init_options(&opts,GIT_CHECKOUT_OPTIONS_VERSION);
}
git_checkout_options* byval_git2()
{
if (!is_null()) {
array_wrapper arr(value);
GIT2_ARRAY_LOOKUP_LONG(arr,version,opts);
GIT2_ARRAY_LOOKUP_LONG(arr,checkout_strategy,opts);
GIT2_ARRAY_LOOKUP_LONG(arr,dir_mode,opts);
GIT2_ARRAY_LOOKUP_LONG(arr,file_mode,opts);
GIT2_ARRAY_LOOKUP_LONG(arr,file_open_flags,opts);
GIT2_ARRAY_LOOKUP_SUBOBJECT(arr,strarray,paths,opts);
// TODO Handle git_checkout_notify_cb and payload properties.
GIT2_ARRAY_LOOKUP_CALLBACK_NULLABLE(
arr,
checkout_progress_callback,
checkoutProgressCallback,
progress_cb,
progress_payload,
opts);
GIT2_ARRAY_LOOKUP_RESOURCE(arr,php_git_tree,baseline,opts);
// TODO Handle baseline_index property
GIT2_ARRAY_LOOKUP_STRING(arr,target_directory,opts);
GIT2_ARRAY_LOOKUP_STRING(arr,ancestor_label,opts);
GIT2_ARRAY_LOOKUP_STRING(arr,our_label,opts);
GIT2_ARRAY_LOOKUP_STRING(arr,their_label,opts);
// TODO Handle git_checkout_perfdata_cb and payload properties.
return &opts;
}
return nullptr;
}
private:
git_checkout_options opts;
php_git_strarray_byval_array strarray;
php_callback_sync checkoutProgressCallback;
};
} // namespace php_git2
// Functions:
static constexpr auto ZIF_git_checkout_head = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_repository*,
const git_checkout_options*>::func<git_checkout_head>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_repository>,
php_git2::php_git_checkout_options
>
>;
static constexpr auto ZIF_git_checkout_tree = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_repository*,
const git_object*,
const git_checkout_options*>::func<git_checkout_tree>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_repository>,
php_git2::php_resource_nullable<php_git2::php_git_object>,
php_git2::php_git_checkout_options
>
>;
static constexpr auto ZIF_git_checkout_index = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_repository*,
git_index*,
const git_checkout_options*>::func<git_checkout_index>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_repository>,
php_git2::php_resource_nullable<php_git2::php_git_index>,
php_git2::php_git_checkout_options
>
>;
// Function Entries:
#define GIT_CHECKOUT_FE \
PHP_GIT2_FE(git_checkout_head) \
PHP_GIT2_FE(git_checkout_tree) \
PHP_GIT2_FE(git_checkout_index)
#endif
/*
* Local Variables:
* mode:c++
* indent-tabs-mode:nil
* tab-width:4
* End:
*/