JamesProctor
Member
|
CChar* to std::String
I am attempting to create a server using the engine. I am trying to connect to a MySql Database but in order to do that I need all strings to be std::strings not the engine's Str structure.
I have got username and password all being set us Str. Is there anyway to be able to convert a Str to std::string?
|
|
04-25-2011 07:30 AM |
|
Dandruff
Member
|
RE: CChar* to std::String
(Str8)S+string
|
|
04-25-2011 07:36 AM |
|
JamesProctor
Member
|
RE: CChar* to std::String
That looks to me like it's to convert std::string to Str which isn't what I want. I want Str to std::string.
|
|
04-25-2011 07:44 AM |
|
Dandruff
Member
|
RE: CChar* to std::String
string is your EE::Str, cast (Str8) will then be CChar8* which is std::string.
Example:
printf((Str8)S+"EE::Str I: "+i);
|
|
04-25-2011 08:10 AM |
|
JamesProctor
Member
|
RE: CChar* to std::String
string myName;
myName = (Str8)S+name;
That's not working.
|
|
04-25-2011 08:19 AM |
|
Driklyn
Member
|
RE: CChar* to std::String
|
|
04-25-2011 08:23 AM |
|
JamesProctor
Member
|
RE: CChar* to std::String
nope doesn't work.
Why make it so hard to convert into standard string classes?
|
|
04-25-2011 08:31 AM |
|
Dandruff
Member
|
RE: CChar* to std::String
Whoops. Try myName = (Str8)name. S+ is for non string types (int/flt/etc) my bad
|
|
04-25-2011 08:36 AM |
|
JamesProctor
Member
|
RE: CChar* to std::String
Ok thanks that worked!
|
|
04-25-2011 08:45 AM |
|