language-extensions/R/test/src/Utilities.cpp
//--------------------------------------------------------------------------------------------------
// Name: Utilities::GetWStringLength
//
// Description:
//  Gets the length of a wchar_t *.
//  wcslen does not work in Linux with -fshort-wchar, so we use this function instead.
//
:GetWStringLength
Description:
Gets the length of a wchar_t *.
wcslen does not work in Linux with -fshort-wchar, so we use this function instead.
: GetWStringLength Description : Gets the length of a wchar_t * . wcslen does not work in Linux with - fshort - wchar so we use this function instead .
SQLULEN Utilities::GetWStringLength(const wchar_t *wstr)
{
	SQLULEN distance = -1;
	if (wstr)
	{
		 Get distance from end of string to beginning
		const wchar_t *newstr = wstr;
		while (*newstr)
		{
			++newstr;
		}
		distance = newstr - wstr;
	}
	return distance;
}
SQLULEN Utilities :: GetWStringLength ( const wchar_t * wstr ) { SQLULEN distance = -1 ; if ( wstr ) { const wchar_t * newstr = wstr ; while ( * newstr ) { ++ newstr ; } distance = newstr - wstr ; } return distance ; }
Name: Utilities::GetWStringLength
Description:
Gets the length of a wchar_t *.
Name : Utilities :: GetWStringLength Description : Gets the length of a wchar_t * .
// If nullptr, return // // Get distance from end of string to beginning //