aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/functions-bool.cxx
blob: bb2fd3fa01b9dec94a99db866836c6d83a112108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// file      : libbuild2/functions-bool.cxx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

#include <libbuild2/function.hxx>
#include <libbuild2/variable.hxx>

using namespace std;

namespace build2
{
  void
  bool_functions (function_map& m)
  {
    function_family f (m, "bool");

    // $string(<bool>)
    //
    // Convert a boolean value to a string literal `true` or `false`.
    //

    // Note that we don't handle NULL values for this type since it has no
    // empty representation.
    //
    f["string"] += [](bool b) {return b ? "true" : "false";};
  }
}