Re: Idea for addition to Cgicc class
Anthony Bouvier <[email protected]> Tue, 22 Jun 2004 00:07:01 -0400
| Newsgroups | gmane.comp.gcc.cgicc.general,gmane.comp.gcc.cgicc.bugs |
|---|---|
| Message-ID | <[email protected]> |
I do like it. So much in fact that its already in CgiccExtended as of
August of last year .. ; )
std::string operator[](std::string paramName)
Though I took the idea from MizCGI (and really from Perl's access of
CGI elements via a hash with $cgi->Vars()).
I also implemented it as a method, since I don't really like to
overload operators unless absolutely necessary:
cout << cgi.param("favoriteCheese")
Some of the other things I've done to simplify access form data in
Cgicc can be seen here:
http://anthony.bodhihouse.com/src/CgiccExtended-doc.html
I really should work on CgiccExtended more, but I've been busy for a
long time.
On Jun 21, 2004, at 11:36 PM, Stephen F. Booth wrote:
> I was thinking about how it is essentially a pain to simply print out
> or grab
> the value of a single form element using the STL iterators:
> form_iterator name = cgi.getElement("name");
> if(name != cgi.getElements().end()) {
> cout << "Your name: " << **name << endl;
> }
> If people didn't care whether or not the element was actually found,
> something
> like
> cout << "Your name: " << cgi["name"] << endl;
> would be infinitely easier. Of course, this assumes that only one
> element
> called 'name' exists.
>
> Does anyone think this would be a valuable addition?
>
> -Stephen
>
>
> _______________________________________________
> help-cgicc mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-cgicc
>
--
anthony bouvier
professional geek
anthony.bodhihouse.com