Aspose.Tasks for C++
Aspose::Tasks::Duration Class Reference

Represents duration in a project. More...

#include <Duration.h>

Inherits System::IEquatable< Aspose::Tasks::Duration >, and System::Details::BoxableObjectBase.

Public Member Functions

System::TimeSpan get_TimeSpan () const
 Gets TimeSpan instance of this Duration object. The TimeSpan instance of this Duration object. More...
 
TimeUnitType get_TimeUnit () const
 Gets time unit type for this object. The time unit type of this Duration instance. More...
 
bool get_IsEstimated () const
 Gets a value indicating whether time unit is estimated. The flag which determines whether this Duration instance is estimated. More...
 
bool get_IsElapsed () const
 Gets a value indicating whether time unit is elapsed. The flag which determines whether this Duration instance is elapsed. More...
 
double ToDouble ()
 Converts Duration object to double value. More...
 
Duration Convert (TimeUnitType timeUnitType)
 Converts Duration object to another duration with specified time units. More...
 
Duration Add (Duration d)
 Adds specified duration to this duration. More...
 
Duration Add (double val)
 Adds specified double value to this duration. More...
 
Duration Subtract (Duration d)
 Subtracts specified duration from this duration instance. More...
 
Duration Subtract (double val)
 Subtracts specified double value from this duration instance. More...
 
bool Equals (Duration other) override
 Returns a value indicating whether this instance is equal to a specified object. More...
 
bool Equals (System::SharedPtr< System::Object > obj) override
 Returns a value indicating whether this instance is equal to a specified object. More...
 
int32_t GetHashCode () const override
 Returns a hash code value for this object. More...
 
System::String ToString () const override
 Returns a string representation of this instance. More...
 

Static Public Member Functions

static Duration Parse (const System::SharedPtr< Project > &p, const System::String &value)
 Converts the specified string to the instance of Duration struct. More...
 
static System::TimeSpan ParseTimeSpan (const System::String &value)
 Parses duration string in format "PT--H--M--S--". More...
 

Detailed Description

Represents duration in a project.

Member Function Documentation

◆ Add() [1/2]

Duration Aspose::Tasks::Duration::Add ( double  val)

Adds specified double value to this duration.

Parameters
valthe specified double value to add to this instance.
Returns
New duration object that represents the value of this instance plus the specified duration value.

◆ Add() [2/2]

Duration Aspose::Tasks::Duration::Add ( Duration  d)

Adds specified duration to this duration.

Parameters
dspecified Duration to add to this instance.
Returns
New duration object that represents the value of this instance plus the specified duration value.

◆ Convert()

Duration Aspose::Tasks::Duration::Convert ( TimeUnitType  timeUnitType)

Converts Duration object to another duration with specified time units.

Parameters
timeUnitTypethe specified time unit type.
Returns
returns new duration with the specified unit type.

◆ Equals() [1/2]

bool Aspose::Tasks::Duration::Equals ( Duration  other)
override

Returns a value indicating whether this instance is equal to a specified object.

Parameters
otherThe object to compare with this instance.
Returns
Returns True if other Duration instance has the same TimeSpan and TimeUnit values as this instance; otherwise, false.

◆ Equals() [2/2]

bool Aspose::Tasks::Duration::Equals ( System::SharedPtr< System::Object >  obj)
override

Returns a value indicating whether this instance is equal to a specified object.

Parameters
objThe object to compare with this instance.
Returns
True if the specified object is a Duration that has the same TimeSpan and TimeUnit values as this instance; otherwise, false.

◆ get_IsElapsed()

bool Aspose::Tasks::Duration::get_IsElapsed ( ) const

Gets a value indicating whether time unit is elapsed. The flag which determines whether this Duration instance is elapsed.

◆ get_IsEstimated()

bool Aspose::Tasks::Duration::get_IsEstimated ( ) const

Gets a value indicating whether time unit is estimated. The flag which determines whether this Duration instance is estimated.

◆ get_TimeSpan()

System::TimeSpan Aspose::Tasks::Duration::get_TimeSpan ( ) const

Gets TimeSpan instance of this Duration object. The TimeSpan instance of this Duration object.

◆ get_TimeUnit()

TimeUnitType Aspose::Tasks::Duration::get_TimeUnit ( ) const

Gets time unit type for this object. The time unit type of this Duration instance.

◆ GetHashCode()

int32_t Aspose::Tasks::Duration::GetHashCode ( ) const
override

Returns a hash code value for this object.

Returns
returns a hash code value for this duration instance.

◆ Parse()

static Duration Aspose::Tasks::Duration::Parse ( const System::SharedPtr< Project > &  p,
const System::String &  value 
)
static

Converts the specified string to the instance of Duration struct.

Parameters
pthe specified instance of Project class to convert duration for.
valuethe specified string to convert.
Returns
Returns the converted instance of Duration struct.

◆ ParseTimeSpan()

static System::TimeSpan Aspose::Tasks::Duration::ParseTimeSpan ( const System::String &  value)
static

Parses duration string in format "PT--H--M--S--".

Parameters
valuethe specified string to parse.
Returns
returns parsed instance of the TimeSpan struct.

◆ Subtract() [1/2]

Duration Aspose::Tasks::Duration::Subtract ( double  val)

Subtracts specified double value from this duration instance.

Parameters
valspecified double value to subtract from this instance.
Returns
New duration object that represents the value of this instance minus the specified duration value.

◆ Subtract() [2/2]

Duration Aspose::Tasks::Duration::Subtract ( Duration  d)

Subtracts specified duration from this duration instance.

Parameters
dthe specified Duration instance to subtract from this instance.
Returns
New duration object that represents the value of this instance minus the specified duration value.

◆ ToDouble()

double Aspose::Tasks::Duration::ToDouble ( )

Converts Duration object to double value.

Returns
Converted value.

◆ ToString()

System::String Aspose::Tasks::Duration::ToString ( ) const
override

Returns a string representation of this instance.

Returns
a string representation of this instance.