Aspose.Tasks for C++
Duration.h
1 #pragma once
2 //-----------------------------------------------------------------------
3 // <copyright file="Duration.cs" company="Aspose Pty Ltd">
4 // Copyright (c) 2002-2025 Aspose Pty Ltd. All Rights Reserved.
5 // </copyright>
6 //-----------------------------------------------------------------------
7 // ReSharper disable StringLiteralTypo
8 
9 #include <system/timespan.h>
10 #include <system/iequatable.h>
11 #include <system/array.h>
12 #include <cstdint>
13 
14 #include "aspose.tasks.cpp/aspose_tasks_api_defs.h"
15 
16 namespace Aspose
17 {
18 namespace Tasks
19 {
20 namespace Calculations
21 {
22 class ResourceAssignmentCalculator;
23 class ResourceAssignmentPeakCalculator;
24 class TaskEarlyLateDatesCalculator;
25 class TaskProgressCalculator;
26 class TaskStatusCalculator;
27 class TaskWorkCalculator;
28 } // namespace Calculations
29 namespace Connectivity
30 {
31 class DbTypeConverter;
32 class MpdAssignmentMapper;
33 class MpdTaskMapper;
34 class MspAssignmentMapper;
35 class MspDbTypeConverter;
36 class MspTaskBaseLineMapper;
37 class MspTaskMapper;
38 class PmDbTypeConverter;
39 } // namespace Connectivity
40 class ExtendedAttribute;
41 namespace IO
42 {
43 namespace Html
44 {
45 class HtmlReadingUtils;
46 class HtmlResourceAssignmentTableReader;
47 class HtmlTaskBaseLineTableReader;
48 class HtmlTaskTableReader;
49 } // namespace Html
50 namespace Mpx
51 {
52 class MpxUtils;
53 } // namespace Mpx
54 namespace MSProject
55 {
56 class CustomFieldTypeReader;
57 class ExtendedAttributeValueConverter;
58 template <typename, typename> class FieldItem;
59 class GanttBarStyleCalculator;
60 class MPP12OutlineCodeDefinitionReader;
61 class MPP14OutlineCodeDefinitionReader;
62 class MPP14ResourceAssignmentWriter;
63 class MPP14TaskReader;
64 class MPP9ExtendedAttributeDefinitionReader;
65 class MPPRecurringInfoReader;
66 } // namespace MSProject
67 namespace PrimaveraXml
68 {
69 class P6XmlUtils;
70 class PrimaveraActivityNodeReader;
71 class PrimaveraAssignmentsNodeReader;
72 } // namespace PrimaveraXml
73 namespace Pwa
74 {
75 namespace InternalApi
76 {
77 class ExtendedAttributeValueReader;
78 namespace Mapping
79 {
80 class AssignmentDurationPropertyMapper;
81 class BaseDurationPropertyMapper;
82 template <typename> class ProjectCoreEntityMapperBase;
83 class ProjectTasksMapper;
84 class TaskDurationPropertyMapper;
85 class TaskLinkEntityMapper;
86 } // namespace Mapping
87 class PropertyValueReader;
88 } // namespace InternalApi
89 } // namespace Pwa
90 namespace Xer
91 {
92 class XerAssignmentReader;
93 class XerRecordValueReader;
94 } // namespace Xer
95 namespace Xml
96 {
97 class ExtendedAttributeNodeReader;
98 class OutlineCodeDefinitionReader;
99 class ResourceAssignmentNodeReader;
100 class ResourceAssignmentNodeWriter;
101 class TaskNodeReader;
102 class TaskNodeWriter;
103 } // namespace Xml
104 } // namespace IO
105 namespace Leveling
106 {
107 class ResourceLeveler;
108 } // namespace Leveling
109 class OutlineValue;
110 class PercentCompleteCalculator;
111 class ProjDurValue;
112 class Project;
113 class ProjectState;
114 class ProjectWorkUpdater;
115 class ResourceAssignment;
116 namespace RiskAnalysis
117 {
118 class RndDurationAlgorithm;
119 } // namespace RiskAnalysis
120 namespace Rollup
121 {
122 class DurationExtendedAttributeComparer;
123 } // namespace Rollup
124 namespace Saving
125 {
126 class MpxSavingUtils;
127 class MpxWriter;
128 } // namespace Saving
129 class Task;
130 class TaskPlanner;
131 class TaskPlannerAssignmentManager;
132 enum class TimeUnitType : int8_t;
133 namespace Util
134 {
135 namespace Fields
136 {
137 class RscFieldToValue;
138 class TaskFieldToValue;
139 } // namespace Fields
140 class PrimaveraTasksProcessor;
141 } // namespace Util
142 } // namespace Tasks
143 } // namespace Aspose
144 namespace System
145 {
146 namespace Globalization
147 {
148 class CultureInfo;
149 } // namespace Globalization
150 class IFormatProvider;
151 } // namespace System
152 
153 namespace Aspose {
154 
155 namespace Tasks {
156 
157 /// <summary>
158 /// Represents duration in a project.
159 /// </summary>
160 class ASPOSE_TASKS_SHARED_CLASS Duration : public System::IEquatable<Duration>, public System::Details::BoxableObjectBase
161 {
162  typedef Duration ThisType;
163  typedef System::IEquatable<Duration> BaseType;
164 
165  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
166  ASPOSE_TASKS_SHARED_RTTI_INFO_DECL();
167 
168  friend class Aspose::Tasks::Calculations::ResourceAssignmentCalculator;
169  friend class Project;
170  template<typename FT0, typename FT1> friend class Aspose::Tasks::IO::MSProject::FieldItem;
171  friend class Aspose::Tasks::IO::Pwa::InternalApi::ExtendedAttributeValueReader;
172  friend class Aspose::Tasks::IO::Html::HtmlTaskTableReader;
173  friend class Aspose::Tasks::Connectivity::MspDbTypeConverter;
174  friend class Aspose::Tasks::Connectivity::DbTypeConverter;
175  friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::TaskDurationPropertyMapper;
176  friend class Aspose::Tasks::IO::MSProject::MPPRecurringInfoReader;
177  friend class Aspose::Tasks::Rollup::DurationExtendedAttributeComparer;
178  friend class Aspose::Tasks::IO::MSProject::MPP9ExtendedAttributeDefinitionReader;
179  friend class Aspose::Tasks::Util::Fields::RscFieldToValue;
180  friend class Aspose::Tasks::IO::PrimaveraXml::PrimaveraActivityNodeReader;
181  friend class Aspose::Tasks::Calculations::TaskEarlyLateDatesCalculator;
182  friend class Aspose::Tasks::IO::Html::HtmlReadingUtils;
183  friend class Aspose::Tasks::Util::Fields::TaskFieldToValue;
184  friend class ProjectWorkUpdater;
185  friend class Aspose::Tasks::Connectivity::MpdTaskMapper;
186  template<typename FT0> friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::ProjectCoreEntityMapperBase;
187  friend class Aspose::Tasks::IO::Xml::OutlineCodeDefinitionReader;
188  friend class Task;
189  friend class Aspose::Tasks::Util::PrimaveraTasksProcessor;
190  friend class Aspose::Tasks::IO::Xml::TaskNodeWriter;
191  friend class Aspose::Tasks::IO::MSProject::CustomFieldTypeReader;
192  friend class Aspose::Tasks::Saving::MpxSavingUtils;
193  friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::AssignmentDurationPropertyMapper;
194  friend class Aspose::Tasks::Connectivity::MpdAssignmentMapper;
195  friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::ProjectTasksMapper;
196  friend class Aspose::Tasks::IO::Pwa::InternalApi::PropertyValueReader;
197  friend class Aspose::Tasks::IO::Html::HtmlResourceAssignmentTableReader;
198  friend class Aspose::Tasks::IO::Xml::ExtendedAttributeNodeReader;
199  friend class ResourceAssignment;
200  friend class Aspose::Tasks::IO::Mpx::MpxUtils;
201  friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::BaseDurationPropertyMapper;
202  friend class Aspose::Tasks::IO::MSProject::MPP12OutlineCodeDefinitionReader;
203  template<typename FT0, typename FT1> friend class Aspose::Tasks::IO::MSProject::FieldItem;
204  friend class Aspose::Tasks::IO::Xml::TaskNodeReader;
205  friend class TaskPlannerAssignmentManager;
206  friend class Aspose::Tasks::Calculations::TaskProgressCalculator;
207  friend class Aspose::Tasks::Connectivity::MspTaskMapper;
208  friend class Aspose::Tasks::Calculations::TaskStatusCalculator;
209  friend class TaskPlanner;
210  friend class Aspose::Tasks::Calculations::TaskWorkCalculator;
211  friend class Aspose::Tasks::IO::Xml::ResourceAssignmentNodeReader;
212  friend class Aspose::Tasks::IO::MSProject::MPP14TaskReader;
213  friend class Aspose::Tasks::IO::MSProject::MPP14ResourceAssignmentWriter;
214  friend class Aspose::Tasks::IO::PrimaveraXml::P6XmlUtils;
215  friend class Aspose::Tasks::IO::MSProject::GanttBarStyleCalculator;
216  friend class ExtendedAttribute;
218  friend class Aspose::Tasks::Connectivity::PmDbTypeConverter;
219  friend class Aspose::Tasks::RiskAnalysis::RndDurationAlgorithm;
220  friend class Aspose::Tasks::IO::Xml::ResourceAssignmentNodeWriter;
221  friend class Aspose::Tasks::IO::MSProject::ExtendedAttributeValueConverter;
222  friend class Aspose::Tasks::Connectivity::MspAssignmentMapper;
223  friend class Aspose::Tasks::IO::Xer::XerRecordValueReader;
224  friend class Aspose::Tasks::IO::Xer::XerAssignmentReader;
225  friend class Aspose::Tasks::Saving::MpxWriter;
226  friend class Aspose::Tasks::IO::Pwa::InternalApi::Mapping::TaskLinkEntityMapper;
227  friend class Aspose::Tasks::Calculations::ResourceAssignmentPeakCalculator;
228  friend class Aspose::Tasks::IO::Html::HtmlTaskBaseLineTableReader;
229  friend class Aspose::Tasks::IO::PrimaveraXml::PrimaveraAssignmentsNodeReader;
230  friend class PercentCompleteCalculator;
231  friend class ProjDurValue;
232  friend class Aspose::Tasks::IO::MSProject::MPP14OutlineCodeDefinitionReader;
233  friend class ProjectState;
234  friend class Aspose::Tasks::Connectivity::MspTaskBaseLineMapper;
235  friend class OutlineValue;
236  /// <summary>
237  /// Returns a value indicating whether this instance is equal to a specified object.
238  /// </summary>
239  /// <param name="a">The first duration.</param>
240  /// <param name="b">The second duration.</param>
241  /// <returns>a value indicating whether this instance is equal to a specified object</returns>
242  ASPOSE_TASKS_SHARED_API friend bool operator ==(Duration a, Duration b);
243  /// <summary>
244  /// Returns a value indicating whether this instance is not equal to a specified object.
245  /// </summary>
246  /// <param name="a">The first duration.</param>
247  /// <param name="b">The second duration.</param>
248  /// <returns>a value indicating whether this instance is not equal to a specified object</returns>
249  ASPOSE_TASKS_SHARED_API friend bool operator !=(Duration a, Duration b);
250 
251 public:
252 
253  /// <summary>
254  /// Gets <see cref="TimeSpan"></see> instance of this Duration object.
255  /// <value>The TimeSpan instance of this Duration object.</value>
256  /// </summary>
257  ASPOSE_TASKS_SHARED_API System::TimeSpan get_TimeSpan() const;
258  /// <summary>
259  /// Gets time unit type for this object.
260  /// <value>The time unit type of this Duration instance.</value>
261  /// </summary>
262  ASPOSE_TASKS_SHARED_API TimeUnitType get_TimeUnit() const;
263  /// <summary>
264  /// Gets a value indicating whether time unit is estimated.
265  /// <value>The flag which determines whether this Duration instance is estimated.</value>
266  /// </summary>
267  ASPOSE_TASKS_SHARED_API bool get_IsEstimated() const;
268  /// <summary>
269  /// Gets a value indicating whether time unit is elapsed.
270  /// <value>The flag which determines whether this Duration instance is elapsed.</value>
271  /// </summary>
272  ASPOSE_TASKS_SHARED_API bool get_IsElapsed() const;
273 
274  /// <summary>
275  /// Converts the specified string to the instance of <see cref="Duration"></see> struct.
276  /// </summary>
277  /// <param name="p">the specified instance of <see cref="Project"></see> class to convert duration for.</param>
278  /// <param name="value">the specified string to convert.</param>
279  /// <returns>Returns the converted instance of <see cref="Duration"></see> struct.</returns>
280  ASPOSE_TASKS_SHARED_API static Duration Parse(const System::SharedPtr<Project>& p, const System::String& value);
281  /// <summary>
282  /// Parses duration string in format "PT--H--M--S--".
283  /// </summary>
284  /// <param name="value">the specified string to parse.</param>
285  /// <returns>returns parsed instance of the <see cref="TimeSpan"></see> struct.</returns>
286  ASPOSE_TASKS_SHARED_API static System::TimeSpan ParseTimeSpan(const System::String& value);
287  /// <summary>
288  /// Converts Duration object to <see cref="double"></see> value.
289  /// </summary>
290  /// <returns>Converted value.</returns>
291  ASPOSE_TASKS_SHARED_API double ToDouble();
292  /// <summary>
293  /// Converts Duration object to another duration with specified time units.
294  /// </summary>
295  /// <param name="timeUnitType">the specified time unit type.</param>
296  /// <returns>returns new duration with the specified unit type.</returns>
297  ASPOSE_TASKS_SHARED_API Duration Convert(TimeUnitType timeUnitType);
298  /// <summary>
299  /// Adds specified duration to this duration.
300  /// </summary>
301  /// <param name="d">specified <see cref="Duration"></see> to add to this instance.</param>
302  /// <returns>New duration object that represents the value of this instance plus the specified duration value.</returns>
303  ASPOSE_TASKS_SHARED_API Duration Add(Duration d);
304  /// <summary>
305  /// Adds specified double value to this duration.
306  /// </summary>
307  /// <param name="val">the specified <see cref="double"></see> value to add to this instance.</param>
308  /// <returns>New duration object that represents the value of this instance plus the specified duration value.</returns>
309  ASPOSE_TASKS_SHARED_API Duration Add(double val);
310  /// <summary>
311  /// Subtracts specified duration from this duration instance.
312  /// </summary>
313  /// <param name="d">the specified <see cref="Duration"></see> instance to subtract from this instance.</param>
314  /// <returns>New duration object that represents the value of this instance minus the specified duration value.</returns>
315  ASPOSE_TASKS_SHARED_API Duration Subtract(Duration d);
316  /// <summary>
317  /// Subtracts specified double value from this duration instance.
318  /// </summary>
319  /// <param name="val">specified <see cref="double"></see> value to subtract from this instance.</param>
320  /// <returns>New duration object that represents the value of this instance minus the specified duration value.</returns>
321  ASPOSE_TASKS_SHARED_API Duration Subtract(double val);
322  /// <summary>
323  /// Returns a value indicating whether this instance is equal to a specified object.
324  /// </summary>
325  /// <param name="other">The object to compare with this instance.</param>
326  /// <returns>Returns <b>True</b> if other Duration instance has the same TimeSpan and TimeUnit values as this instance; otherwise, <b>false</b>.</returns>
327  ASPOSE_TASKS_SHARED_API bool Equals(Duration other) override;
328  /// <summary>
329  /// Returns a value indicating whether this instance is equal to a specified object.
330  /// </summary>
331  /// <param name="obj">The object to compare with this instance.</param>
332  /// <returns><b>True</b> if the specified object is a Duration that has the same TimeSpan and TimeUnit values as this instance; otherwise, <b>false</b>.</returns>
333  ASPOSE_TASKS_SHARED_API bool Equals(System::SharedPtr<System::Object> obj) override;
334  /// <summary>
335  /// Returns a hash code value for this object.
336  /// </summary>
337  /// <returns>returns a hash code value for this duration instance.</returns>
338  ASPOSE_TASKS_SHARED_API int32_t GetHashCode() const override;
339 
340  ASPOSE_TASKS_SHARED_API Duration();
341 
342  /// <summary>
343  /// Returns a string representation of this instance.
344  /// </summary>
345  /// <returns>a string representation of this instance.</returns>
346  ASPOSE_TASKS_SHARED_API System::String ToString() const override;
347 
348 protected:
349 
350  ASPOSE_TASKS_SHARED_API double get_TotalMinutes();
351  ASPOSE_TASKS_SHARED_API bool get_IsZeroDuration();
352 
353  /// <summary>
354  /// Initializes a new instance of the <see cref="Duration"></see> struct with a specified TimeSpan value and TimeUnitType.
355  /// </summary>
356  /// <param name="project">the specified instance of the <see cref="Project"></see> to get settings from.</param>
357  /// <param name="timeSpan">the specified <see cref="TimeSpan"></see></param>
358  /// <param name="timeUnit">the specified <see cref="TimeUnit"></see></param>
359  ASPOSE_TASKS_SHARED_API Duration(const System::SharedPtr<Project>& project, System::TimeSpan timeSpan, TimeUnitType timeUnit);
360 
361  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Duration, CODEPORTING_ARGS(const System::SharedPtr<Project>& project, System::TimeSpan timeSpan, TimeUnitType timeUnit));
362 
363  /// <summary>
364  /// Initializes a new instance of the <see cref="Duration"></see> struct with a specified double value and TimeUnitType.
365  /// </summary>
366  /// <param name="project">the specified instance of the <see cref="Project"></see> to get settings from.</param>
367  /// <param name="d">the specified double value.</param>
368  /// <param name="timeUnit">the specified <see cref="TimeUnit"></see></param>
369  /// <param name="setUndefinedTimeUnit">The flag to set undefined value.</param>
370  ASPOSE_TASKS_SHARED_API Duration(const System::SharedPtr<Project>& project, double d, TimeUnitType timeUnit, bool setUndefinedTimeUnit);
371 
372  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Duration, CODEPORTING_ARGS(const System::SharedPtr<Project>& project, double d, TimeUnitType timeUnit, bool setUndefinedTimeUnit));
373 
374  /// <summary>
375  /// Initializes a new instance of the <see cref="Duration"></see> struct with a specified double value and TimeUnitType.
376  /// </summary>
377  /// <param name="project">the specified instance of the <see cref="Project"></see> to get settings from.</param>
378  /// <param name="d">the specified double value.</param>
379  /// <param name="timeUnit">the specified <see cref="TimeUnit"></see></param>
380  ASPOSE_TASKS_SHARED_API Duration(const System::SharedPtr<Project>& project, double d, TimeUnitType timeUnit);
381 
382  ASPOSE_TASKS_SHARED_API MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Duration, CODEPORTING_ARGS(const System::SharedPtr<Project>& project, double d, TimeUnitType timeUnit));
383 
384  ASPOSE_TASKS_SHARED_API System::String ToString(const System::SharedPtr<System::Globalization::CultureInfo>& cultureInfo);
385  /// <summary>
386  /// Converts the specified string to the instance of <see cref="Duration"></see> struct.
387  /// </summary>
388  /// <param name="p">the specified instance of <see cref="Project"></see> class to convert duration for.</param>
389  /// <param name="value">the specified string to convert.</param>
390  /// <param name="formatProvider">An object that supplies culture-specific formatting information about <paramref name="value"></paramref>.</param>
391  /// <returns>Returns the converted instance of <see cref="Duration"></see> struct.</returns>
392  ASPOSE_TASKS_SHARED_API static Duration Parse(const System::SharedPtr<Project>& p, System::String value, const System::SharedPtr<System::IFormatProvider>& formatProvider);
393  /// <summary>
394  /// Returns total minutes multiplied by 10.
395  /// </summary>
396  /// <returns>Total minutes multiplied by 10.</returns>
397  ASPOSE_TASKS_SHARED_API int32_t ToInt();
398  /// <summary>
399  /// Converts integer value to duration instance and returns converted duration instance.
400  /// </summary>
401  /// <param name="project">the specified project.</param>
402  /// <param name="i">the specified integer value.</param>
403  /// <returns>returns converted duration instance.</returns>
404  ASPOSE_TASKS_SHARED_API static Duration FromInt(const System::SharedPtr<Project>& project, int32_t i);
405  /// <summary>
406  /// Converts integer value to duration instance with the specified time units.
407  /// </summary>
408  /// <param name="project">the specified project.</param>
409  /// <param name="i">the specified integer value.</param>
410  /// <param name="timeUnit">the specified time unit type.</param>
411  /// <returns>returns converted duration instance.</returns>
412  ASPOSE_TASKS_SHARED_API static Duration FromInt(const System::SharedPtr<Project>& project, int32_t i, TimeUnitType timeUnit);
413  /// <summary>
414  /// Returns this instance as variance.
415  /// </summary>
416  /// <returns>returns this instance as variance.</returns>
417  ASPOSE_TASKS_SHARED_API double ToVariance();
418  /// <summary>
419  /// Converts variance to duration instance.
420  /// </summary>
421  /// <param name="project">the specified project.</param>
422  /// <param name="variance">the specified variance.</param>
423  /// <returns>returns duration instance which was converted from variance.</returns>
424  ASPOSE_TASKS_SHARED_API static Duration FromVariance(const System::SharedPtr<Project>& project, double variance);
425  /// <summary>
426  /// Converts TimeSpan instance to duration instance with day time units.
427  /// </summary>
428  /// <param name="project">the specified project for the instance of the <see cref="Duration"></see> class.</param>
429  /// <param name="timeSpan">the specified TimeSpan instance.</param>
430  /// <param name="type">the specified TimeUnitType instance.</param>
431  /// <returns>returns converted duration instance with day time units.</returns>
432  ASPOSE_TASKS_SHARED_API static Duration FromTimeSpan(const System::SharedPtr<Project>& project, System::TimeSpan timeSpan, TimeUnitType type);
433  ASPOSE_TASKS_SHARED_API static Duration ChangeTimeUnit(Duration duration, TimeUnitType timeUnit);
434  ASPOSE_TASKS_SHARED_API static Duration ChangeTimeSpan(Duration duration, System::TimeSpan timeSpan);
435  ASPOSE_TASKS_SHARED_API static Duration Add(Duration duration, System::TimeSpan timeSpan);
436  #ifdef ASPOSE_GET_SHARED_MEMBERS
437  ASPOSE_TASKS_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
438  #endif
439 
440 
441 private:
442 
443  System::WeakPtr<Project> project;
444  System::TimeSpan pr_TimeSpan;
445 
446  /// <summary>
447  /// Gets <see cref="TimeSpan"></see> instance of this Duration object.
448  /// <value>The TimeSpan instance of this Duration object.</value>
449  /// </summary>
450  ASPOSE_TASKS_SHARED_API void set_TimeSpan(System::TimeSpan value);
451 
452  TimeUnitType pr_TimeUnit;
453 
454  /// <summary>
455  /// Gets time unit type for this object.
456  /// <value>The time unit type of this Duration instance.</value>
457  /// </summary>
458  ASPOSE_TASKS_SHARED_API void set_TimeUnit(TimeUnitType value);
459 
460  static System::ArrayPtr<System::String>& DurationLabels();
461 
462  System::String ToString_NonConst();
463  static TimeUnitType GetTimeUnitType(const System::String& str);
464  static TimeUnitType ParseAsPercent(const System::String& s);
465  static bool TryParseAsDate(const System::String& s, TimeUnitType& type);
466  static TimeUnitType SelectWithModifier(bool isEstimated, bool isElapsed, TimeUnitType both, TimeUnitType estimated, TimeUnitType elapsed, TimeUnitType withoutModifiers);
467  static System::String GetUnit(System::String s, bool& isEstimated, bool& isElapsed);
468  static bool IsMinute(const System::String& unit);
469  static bool IsHour(const System::String& unit);
470  static bool IsDay(const System::String& s);
471  static bool IsWeek(const System::String& s);
472  static bool IsMonth(const System::String& unit);
473  static bool IsYear(const System::String& unit);
474  System::String GetDurationUnit(const System::String& dur, const System::String& abbr, bool addSpaceBeforeLabel) const;
475  bool GetAddSpaceBeforeLabel();
476 
477 };
478 
479 /// <summary>
480 /// Returns a value indicating whether this instance is equal to a specified object.
481 /// </summary>
482 /// <param name="a">The first duration.</param>
483 /// <param name="b">The second duration.</param>
484 /// <returns>a value indicating whether this instance is equal to a specified object</returns>
485 ASPOSE_TASKS_SHARED_API bool operator ==(Duration a, Duration b);
486 /// <summary>
487 /// Returns a value indicating whether this instance is not equal to a specified object.
488 /// </summary>
489 /// <param name="a">The first duration.</param>
490 /// <param name="b">The second duration.</param>
491 /// <returns>a value indicating whether this instance is not equal to a specified object</returns>
492 ASPOSE_TASKS_SHARED_API bool operator !=(Duration a, Duration b);
493 
494 } // namespace Tasks
495 } // namespace Aspose
496 
497 
Represents duration in a project.
Definition: Duration.h:161
int32_t GetHashCode() const override
Returns a hash code value for this object.
Duration Add(double val)
Adds specified double value to this duration.
static System::TimeSpan ParseTimeSpan(const System::String &value)
Parses duration string in format "PT--H--M--S--".
System::String ToString() const override
Returns a string representation of this instance.
bool get_IsEstimated() const
Gets a value indicating whether time unit is estimated. The flag which determines whether this Durati...
bool get_IsElapsed() const
Gets a value indicating whether time unit is elapsed. The flag which determines whether this Duration...
Duration Subtract(double val)
Subtracts specified double value from this duration instance.
static Duration Parse(const System::SharedPtr< Project > &p, const System::String &value)
Converts the specified string to the instance of Duration struct.
Duration Subtract(Duration d)
Subtracts specified duration from this duration instance.
System::TimeSpan get_TimeSpan() const
Gets TimeSpan instance of this Duration object. The TimeSpan instance of this Duration object.
Duration Add(Duration d)
Adds specified duration to this duration.
TimeUnitType get_TimeUnit() const
Gets time unit type for this object. The time unit type of this Duration instance.
bool Equals(Duration other) override
Returns a value indicating whether this instance is equal to a specified object.
double ToDouble()
Converts Duration object to double value.
Duration Convert(TimeUnitType timeUnitType)
Converts Duration object to another duration with specified time units.
bool Equals(System::SharedPtr< System::Object > obj) override
Returns a value indicating whether this instance is equal to a specified object.
Represents extended attributes.
Definition: ExtendedAttribute.h:139
Contains resource leveling methods.
Definition: ResourceLeveler.h:46
Represents an outline value.
Definition: OutlineValue.h:80
Represents a project.
Definition: Project.h:551
Represents a resource assignment in a project.
Definition: ResourceAssignment.h:230
Represents a task in a project.
Definition: Task.h:394
Aspose.
Definition: Asn.h:13