generated from ssciwr/cpp-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtree.h
37 lines (32 loc) · 1.13 KB
/
tree.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
#ifndef TREE_H
#define TREE_H
#include "object.h"
#include <boost/filesystem.hpp>
#include <string>
#include <unordered_map>
namespace fs = boost::filesystem;
class GitTree : public GitObject {
public:
GitTree(const std::string &data = std::string(""));
void deserialise(
const std::string &data) override; // convert string format to data object
std::string
serialise(GitRepository &repo) override; // convert this to a string format
std::string print_matching_files(
GitRepository &repo,
const std::string &filePathPattern); // print tree entries that
// match the given file path
static void instantiate_tree(
GitTree *treeToInstantiate, GitTree *curr_tree,
const fs::path
&path); // instantiate a tree object in the working directory
static void instantiate_tree(
GitTree *treeToInstantiate,
const fs::path
&path); // instantiate a tree object in the working directory
void init();
protected:
std::vector<std::string> pathNames;
std::unordered_map<std::string, std::tuple<int, std::string>> fileEntries;
};
#endif // TREE_H