Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
Timespan.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Math/Interval.h"
7#include "Math/UnrealMathUtility.h"
8#include "Misc/AssertionMacros.h"
9
10class FArchive;
11class FOutputDevice;
12class FString;
13struct UObject;
14template <typename ElementType> struct TIntervalTraits;
15
16
17/**
18 * Time span related constants.
19 */
20namespace ETimespan
21{
22 /** The maximum number of ticks that can be represented in FTimespan. */
23 inline constexpr int64 MaxTicks = 9223372036854775807;
24
25 /** The minimum number of ticks that can be represented in FTimespan. */
26 inline constexpr int64 MinTicks = -9223372036854775807 - 1;
27
28 /** The number of nanoseconds per tick. */
29 inline constexpr int64 NanosecondsPerTick = 100;
30
31 /** The number of timespan ticks per day. */
32 inline constexpr int64 TicksPerDay = 864000000000;
33
34 /** The number of timespan ticks per hour. */
35 inline constexpr int64 TicksPerHour = 36000000000;
36
37 /** The number of timespan ticks per microsecond. */
38 inline constexpr int64 TicksPerMicrosecond = 10;
39
40 /** The number of timespan ticks per millisecond. */
41 inline constexpr int64 TicksPerMillisecond = 10000;
42
43 /** The number of timespan ticks per minute. */
44 inline constexpr int64 TicksPerMinute = 600000000;
45
46 /** The number of timespan ticks per second. */
47 inline constexpr int64 TicksPerSecond = 10000000;
48
49 /** The number of timespan ticks per week. */
50 inline constexpr int64 TicksPerWeek = 6048000000000;
51
52 /** The number of timespan ticks per year (365 days, not accounting for leap years). */
53 inline constexpr int64 TicksPerYear = 365 * TicksPerDay;
54}
55
56
57/**
58 * Implements a time span.
59 *
60 * A time span is the difference between two dates and times. For example, the time span between
61 * 12:00:00 January 1, 2000 and 18:00:00 January 2, 2000 is 30.0 hours. Time spans are measured in
62 * positive or negative ticks depending on whether the difference is measured forward or backward.
63 * Each tick has a resolution of 0.1 microseconds (= 100 nanoseconds).
64 *
65 * In conjunction with the companion class FDateTime, time spans can be used to perform date and time
66 * based arithmetic, such as calculating the difference between two dates or adding a certain amount
67 * of time to a given date.
68 *
69 * When initializing time span values from single components, consider using the FromHours, FromMinutes,
70 * FromSeconds, Zero, MinValue and related methods instead of calling the overloaded constructors as
71 * they will make your code easier to read and understand.
72 *
73 * @see FDateTime
74 */
76{
77public:
78
79 /** Default constructor (zero initialization). */
81 : Ticks(0)
82 { }
83
84 /**
85 * Create and initialize a new time interval with the specified number of ticks.
86 *
87 * For better readability, consider using MinValue, MaxValue and Zero.
88 *
89 * @param Ticks The number of ticks.
90 * @see MaxValue, MinValue, Zero
91 */
92 FTimespan(int64 InTicks)
93 : Ticks(InTicks)
94 {
95 check((InTicks >= ETimespan::MinTicks) && (InTicks <= ETimespan::MaxTicks));
96 }
97
98 /**
99 * Create and initialize a new time interval with the specified number of hours, minutes and seconds.
100 *
101 * For better readability, consider using FromHours, FromMinutes and FromSeconds.
102 *
103 * @param Hours The hours component.
104 * @param Minutes The minutes component.
105 * @param Seconds The seconds component.
106 * @see FromHours, FromMinutes, FromSeconds
107 */
108 FTimespan(int32 Hours, int32 Minutes, int32 Seconds)
109 {
110 Assign(0, Hours, Minutes, Seconds, 0);
111 }
112
113 /**
114 * Create and initialize a new time interval with the specified number of days, hours, minutes and seconds.
115 *
116 * For better readability, consider using FromDays, FromHours, FromMinutes and FromSeconds.
117 *
118 * @param Days The days component.
119 * @param Hours The hours component.
120 * @param Minutes The minutes component.
121 * @param Seconds The seconds component.
122 * @see FromDays, FromHours, FromMinutes, FromSeconds
123 */
124 FTimespan(int32 Days, int32 Hours, int32 Minutes, int32 Seconds)
125 {
126 Assign(Days, Hours, Minutes, Seconds, 0);
127 }
128
129 /**
130 * Create and initialize a new time interval with the specified number of days, hours, minutes and seconds.
131 *
132 * @param Days The days component.
133 * @param Hours The hours component.
134 * @param Minutes The minutes component.
135 * @param Seconds The seconds component.
136 * @param FractionNano The fractional seconds (in nanosecond resolution).
137 */
138 FTimespan(int32 Days, int32 Hours, int32 Minutes, int32 Seconds, int32 FractionNano)
139 {
140 Assign(Days, Hours, Minutes, Seconds, FractionNano);
141 }
142
143public:
144
145 /**
146 * Return the result of adding the given time span to this time span.
147 *
148 * @return A time span whose value is the sum of this time span and the given time span.
149 */
150 FTimespan operator+(const FTimespan& Other) const
151 {
152 return FTimespan(Ticks + Other.Ticks);
153 }
154
155 /**
156 * Adds the given time span to this time span.
157 *
158 * @return This time span.
159 */
160 FTimespan& operator+=(const FTimespan& Other)
161 {
162 Ticks += Other.Ticks;
163 return *this;
164 }
165
166 /**
167 * Return the inverse of this time span.
168 *
169 * The value of this time span must be greater than FTimespan::MinValue(), or else an overflow will occur.
170 *
171 * @return Inverse of this time span.
172 */
174 {
175 return FTimespan(-Ticks);
176 }
177
178 /**
179 * Return the result of subtracting the given time span from this time span.
180 *
181 * @param Other The time span to compare with.
182 * @return A time span whose value is the difference of this time span and the given time span.
183 */
184 FTimespan operator-(const FTimespan& Other) const
185 {
186 return FTimespan(Ticks - Other.Ticks);
187 }
188
189 /**
190 * Subtract the given time span from this time span.
191 *
192 * @param Other The time span to subtract.
193 * @return This time span.
194 */
195 FTimespan& operator-=(const FTimespan& Other)
196 {
197 Ticks -= Other.Ticks;
198 return *this;
199 }
200
201 /**
202 * Return the result of multiplying the this time span with the given scalar.
203 *
204 * @param Scalar The scalar to multiply with.
205 * @return A time span whose value is the product of this time span and the given scalar.
206 */
207 FTimespan operator*(double Scalar) const
208 {
209 return FTimespan((int64)((double)Ticks * Scalar));
210 }
211
212 /**
213 * Multiply this time span with the given scalar.
214 *
215 * @param Scalar The scalar to multiply with.
216 * @return This time span.
217 */
218 FTimespan& operator*=(double Scalar)
219 {
220 Ticks = (int64)((double)Ticks * Scalar);
221 return *this;
222 }
223
224 /**
225 * Return the result of dividing the this time span by the given scalar.
226 *
227 * @param Scalar The scalar to divide by.
228 * @return A time span whose value is the quotient of this time span and the given scalar.
229 */
230 FTimespan operator/(double Scalar) const
231 {
232 return FTimespan((int64)((double)Ticks / Scalar));
233 }
234
235 /**
236 * Divide this time span by the given scalar.
237 *
238 * @param Scalar The scalar to divide by.
239 * @return This time span.
240 */
241 FTimespan& operator/=(double Scalar)
242 {
243 Ticks = (int64)((double)Ticks / Scalar);
244 return *this;
245 }
246
247 /**
248 * Return the result of calculating the modulus of this time span with another time span.
249 *
250 * @param Other The time span to divide by.
251 * @return A time span representing the remainder of the modulus operation.
252 */
253 FTimespan operator%(const FTimespan& Other) const
254 {
255 return FTimespan(Ticks % Other.Ticks);
256 }
257
258 /**
259 * Calculate this time span modulo another.
260 *
261 * @param Other The time span to divide by.
262 * @return This time span.
263 */
264 FTimespan& operator%=(const FTimespan& Other)
265 {
266 Ticks = Ticks % Other.Ticks;
267 return *this;
268 }
269
270 /**
271 * Compare this time span with the given time span for equality.
272 *
273 * @param Other The time span to compare with.
274 * @return true if the time spans are equal, false otherwise.
275 */
276 bool operator==(const FTimespan& Other) const
277 {
278 return (Ticks == Other.Ticks);
279 }
280
281 /**
282 * Compare this time span with the given time span for inequality.
283 *
284 * @param Other The time span to compare with.
285 * @return true if the time spans are not equal, false otherwise.
286 */
287 bool operator!=(const FTimespan& Other) const
288 {
289 return (Ticks != Other.Ticks);
290 }
291
292 /**
293 * Check whether this time span is greater than the given time span.
294 *
295 * @param Other The time span to compare with.
296 * @return true if this time span is greater, false otherwise.
297 */
298 bool operator>(const FTimespan& Other) const
299 {
300 return (Ticks > Other.Ticks);
301 }
302
303 /**
304 * Check whether this time span is greater than or equal to the given time span.
305 *
306 * @param Other The time span to compare with.
307 * @return true if this time span is greater or equal, false otherwise.
308 */
309 bool operator>=(const FTimespan& Other) const
310 {
311 return (Ticks >= Other.Ticks);
312 }
313
314 /**
315 * Check whether this time span is less than the given time span.
316 *
317 * @param Other The time span to compare with.
318 * @return true if this time span is less, false otherwise.
319 */
320 bool operator<(const FTimespan& Other) const
321 {
322 return (Ticks < Other.Ticks);
323 }
324
325 /**
326 * Check whether this time span is less than or equal to the given time span.
327 *
328 * @param Other The time span to compare with.
329 * @return true if this time span is less or equal, false otherwise.
330 */
331 bool operator<=(const FTimespan& Other) const
332 {
333 return (Ticks <= Other.Ticks);
334 }
335
336public:
337
338 /**
339 * Export this time span value to a string.
340 *
341 * @param ValueStr Will hold the string value.
342 * @param DefaultValue The default value.
343 * @param Parent Not used.
344 * @param PortFlags Not used.
345 * @param ExportRootScope Not used.
346 * @return true on success, false otherwise.
347 * @see ImportTextItem
348 */
349 bool ExportTextItem(FString& ValueStr, FTimespan const& DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope) const;
350
351 /**
352 * Get the days component of this time span.
353 *
354 * @return Days component.
355 */
356 int32 GetDays() const
357 {
358 return (int32)(Ticks / ETimespan::TicksPerDay);
359 }
360
361 /**
362 * Get a time span with the absolute value of this time span.
363 *
364 * This method may overflow the timespan if its value is equal to MinValue.
365 *
366 * @return Duration of this time span.
367 * @see MinValue
368 */
370 {
371 return FTimespan(Ticks >= 0 ? Ticks : -Ticks);
372 }
373
374 /**
375 * Gets the fractional seconds (in microsecond resolution).
376 *
377 * @return Number of microseconds in fractional part.
378 * @see GetTotalMicroseconds
379 */
380 int32 GetFractionMicro() const
381 {
383 }
384
385 /**
386 * Gets the fractional seconds (in millisecond resolution).
387 *
388 * @return Number of milliseconds in fractional part.
389 * @see GetTotalMilliseconds
390 */
391 int32 GetFractionMilli() const
392 {
394 }
395
396 /**
397 * Gets the fractional seconds (in nanosecond resolution).
398 *
399 * @return Number of nanoseconds in fractional part.
400 */
401 int32 GetFractionNano() const
402 {
404 }
405
406 /**
407 * Gets the fractional ticks (in 100 nanosecond resolution).
408 *
409 * @return Number of ticks in fractional part.
410 */
411 int32 GetFractionTicks() const
412 {
413 return (int32)(Ticks % ETimespan::TicksPerSecond);
414 }
415
416 /**
417 * Gets the hours component of this time span.
418 *
419 * @return Hours component.
420 * @see GetTotalHours
421 */
422 int32 GetHours() const
423 {
424 return (int32)((Ticks / ETimespan::TicksPerHour) % 24);
425 }
426
427 /**
428 * Get the minutes component of this time span.
429 *
430 * @return Minutes component.
431 * @see GetTotalMinutes
432 */
433 int32 GetMinutes() const
434 {
435 return (int32)((Ticks / ETimespan::TicksPerMinute) % 60);
436 }
437
438 /**
439 * Get the seconds component of this time span.
440 *
441 * @return Seconds component.
442 * @see GetTotalSeconds
443 */
444 int32 GetSeconds() const
445 {
446 return (int32)((Ticks / ETimespan::TicksPerSecond) % 60);
447 }
448
449 /**
450 * Get the number of ticks represented by this time span.
451 *
452 * @return Number of ticks.
453 */
454 int64 GetTicks() const
455 {
456 return Ticks;
457 }
458
459 /**
460 * Get the total number of days represented by this time span.
461 *
462 * @return Number of days.
463 * @see GetDays
464 */
465 double GetTotalDays() const
466 {
467 return ((double)Ticks / ETimespan::TicksPerDay);
468 }
469
470 /**
471 * Get the total number of hours represented by this time span.
472 *
473 * @return Number of hours.
474 * @see GetHours
475 */
476 double GetTotalHours() const
477 {
478 return ((double)Ticks / ETimespan::TicksPerHour);
479 }
480
481 /**
482 * Get the total number of microseconds represented by this time span.
483 *
484 * @return Number of microseconds.
485 * @see GetFractionMicro
486 */
487 double GetTotalMicroseconds() const
488 {
489 return ((double)Ticks / ETimespan::TicksPerMicrosecond);
490 }
491
492 /**
493 * Get the total number of milliseconds represented by this time span.
494 *
495 * @return Number of milliseconds.
496 * @see GetFractionMilli
497 */
498 double GetTotalMilliseconds() const
499 {
500 return ((double)Ticks / ETimespan::TicksPerMillisecond);
501 }
502
503 /**
504 * Get the total number of minutes represented by this time span.
505 *
506 * @return Number of minutes.
507 * @see GetMinutes
508 */
509 double GetTotalMinutes() const
510 {
511 return ((double)Ticks / ETimespan::TicksPerMinute);
512 }
513
514 /**
515 * Get the total number of seconds represented by this time span.
516 *
517 * @return Number of seconds.
518 * @see GetSeconds
519 */
520 double GetTotalSeconds() const
521 {
522 return ((double)Ticks / ETimespan::TicksPerSecond);
523 }
524
525 /**
526 * Import a time span value from a text buffer.
527 *
528 * @param Buffer The text buffer to import from.
529 * @param PortFlags Not used.
530 * @param Parent Not used.
531 * @param ErrorText The output device for error logging.
532 * @return true on success, false otherwise.
533 * @see ExportTextItem
534 */
535 bool ImportTextItem(const TCHAR*& Buffer, int32 PortFlags, UObject* Parent, FOutputDevice* ErrorText);
536
537 /**
538 * Check whether this time span is zero.
539 *
540 * @return true if the time span is zero, false otherwise.
541 * @see Zero
542 */
543 bool IsZero() const
544 {
545 return (Ticks == 0LL);
546 }
547
548 /**
549 * Serialize this time span from or into the specified archive.
550 *
551 * @param Ar The archive to serialize from or into.
552 * @return true on success, false otherwise.
553 */
555
556 /**
557 * Serializes this date and time for network transmission
558 */
559 bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess);
560
561 /**
562 * Return the string representation of this time span using a default format.
563 *
564 * The returned string has the following format:
565 * p[d.]hh:mm:ss.fff
566 *
567 * Note that 'p' is the plus or minus sign, and the date component is
568 * omitted for time spans that are shorter than one day.
569 *
570 * Examples:
571 * -42.15:11:36.457 (45 days, 15 hours, 11 minutes, 36.457 seconds in the past)
572 * +42.15:11:36.457 (45 days, 15 hours, 11 minutes, 36.457 seconds in the future)
573 * +15:11:36.457 (15 hours, 11 minutes, 36.457 seconds in the future)
574 * +00:11:36.457 (11 minutes, 36.457 seconds in the future)
575 * +00:00:36.457 (36.457 seconds in the future)
576 *
577 * @return String representation.
578 * @see Parse
579 */
581
582 /**
583 * Convert this time span to its string representation.
584 *
585 * The following formatting codes are available:
586 * %d - prints the days component
587 * %D - prints the zero-padded days component (00000000..10675199)
588 * %h - prints the zero-padded hours component (00..23)
589 * %m - prints the zero-padded minutes component (00..59)
590 * %s - prints the zero-padded seconds component (00..59)
591 * %f - prints the zero-padded fractional seconds (000..999)
592 * %u - prints the zero-padded fractional seconds (000000..999999)
593 * %n - prints the zero-padded fractional seconds (000000000..999999999)
594 *
595 * Depending on whether the time span is positive or negative, a plus or minus
596 * sign character will always be added in front of the generated string.
597 *
598 * @param Format The format of the returned string.
599 * @return String representation.
600 * @see Parse
601 */
602 FString ToString(const TCHAR* Format) const;
603
604public:
605
606 /**
607 * Create a time span that represents the specified number of days.
608 *
609 * @param Days The number of days.
610 * @return Time span.
611 * @see FromHours, FromMicroseconds, FromMilliseconds, FromMinutes, FromSeconds
612 */
613 static FTimespan FromDays(double Days)
614 {
615 return FTimespan((int64)FMath::FloorToDouble(Days * ETimespan::TicksPerDay + 0.5));
616 }
617
618 /**
619 * Create a time span that represents the specified number of hours.
620 *
621 * @param Hours The number of hours.
622 * @return Time span.
623 * @see FromDays, FromMicroseconds, FromMilliseconds, FromMinutes, FromSeconds
624 */
625 static FTimespan FromHours(double Hours)
626 {
627 return FTimespan((int64)FMath::FloorToDouble(Hours * ETimespan::TicksPerHour + 0.5));
628 }
629
630 /**
631 * Create a time span that represents the specified number of microseconds.
632 *
633 * @param Microseconds The number of microseconds.
634 * @return Time span.
635 * @see FromDays, FromHours, FromMinutes, FromSeconds, FromMilliseconds
636 */
637 static FTimespan FromMicroseconds(double Microseconds)
638 {
639 return FTimespan((int64)FMath::FloorToDouble(Microseconds * ETimespan::TicksPerMicrosecond + 0.5));
640 }
641
642 /**
643 * Create a time span that represents the specified number of milliseconds.
644 *
645 * @param Milliseconds The number of milliseconds.
646 * @return Time span.
647 * @see FromDays, FromHours, FromMicroseconds, FromMinutes, FromSeconds
648 */
649 static FTimespan FromMilliseconds(double Milliseconds)
650 {
651 return FTimespan((int64)FMath::FloorToDouble(Milliseconds * ETimespan::TicksPerMillisecond + 0.5));
652 }
653
654 /**
655 * Create a time span that represents the specified number of minutes.
656 *
657 * @param Minutes The number of minutes.
658 * @return Time span.
659 * @see FromDays, FromHours, FromMicroseconds, FromMilliseconds, FromSeconds
660 */
661 static FTimespan FromMinutes(double Minutes)
662 {
663 return FTimespan((int64)FMath::FloorToDouble(Minutes * ETimespan::TicksPerMinute + 0.5));
664 }
665
666 /**
667 * Create a time span that represents the specified number of seconds.
668 *
669 * @param Seconds The number of seconds.
670 * @return Time span.
671 * @see FromDays, FromHours, FromMicroseconds, FromMilliseconds, FromMinutes
672 */
673 static FTimespan FromSeconds(double Seconds)
674 {
675 return FTimespan((int64)FMath::FloorToDouble(Seconds * ETimespan::TicksPerSecond + 0.5));
676 }
677
678 /**
679 * Return the maximum time span value.
680 *
681 * The maximum time span value is slightly more than 10,675,199 days.
682 *
683 * @return Maximum time span.
684 * @see MinValue,Zero
685 */
687 {
689 }
690
691 /**
692 * Return the minimum time span value.
693 *
694 * The minimum time span value is slightly less than -10,675,199 days.
695 *
696 * @return Minimum time span.
697 * @see MaxValue, ZeroValue
698 */
700 {
702 }
703
704 /**
705 * Convert a string to a time span.
706 *
707 * The string must be in one of the following formats:
708 * p[d.]hh::mm::ss.fff
709 * p[d.]hh::mm::ss.uuuuuu
710 * p[d.]hh::mm::ss.nnnnnnnnn
711 *
712 * Note that 'p' is the plus or minus sign, and the date component may be
713 * omitted for time spans that are shorter than one day.
714 *
715 * @param TimespanString The string to convert.
716 * @param OutTimespan Will contain the parsed time span.
717 * @return true if the string was converted successfully, false otherwise.
718 * @see ToString
719 */
720 static bool Parse(const FString& TimespanString, FTimespan& OutTimespan);
721
722 /**
723 * Ratio between two time spans (handles zero values).
724 *
725 * @param Dividend The dividend.
726 * @param Divisor The divisor.
727 * @return The quotient, i.e. Dividend / Divisor.
728 */
729 static double Ratio(FTimespan Dividend, FTimespan Divisor)
730 {
731 if (Divisor == FTimespan::Zero())
732 {
733 return 0.0;
734 }
735
736 return (double)Dividend.GetTicks() / (double)Divisor.GetTicks();
737 }
738
739 /**
740 * Return the zero time span value.
741 *
742 * The zero time span value can be used in comparison operations with other time spans.
743 *
744 * @return Zero time span.
745 * @see IsZero, MaxValue, MinValue
746 */
748 {
749 return FTimespan(0);
750 }
751
752public:
753
754 friend struct UObject;
755
756 /**
757 * Serialize the given time span from or into the specified archive.
758 *
759 * @param Ar The archive to serialize from or into.
760 * @param Timespan The time span value to serialize.
761 * @return The archive.
762 */
763 friend FArchive& operator<<(FArchive& Ar, FTimespan& Timespan);
764
765 /**
766 * Get the hash for the specified time span.
767 *
768 * @param Timespan The timespan to get the hash for.
769 * @return Hash value.
770 */
771 friend uint32 GetTypeHash(const FTimespan& Timespan);
772
773protected:
774
775 /**
776 * Assign the specified components to this time span.
777 *
778 * @param Days The days component.
779 * @param Hours The hours component.
780 * @param Minutes The minutes component.
781 * @param Seconds The seconds component.
782 * @param FractionNano The fractional seconds (in nanosecond resolution).
783 */
784 void Assign(int32 Days, int32 Hours, int32 Minutes, int32 Seconds, int32 FractionNano);
785
786private:
787 friend struct Z_Construct_UScriptStruct_FTimespan_Statics;
788
789private:
790
791 /** The time span value in 100 nanoseconds resolution. */
792 int64 Ticks;
793};
794
795template <>
797{
798 static FTimespan Max()
799 {
801 }
802
804 {
806 }
807};
808
809/**
810 * Pre-multiply a time span with the given scalar.
811 *
812 * @param Scalar The scalar to pre-multiply with.
813 * @param Timespan The time span to multiply.
814 */
815inline FTimespan operator*(float Scalar, const FTimespan& Timespan)
816{
817 return Timespan.operator*(Scalar);
818}
#define check(expr)
FTimespan operator*(float Scalar, const FTimespan &Timespan)
Definition Timespan.h:815
constexpr int64 TicksPerMicrosecond
Definition Timespan.h:38
constexpr int64 TicksPerDay
Definition Timespan.h:32
constexpr int64 TicksPerYear
Definition Timespan.h:53
constexpr int64 MinTicks
Definition Timespan.h:26
constexpr int64 NanosecondsPerTick
Definition Timespan.h:29
constexpr int64 TicksPerWeek
Definition Timespan.h:50
constexpr int64 TicksPerMillisecond
Definition Timespan.h:41
constexpr int64 TicksPerMinute
Definition Timespan.h:44
constexpr int64 TicksPerHour
Definition Timespan.h:35
constexpr int64 TicksPerSecond
Definition Timespan.h:47
constexpr int64 MaxTicks
Definition Timespan.h:23
bool operator==(const FTimespan &Other) const
Definition Timespan.h:276
FTimespan operator*(double Scalar) const
Definition Timespan.h:207
static FTimespan FromDays(double Days)
Definition Timespan.h:613
int32 GetDays() const
Definition Timespan.h:356
int32 GetFractionMilli() const
Definition Timespan.h:391
bool operator>=(const FTimespan &Other) const
Definition Timespan.h:309
bool Serialize(FArchive &Ar)
static FTimespan FromHours(double Hours)
Definition Timespan.h:625
int64 GetTicks() const
Definition Timespan.h:454
FTimespan operator%(const FTimespan &Other) const
Definition Timespan.h:253
bool operator<=(const FTimespan &Other) const
Definition Timespan.h:331
FTimespan & operator-=(const FTimespan &Other)
Definition Timespan.h:195
static FTimespan FromMicroseconds(double Microseconds)
Definition Timespan.h:637
int32 GetHours() const
Definition Timespan.h:422
int32 GetFractionNano() const
Definition Timespan.h:401
int32 GetSeconds() const
Definition Timespan.h:444
FTimespan & operator*=(double Scalar)
Definition Timespan.h:218
FTimespan & operator%=(const FTimespan &Other)
Definition Timespan.h:264
bool operator!=(const FTimespan &Other) const
Definition Timespan.h:287
static FTimespan MinValue()
Definition Timespan.h:699
bool NetSerialize(FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess)
FTimespan & operator+=(const FTimespan &Other)
Definition Timespan.h:160
static double Ratio(FTimespan Dividend, FTimespan Divisor)
Definition Timespan.h:729
int32 GetFractionTicks() const
Definition Timespan.h:411
bool operator>(const FTimespan &Other) const
Definition Timespan.h:298
FTimespan operator-() const
Definition Timespan.h:173
friend uint32 GetTypeHash(const FTimespan &Timespan)
static FTimespan FromMinutes(double Minutes)
Definition Timespan.h:661
double GetTotalMicroseconds() const
Definition Timespan.h:487
double GetTotalDays() const
Definition Timespan.h:465
int32 GetFractionMicro() const
Definition Timespan.h:380
FTimespan(int32 Days, int32 Hours, int32 Minutes, int32 Seconds, int32 FractionNano)
Definition Timespan.h:138
double GetTotalSeconds() const
Definition Timespan.h:520
double GetTotalMinutes() const
Definition Timespan.h:509
FTimespan(int32 Days, int32 Hours, int32 Minutes, int32 Seconds)
Definition Timespan.h:124
FString ToString() const
bool IsZero() const
Definition Timespan.h:543
bool operator<(const FTimespan &Other) const
Definition Timespan.h:320
FTimespan & operator/=(double Scalar)
Definition Timespan.h:241
bool ImportTextItem(const TCHAR *&Buffer, int32 PortFlags, UObject *Parent, FOutputDevice *ErrorText)
FTimespan operator/(double Scalar) const
Definition Timespan.h:230
FTimespan()
Definition Timespan.h:80
int32 GetMinutes() const
Definition Timespan.h:433
double GetTotalHours() const
Definition Timespan.h:476
void Assign(int32 Days, int32 Hours, int32 Minutes, int32 Seconds, int32 FractionNano)
static bool Parse(const FString &TimespanString, FTimespan &OutTimespan)
FTimespan(int64 InTicks)
Definition Timespan.h:92
static FTimespan FromSeconds(double Seconds)
Definition Timespan.h:673
double GetTotalMilliseconds() const
Definition Timespan.h:498
static FTimespan Zero()
Definition Timespan.h:747
FTimespan operator-(const FTimespan &Other) const
Definition Timespan.h:184
FTimespan operator+(const FTimespan &Other) const
Definition Timespan.h:150
FString ToString(const TCHAR *Format) const
static FTimespan MaxValue()
Definition Timespan.h:686
static FTimespan FromMilliseconds(double Milliseconds)
Definition Timespan.h:649
FTimespan(int32 Hours, int32 Minutes, int32 Seconds)
Definition Timespan.h:108
bool ExportTextItem(FString &ValueStr, FTimespan const &DefaultValue, UObject *Parent, int32 PortFlags, UObject *ExportRootScope) const
FTimespan GetDuration()
Definition Timespan.h:369
int64 Ticks
Definition Timespan.h:792
static FTimespan Max()
Definition Timespan.h:798
static FTimespan Lowest()
Definition Timespan.h:803
Definition UE.h:432