teditor  1.8.0@@fee5e94
Terminal based editor written in C++
todo/objects.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include "core/time_utils.h"
5 #include <vector>
6 
7 namespace teditor {
8 namespace todo {
9 
10 enum RepeatType {
16 }; // enum RepeatType
17 
18 RepeatType strToRepeatType(const std::string& str);
19 
20 struct CalendarItem {
22  bool hasStart;
24  bool hasEnd;
26  std::string description;
27 
29  CalendarItem(const TimePoint& s, RepeatType r, const std::string& d);
30  CalendarItem(const TimePoint& s, const TimePoint& e, RepeatType r,
31  const std::string& d);
32  void clear();
33  TimePoint getNextOccurence(const TimePoint& pt) const;
34 }; // struct CalendarItem
35 
36 struct MatchItem {
37  int idx;
39 }; // struct MatchItem
40 
41 typedef std::vector<CalendarItem> CalendarItems;
42 typedef std::vector<MatchItem> CalendarMatches;
43 
45  const TimePoint& start, const TimePoint& end);
46 
47 } // namespace todo
48 } // namespace teditor
teditor::todo::CalendarItem::end
TimePoint end
Definition: todo/objects.h:23
teditor::todo::CalendarItem::start
TimePoint start
Definition: todo/objects.h:21
teditor::todo::RepeatType
RepeatType
Definition: todo/objects.h:10
teditor::todo::Repeat_None
@ Repeat_None
Definition: todo/objects.h:11
teditor::todo::MatchItem::pt
TimePoint pt
Definition: todo/objects.h:38
teditor::todo::CalendarItem::hasStart
bool hasStart
Definition: todo/objects.h:22
teditor::todo::CalendarItem::description
std::string description
Definition: todo/objects.h:26
teditor::todo::CalendarItems
std::vector< CalendarItem > CalendarItems
Definition: todo/objects.h:41
teditor::todo::CalendarMatches
std::vector< MatchItem > CalendarMatches
Definition: todo/objects.h:42
teditor::todo::CalendarItem::CalendarItem
CalendarItem()
Definition: todo/objects.h:28
teditor::todo::Repeat_Yearly
@ Repeat_Yearly
Definition: todo/objects.h:12
teditor::todo::CalendarItem
Definition: todo/objects.h:20
teditor::todo::strToRepeatType
RepeatType strToRepeatType(const std::string &str)
Definition: objects.cpp:11
teditor::todo::Repeat_Weekly
@ Repeat_Weekly
Definition: todo/objects.h:14
teditor::todo::MatchItem
Definition: todo/objects.h:36
teditor::todo::CalendarItem::getNextOccurence
TimePoint getNextOccurence(const TimePoint &pt) const
Definition: objects.cpp:38
teditor::todo::Repeat_Monthly
@ Repeat_Monthly
Definition: todo/objects.h:13
teditor::todo::CalendarItem::clear
void clear()
Definition: objects.cpp:31
teditor::TimePoint
std::chrono::system_clock::time_point TimePoint
Definition: time_utils.h:7
teditor::todo::CalendarItem::repeat
RepeatType repeat
Definition: todo/objects.h:25
time_utils.h
teditor::todo::Repeat_Daily
@ Repeat_Daily
Definition: todo/objects.h:15
teditor::todo::findMatchesIn
CalendarMatches findMatchesIn(const CalendarItems &items, const TimePoint &start, const TimePoint &end)
Definition: objects.cpp:54
teditor::todo::MatchItem::idx
int idx
Definition: todo/objects.h:37
teditor::todo::CalendarItem::hasEnd
bool hasEnd
Definition: todo/objects.h:24
teditor
Definition: any.hpp:10