[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    RFC: A new helper class
From:       Jarosław_Staniek <js () iidea ! pl>
Date:       2004-10-04 12:42:23
Message-ID: 200410041442.23854.js () iidea ! pl
[Download RAW message or body]


Hello,
Many of us do not use C++ exceptions, while sometimes it's usable to use 
3-state logic because boolean is not enough. The 3rd state means sometimes 
'cancelled' or 'dontKnow'. Moreover, this logic is also havily used for 
relational databases. My proposal is a lightweight 'tristate' class as a 
companion to bool type:

http://www.iidea.pl/~js/kexi/download/tristate.h

As you can see, the class is 'inline' and there are convenient operators.
I used the class in Kexi's code and thus decreased complexity pretty much and 
cleaned up the code and the API (removed many "bool &cancelled" parameters).
Example real-life usage:

http://www.iidea.pl/~js/kexi/download/kexidialogbase.cpp

Within KDE CVS the class can be located as koffice/kexi/tristate.h.
Currently, application developers are free to use the class by copying the 
file (later maybe that it will be moved to more official place?).

-- 
regards / pozdrawiam,
  Jaroslaw Staniek / OpenOffice Polska
  Kexi Project: http://www.kexi-project.org, http://koffice.kde.org/kexi
  QT-KDE Wrapper Project: http://iidea.pl/~js/qkw
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic