From e9047f995ade0c7b357ccc07789546424d73ac8f Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 27 Nov 2023 16:09:38 +0100 Subject: [PATCH] Minor: format to Unix. --- library/include/mobilisis/utilities.h | 170 +++++++++++++------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/library/include/mobilisis/utilities.h b/library/include/mobilisis/utilities.h index f6e489f..d2dbd64 100644 --- a/library/include/mobilisis/utilities.h +++ b/library/include/mobilisis/utilities.h @@ -1,85 +1,85 @@ -#pragma once -#include -#include -#include -#include -#include - -#include "day_of_week.h" -#include "configuration.h" -#include "time_range.h" -#include "payment_method.h" - -#include - -using namespace std; - -namespace Utilities { - /// - /// Get day of week from current date (Zeller's Algorithm), starting day is Sunday - /// - /// - /// - DayOfWeek GetDayOfWeek(struct tm* tm); - - /// - /// Date and time parse helper function - /// - /// Returns time (tm) structure - struct tm DateTimeToStructTm(const char* dateTimeStr); - - /// - /// Date parse helper function - /// - /// Returns time (tm) structure - struct tm DateToStructTm(const char* dateStr); - - /// - /// Time parse helper function - /// - /// Returns time (tm) structure - struct tm TimeToStructTm(const char* timeStr, int year, int mon, int mday, int wday); - - /// - /// Get current local time - /// - /// Returns time_t structure - time_t GetCurrentLocalTime(); - - /// - /// Zeller's algorithm for determining day of week - /// - int ZellersAlgorithm(int day, int month, int year); - - /// - /// Checks if current datetime is in range between start and end month of parking worktime - /// - /// - /// - /// - bool IsYearPeriodActive(Configuration* cfg, struct tm* currentDateTime); - bool IsYearPeriodActive(Configuration const *cfg, QDateTime const ¤tDateTime); - - /// - /// Check permissions - /// - bool CheckSpecialDay(Configuration* cfg, const char* currentDateTimeStr, int* specialDayId, double* specialDayPrice); - bool CheckSpecialDay(Configuration const *cfg, - QDateTime const ¤tDateTimeS, - int* specialDayId, uint32_t *specialDayPrice); - - /// - /// Calculates price per unit - /// - /// - /// - double CalculatePricePerUnit(double pra_price, double durationUnit = -1); - - QTime SpecialDaysWorkTimeFrom(Configuration const *cfg, int specialDayId); - QTime SpecialDaysWorkTimeUntil(Configuration const *cfg, int specialDayId); - QTime WeekDaysWorkTimeFrom(std::multimap::const_iterator itr); - QTime WeekDaysWorkTimeUntil(std::multimap::const_iterator itr); - bool isCarryOverSet(Configuration const *cfg, PaymentMethod paymentMethodId); - bool isCarryOverNotSet(Configuration const *cfg, PaymentMethod paymentMethodId); - PaymentMethod getPaymentMethodId(Configuration const *cfg); -} +#pragma once +#include +#include +#include +#include +#include + +#include "day_of_week.h" +#include "configuration.h" +#include "time_range.h" +#include "payment_method.h" + +#include + +using namespace std; + +namespace Utilities { + /// + /// Get day of week from current date (Zeller's Algorithm), starting day is Sunday + /// + /// + /// + DayOfWeek GetDayOfWeek(struct tm* tm); + + /// + /// Date and time parse helper function + /// + /// Returns time (tm) structure + struct tm DateTimeToStructTm(const char* dateTimeStr); + + /// + /// Date parse helper function + /// + /// Returns time (tm) structure + struct tm DateToStructTm(const char* dateStr); + + /// + /// Time parse helper function + /// + /// Returns time (tm) structure + struct tm TimeToStructTm(const char* timeStr, int year, int mon, int mday, int wday); + + /// + /// Get current local time + /// + /// Returns time_t structure + time_t GetCurrentLocalTime(); + + /// + /// Zeller's algorithm for determining day of week + /// + int ZellersAlgorithm(int day, int month, int year); + + /// + /// Checks if current datetime is in range between start and end month of parking worktime + /// + /// + /// + /// + bool IsYearPeriodActive(Configuration* cfg, struct tm* currentDateTime); + bool IsYearPeriodActive(Configuration const *cfg, QDateTime const ¤tDateTime); + + /// + /// Check permissions + /// + bool CheckSpecialDay(Configuration* cfg, const char* currentDateTimeStr, int* specialDayId, double* specialDayPrice); + bool CheckSpecialDay(Configuration const *cfg, + QDateTime const ¤tDateTimeS, + int* specialDayId, uint32_t *specialDayPrice); + + /// + /// Calculates price per unit + /// + /// + /// + double CalculatePricePerUnit(double pra_price, double durationUnit = -1); + + QTime SpecialDaysWorkTimeFrom(Configuration const *cfg, int specialDayId); + QTime SpecialDaysWorkTimeUntil(Configuration const *cfg, int specialDayId); + QTime WeekDaysWorkTimeFrom(std::multimap::const_iterator itr); + QTime WeekDaysWorkTimeUntil(std::multimap::const_iterator itr); + bool isCarryOverSet(Configuration const *cfg, PaymentMethod paymentMethodId); + bool isCarryOverNotSet(Configuration const *cfg, PaymentMethod paymentMethodId); + PaymentMethod getPaymentMethodId(Configuration const *cfg); +}