Hey Jason,
IMO, std::string for everything but interaction with Wt; and WString in
your presentation layer.
The approach we take is to settle on UTF-8 encoded std::string's inside an
application. In the rare cases that you really need to do character
processing, only then convert the UTF-8 string to a real unicode character
point representation (e.g. std::wstring on linux platforms or using
char32_t in C++11).
We deliberately did not add all kinds of processing to WString because we
want you to not use this type, except when dealing with the Wt API.
Regards,
koen
2014-03-26 16:35 GMT+01:00 Jason H <[email protected]>:
> /usr/include/Wt/Dbo/SqlTraits_impl.h:16: note: no known conversion for
> argument 1 from 'Wt::WString' to 'const char*'
>
> Yeah, I seem to be fighting everything with wstrings, strings, WStrings,
> etc. Also WString is not near as useful as QString. (No split, join, etc)
>
> I don't want to fight it and have to convert all the time. What should I
> be using?
>
> ------------------------------
> *From:* Nagaev Boris <[email protected]>
> *To:* Jason H <[email protected]>; witty-interest <
> [email protected]>
> *Sent:* Wednesday, March 26, 2014 11:29 AM
> *Subject:* Re: [Wt-interest] Simple statement error
>
> Try to .bind(code)
>
> This method does not accept std::wstring
>
>
>
> On Wed, Mar 26, 2014 at 5:46 PM, Jason H <[email protected]> wrote:
> > Ok now that it knows my PostalCode type mapping, I am attempting to do:
> >
> > ---------------------
> >
> > WString code = postalCodeLE->text();
> >
> > if (code.value().length() )
> >
> > {
> >
> >
> > dbo::ptr<PostalCode> pc =
> > ((MyApplication*)wApp)->session.find<PostalCode>().where("code =
> > ?").bind(code.value());
> >
> > if (!pc->city.empty())
> >
> > cityLE->setText(pc->city);
> >
> > if (!pc->state.empty())
> >
> > stateCmb->setValueText(stateCmb->nameFromCode(pc->state));
> >
> >
> > }
> >
> >
> > However after several "required froms" I get
> >
> > /usr/include/Wt/Dbo/Field_impl.h:54: error: no matching function for
> call to
> > 'Wt::Dbo::sql_value_traits<std::basic_string<wchar_t>,
> > void>::bind(std::basic_string<wchar_t>&, Wt::Dbo::SqlStatement*&, int&,
> > const int&)'
> > sql_value_traits<V>::bind(value_, statement, column, size_);
> > ^
> >
> > /usr/include/Wt/Dbo/SqlTraits_impl.h:16: static void
> > Wt::Dbo::sql_value_traits<V, Enable>::bind(const char*,
> > Wt::Dbo::SqlStatement*, int, int) [with V = std::basic_string<wchar_t>;
> > Enable = void]
> > void sql_value_traits<V, Enable>::bind(const char *v, SqlStatement
> > *statement,
> > ^
> >
> > /usr/include/Wt/Dbo/SqlTraits_impl.h:16: note: no known conversion for
> > argument 1 from 'std::basic_string<wchar_t>' to 'const char*'
> >
> > ----------------------
> >
> >
> > Any help?
>
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Learn Graph Databases - Download FREE O'Reilly Book
> > "Graph Databases" is the definitive new guide to graph databases and
> their
> > applications. Written by three acclaimed leaders in the field,
> > this first edition is now available. Download your free book today!
> > http://p.sf.net/sfu/13534_NeoTech
> > _______________________________________________
> > witty-interest mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/witty-interest
>
> >
>
>
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest