Class that keeps static members of System.Boolean .Net type. More...

Static Public Member Functions

static ASPOSECPP_SHARED_API bool Parse (const String &value)
 Converts the specified string to a value of bool type. More...
 
static ASPOSECPP_SHARED_API bool TryParse (const String &value, bool &result)
 Converts the specified string to a value of bool type. More...
 

Static Public Attributes

static ASPOSECPP_SHARED_API const String TrueString
 String representation of 'true' boolean value. More...
 
static ASPOSECPP_SHARED_API const String FalseString
 String representation of 'false' boolean value. More...
 

Detailed Description

Class that keeps static members of System.Boolean .Net type.

#include <system/boolean.h>
using namespace System;
int main()
{
// Create the boolean variable.
bool isWeekend = false;
// Parse the input string and print the result.
if (Boolean::TryParse(u"True", isWeekend))
{
std::cout << "Is weekend: " << (isWeekend ? "Yes" : "No");
}
else
{
std::cerr << "Something went wrong" << std::endl;
}
return 0;
}
/*
This code example produces the following output:
Is weekend: Yes
*/

Member Function Documentation

◆ Parse()

static ASPOSECPP_SHARED_API bool System::Boolean::Parse ( const String value)
static

Converts the specified string to a value of bool type.

Parameters
valueThe string to convert.
Returns
The bool variable where the result of the conversion is put; the result is true if the specified string is equal to "True" and false if the specified string is equal to "False".

◆ TryParse()

static ASPOSECPP_SHARED_API bool System::Boolean::TryParse ( const String value,
bool &  result 
)
static

Converts the specified string to a value of bool type.

Parameters
valueThe string to convert.
resultThe reference to a bool variable where the result of the conversion is put; the result is true if the specified string is equal to "True" and false if the specified string is equal to "False".
Returns
True if the specified string is equal either to "True" or "False", otherwise - false.

Member Data Documentation

◆ FalseString

ASPOSECPP_SHARED_API const String System::Boolean::FalseString
static

String representation of 'false' boolean value.

◆ TrueString

ASPOSECPP_SHARED_API const String System::Boolean::TrueString
static

String representation of 'true' boolean value.