Asposecpplib

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

Static Public Member Functions

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

Static Public Attributes

static const String TrueString
 String representation of 'true' boolean value. More...
 
static 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
*/
static bool TryParse(const String &value, bool &result)
Converts the specified string to a value of bool type.
Definition: db_command.h:9

Member Function Documentation

◆ Parse()

static 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 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

const String System::Boolean::FalseString
static

String representation of 'false' boolean value.

◆ TrueString

const String System::Boolean::TrueString
static

String representation of 'true' boolean value.