Boolean (bool)
A boolean object which is either true or false
Returned by
Boolean objects are returned by the following functions and methods:
add_languages()get_option()is_disabler()is_variable()array.contains()build_tgt.found()cfg_data.get()cfg_data.get_unquoted()cfg_data.has()compiler.check_header()compiler.compiles()compiler.has_argument()compiler.has_define()compiler.has_function()compiler.has_function_attribute()compiler.has_header()compiler.has_header_symbol()compiler.has_link_argument()compiler.has_member()compiler.has_members()compiler.has_multi_arguments()compiler.has_multi_link_arguments()compiler.has_type()compiler.links()compiler.symbols_have_underscore_prefix()dep.found()dict.has_key()disabler.found()external_program.found()feature.allowed()feature.auto()feature.disabled()feature.enabled()int.is_even()int.is_odd()meson.can_run_host_binaries()meson.has_exe_wrapper()meson.has_external_property()meson.is_cross_build()meson.is_subproject()meson.is_unity()module.found()runresult.compiled()str.contains()str.endswith()str.startswith()str.version_compare()subproject.found()
Boolean methods
bool.to_int()
Returns 1 if true and 0 if false
Signature
int to_int()
bool.to_string()
Returns the string 'true' if the boolean is true or 'false' otherwise.
You can also pass it two strings as positional
arguments to specify what to return for true/false. For instance,
bool.to_string('yes', 'no') will return yes if the boolean is
true and no if it is false.
Signature
# Returns the string `'true'` if the boolean is true or `'false'` otherwise
str to_string(
str [true_str], # The string to return when the boolean is `true`
str [false_str], # The string to return when the boolean is `false`
)
Arguments
The method bool.to_string() accepts the following positional arguments:
| Name | Type | Description | Tags |
|---|---|---|---|
true_str |
str |
The string to return when the boolean is |
[optional]
|
false_str |
str |
The string to return when the boolean is |
[optional]
|
The results of the search are