1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file include/util/StringToBool.h
10 #ifndef AesalonUtil_StringToBool_H
11 #define AesalonUtil_StringToBool_H
15 /** C version of the StringToBool function. Returns the boolean representation of @a string.
17 inline int StringToBool(const char *string
) {
18 if(string
!= NULL
&& (strcmp(string
, "true") == 0 || strcmp(string
, "True") == 0)) return 1;
28 /** C++ version of the StringToBool function. Returns the boolean representation of @a string. */
29 bool StringToBool(const std::string
&string
) {
30 if(string
.length() == 0) return false;
31 return ::StringToBool(string
.c_str()) == 1;