[beast: 10/12] BSE: storage: allow '#t' and '#f' as C++ bool property values
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 10/12] BSE: storage: allow '#t' and '#f' as C++ bool property values
- Date: Thu, 24 Sep 2015 20:10:06 +0000 (UTC)
commit 10a261add75c51837b58c75739fdcfff727fd17e
Author: Tim Janik <timj gnu org>
Date: Tue Sep 22 20:49:08 2015 +0200
BSE: storage: allow '#t' and '#f' as C++ bool property values
bse/bsestorage.cc | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/bse/bsestorage.cc b/bse/bsestorage.cc
index 8e8cfe5..7fea955 100644
--- a/bse/bsestorage.cc
+++ b/bse/bsestorage.cc
@@ -615,7 +615,12 @@ any_set_from_string (Any &any, const String &string)
using namespace Rapicorn;
switch (any.kind())
{
- case Aida::BOOL: any.set (string_to_bool (string)); break;
+ case Aida::BOOL:
+ if (string.size() == 2 && string.data()[0] == '#')
+ any.set (bool (string.data()[1] == 't' || string.data()[1] == 'T'));
+ else
+ any.set (string_to_bool (string));
+ break;
case Aida::INT64: any.set (string_to_int (string)); break;
case Aida::FLOAT64: any.set (string_to_double (string)); break;
case Aida::STRING: any.set (string_from_cquote (string)); break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]