List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:January 28 2009 9:53pm
Subject:Re: Convert mysqlpp::String to std::string
View as plain text  
On Jan 28, 2009, at 5:40 AM, Robert Simmons wrote:

> 		string servers(clusters[i]["servers"]); //servers => "1

This should do what you want, unless the field has embedded null  
characters in it.  (Typical of BLOB data.)  In that case, either keep  
it in String form, as that has better copy semantics, or do the copy  
this way:

	String blob(clusters[i]["servers"]);
	string servers(blob.data(), blob.length());

Thread
Convert mysqlpp::String to std::stringRobert Simmons28 Jan
  • Re: Convert mysqlpp::String to std::stringWarren Young28 Jan
    • Re: Convert mysqlpp::String to std::stringRobert Simmons28 Jan
      • Re: Convert mysqlpp::String to std::stringWarren Young28 Jan
        • RE: Convert mysqlpp::String to std::stringJeremy Rottman29 Jan
          • Re: Convert mysqlpp::String to std::stringRobert Simmons29 Jan