<div dir="ltr"><br><div class="gmail_extra"><br>Jorge,</div><div class="gmail_extra"><br></div><div class="gmail_extra">I don't believe oString.c_str() will ever be NULL. You can use the std::string empty() method to test if a string is empty (zero length). </div>
<div class="gmail_extra"><br></div><div class="gmail_extra"> <a href="http://www.cplusplus.com/reference/string/string/empty/">http://www.cplusplus.com/reference/string/string/empty/</a></div><div class="gmail_extra"><br>
</div><div class="gmail_extra">CPLStrings have no equivelient to a NULL distinct from being a zero length string.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Best regards,</div><div class="gmail_extra">
Frank</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 16, 2013 at 10:17 AM, Jorge Arévalo <span dir="ltr"><<a href="mailto:jorgearevalo@libregis.org" target="_blank">jorgearevalo@libregis.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">If I define a CPLString this way:<br>
<br>
CPLString osString;<br>
<br>
And I want to check if osString is not empty, what would be the best way?<br>
<br>
My bet:<br>
<br>
if (osString.c_str() == NULL)<br>
<br>
But I find it a little rusty... Is there any other better way?<br>
<br>
Many thanks in advance<br>
<br>
--<br>
Jorge Arevalo<br>
Freelance developer<br>
<br>
<a href="http://www.krop.com/jorgearevalo" target="_blank">http://www.krop.com/jorgearevalo</a><br>
<a href="http://about.me/jorgeas80" target="_blank">http://about.me/jorgeas80</a><br>
<br>
Enviado con Sparrow (<a href="http://www.sparrowmailapp.com/?sig" target="_blank">http://www.sparrowmailapp.com/?sig</a>)<br>
<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>and watch the world go round - Rush | Geospatial Software Developer<br>
</div></div>