-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcommon.hpp
More file actions
50 lines (34 loc) · 1.07 KB
/
Copy pathcommon.hpp
File metadata and controls
50 lines (34 loc) · 1.07 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
#pragma once
#include <string>
#include <vector>
#include <git2.h>
class noncopyable_nonmovable
{
public:
noncopyable_nonmovable(const noncopyable_nonmovable&) = delete;
noncopyable_nonmovable& operator=(const noncopyable_nonmovable&) = delete;
noncopyable_nonmovable(noncopyable_nonmovable&&) = delete;
noncopyable_nonmovable& operator=(noncopyable_nonmovable&&) = delete;
protected:
noncopyable_nonmovable() = default;
~noncopyable_nonmovable() = default;
};
class libgit2_object : private noncopyable_nonmovable
{
public:
libgit2_object();
~libgit2_object();
};
std::string get_current_git_path();
struct status_messages
{
std::string short_mod;
std::string long_mod;
};
status_messages get_status_msg(git_status_t);
using stream_colour_fn = std::ostream& (*)(std::ostream&);
std::string read_file(const std::string& path);
std::vector<std::string> split_input_at_newlines(std::string_view str);
// Remove whitespace from start and end of a string.
std::string trim(const std::string& str);
std::string oid_to_hex(const git_oid& oid);