List:MySQL++« Previous MessageNext Message »
From:Robert Simmons Date:January 28 2009 10:15pm
Subject:Re: Convert mysqlpp::String to std::string
View as plain text  
Hello Warren,

Just tested that - and it doesn't seem to make any difference. If I  
use it exactly as you wrote it, "String" isnt defined within <string>  
or <string.h> and when put as "string" the original problem remains.  
Instead of returning "1;2;3;4;5" as it should in this case, the string  
only contains "1 - note the missing quote.

Cheers,

Robert Simmons
On 28 Jan 2009, at 21:53, Warren Young wrote:

> 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());
>
>
> -- 
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1
>

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