[fdo-dev] Why use wcslen on FdoStringP objects

Brent Robinson brent.robinson at autodesk.com
Mon Aug 14 09:24:37 EDT 2006


Hi Mateusz,

I'd recommend using GetLength(). Currently, it doesn't matter, since
GetLength() simply calls wcslen(), but there's always the chance that
the GetLength() implementation might change in the future. 

I'm not sure why we have so many direct calls to wcslen. My guess is
that developers were accustomed to calling wcslen() directly and
continued to do so after FdoString became available. Another possibility
is that some variables started out as GisString* and were later changed
to FdoString. 

Brent.

-----Original Message-----
From: Mateusz Loskot [mailto:mateusz at loskot.net] 
Sent: Sunday, August 13, 2006 10:22 PM
To: dev at fdo.osgeo.org
Subject: [fdo-dev] Why use wcslen on FdoStringP objects

Dear Friends,

This time I'd like to ask about FdoStringP class.
As I understand from docs, FdoStringP:GetLength() returns
number of wide characters (null not included).
So, why in many places in the code, wcslen() is used to calculate length
of FdoStringP objects?

FdoStringP retVal;
wcslen(retVal);

For example, in following function:
FdoRdbmsPostGisFilterProcessor::GetGeometryColumnNameForProperty()

Which way of string length calculation is recommended in FDO?

Best regards
-- 
Mateusz Loskot
http://mateusz.loskot.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at fdo.osgeo.org
For additional commands, e-mail: dev-help at fdo.osgeo.org





More information about the Fdo_dev mailing list