Re: [Cppcms-users] cppcms::widgets::text::set() always returns true
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2014-06-09 20:41:39
|
Yes there is a reason behind that. The policy is if set() is false that accessing value() would throw an exception. Blank text is still a valid text the empty string is still a text - i.e. you take value() and it is valid, on the other hand if there is no number or there is no uploaded file, than there is no reasonable value() and than you must check the set() properly. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ -------------------------------------------- On Mon, 6/9/14, CN <cn...@fa...> wrote: Subject: [Cppcms-users] cppcms::widgets::text::set() always returns true To: cpp...@li... Date: Monday, June 9, 2014, 2:49 PM This make sense to me: cppcms::widgets::numeric::set() returns false if users leave it bank. However, cppcms::widgets::text::set() always returns true regardless of users leaving it blank or entering characters in that widget. Is there any special reason why cppcms::widgets::text::set() behave so? Why is cppcms::widgets::text::set() not designed to return false instead if users leave it blank? -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://www.hpccsystems.com _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |