-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworklog.h
37 lines (28 loc) · 791 Bytes
/
worklog.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 WORKLOG_H_
#define WORKLOG_H_
#include <set>
#include <string>
#include "atl/optional.h"
#include "atl/status.h"
namespace worklog {
struct Log {
int id;
std::string subject;
std::string description;
uint64_t created_at;
std::set<std::string> tags;
};
struct Config {
std::string meta_dir = ".worklog";
std::string logs_dir = ".worklog/logs";
std::string next_id = "next_id";
std::string NextIdPath() const;
};
atl::Status Validate(const Log& log);
bool LaunchEditor(const std::string& file);
atl::Optional<std::string> ContentFromEditor(const std::string& file);
atl::Status MaybeSetupWorklogSpace(const Config& conf);
bool IsInWorklogSpace(const Config& conf);
atl::Optional<int> NextId(const Config& conf);
} // namespace worklog
#endif // WORKLOG_H_