aboutsummaryrefslogtreecommitdiff
path: root/src/time.h
diff options
context:
space:
mode:
authorSanJacobs2022-04-15 20:29:24 +0200
committerSanJacobs2022-04-15 20:29:24 +0200
commitb99fe6cb748be0cf018540180bf19edd1bb1a698 (patch)
tree58920d2ef71c13bcac2ad99f326bcb3547a85069 /src/time.h
parentbae2d151ab3166bba71904f6538ed9a49273b42d (diff)
downloadsatscalc-b99fe6cb748be0cf018540180bf19edd1bb1a698.tar.gz
satscalc-b99fe6cb748be0cf018540180bf19edd1bb1a698.tar.bz2
satscalc-b99fe6cb748be0cf018540180bf19edd1bb1a698.zip
Added padding 0s and made time-system way comfier
Diffstat (limited to 'src/time.h')
-rwxr-xr-xsrc/time.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/time.h b/src/time.h
index 02505a5..f597c2d 100755
--- a/src/time.h
+++ b/src/time.h
@@ -1,5 +1,8 @@
#pragma once
#include <iostream>
+#include <sstream>
+#include <ios>
+#include <iomanip>
struct moment{
signed int minutes;
@@ -7,6 +10,10 @@ struct moment{
signed int day;
signed int month;
signed int year;
+
+ bool operator<(const moment& other) const;
+ bool operator>(const moment& other) const;
+ bool operator=(const moment& other) const;
};
struct timeblock{
@@ -14,16 +21,14 @@ struct timeblock{
moment end;
};
-class day{
-
-};
+std::string padint(const int input, const int minimum_signs);
-timeblock timesplit(timeblock &input_block, moment splitpoint);
+timeblock timesplit(timeblock &input_block, const moment splitpoint);
// Splits a timeblock at splitpoint.
// It changes the input_block to end at splitpoint, and returns a new timeblock
// that lasts from splitpoint to where the input_block used to end.
-void wind(moment &input_moment, int minutes, int hours, int days);
+void wind(moment &input_moment, const int minutes, const int hours, const int days);
int days_in(int month, int year);