ブール型(bool
)
true
またはfalse
のどちらかであるブールオブジェクト
によって返される
ブールオブジェクトは、次の関数とメソッドによって返されます。
add_languages()
get_option()
is_disabler()
is_variable()
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()
list.contains()
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()
ブールメソッド
bool.to_int()
true
の場合1を返し、false
の場合に0を返す
署名
int to_int()
bool.to_string()
ブール値がtrueの場合、文字列「true」を返します。 falseの場合は、「false」を返します。また、2つの文字列を位置引数として渡して、true/falseで何を返すかを指定することもできます。たとえば、bool.to_string('yes', 'no')
は、ブール値がtrueの場合に「yes」を返し、falseの場合に「no」を返します。
署名
# 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`
)
引数
bool.to_string()
メソッドは次の位置引数を受け付けます。
名前 | 型 | 説明 | タグ |
---|---|---|---|
true_str |
str |
ブール値が |
[オプション]
|
false_str |
str |
str |
[オプション]
|
デフォルト='false'