About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
CChar* to std::String
Author Message
JamesProctor Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #2
RE: CChar* to std::String
(Str8)S+string
04-25-2011 07:36 AM
Find all posts by this user Quote this message in a reply
JamesProctor Offline
Member

Post: #3
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
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #4
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
Find all posts by this user Quote this message in a reply
JamesProctor Offline
Member

Post: #5
RE: CChar* to std::String
string myName;
myName = (Str8)S+name;

That's not working.
04-25-2011 08:19 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #6
RE: CChar* to std::String
Try:

Code:
myName = name();
04-25-2011 08:23 AM
Find all posts by this user Quote this message in a reply
JamesProctor Offline
Member

Post: #7
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
Find all posts by this user Quote this message in a reply
Dandruff Offline
Member

Post: #8
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
Find all posts by this user Quote this message in a reply
JamesProctor Offline
Member

Post: #9
RE: CChar* to std::String
Ok thanks that worked!
04-25-2011 08:45 AM
Find all posts by this user Quote this message in a reply
Post Reply