[fdo-dev] Why use wcslen on FdoStringP objects

Greg Boone greg.boone at autodesk.com
Mon Aug 14 10:19:30 EDT 2006


We should do a pass in Marble FDO code to clean this up.

-----Original Message-----
From: Brent Robinson 
Sent: Monday, August 14, 2006 9:25 AM
To: mateusz at loskot.net
Cc: dev at fdo.osgeo.org
Subject: RE: [fdo-dev] Why use wcslen on FdoStringP objects

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


---------------------------------------------------------------------
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-internals mailing list