本文整理汇总了C++中CPLString::tolower方法的典型用法代码示例。如果您正苦于以下问题:C++ CPLString::tolower方法的具体用法?C++ CPLString::tolower怎么用?C++ CPLString::tolower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPLString
的用法示例。
在下文中一共展示了CPLString::tolower方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckCitationKeyForStatePlaneUTM
OGRBoolean CheckCitationKeyForStatePlaneUTM(GTIF* hGTIF, GTIFDefn* psDefn, OGRSpatialReference* poSRS, OGRBoolean* pLinearUnitIsSet)
{
if( !hGTIF || !psDefn || !poSRS )
return FALSE;
/* -------------------------------------------------------------------- */
/* For ESRI builds we are interested in maximizing PE */
/* compatability, but generally we prefer to use EPSG */
/* definitions of the coordinate system if PCS is defined. */
/* -------------------------------------------------------------------- */
#if !defined(ESRI_BUILD)
if( psDefn->PCS != KvUserDefined )
return FALSE;
#endif
char szCTString[512];
szCTString[0] = '\0';
/* Check units */
char units[32];
units[0] = '\0';
OGRBoolean hasUnits = FALSE;
if( GTIFKeyGet( hGTIF, GTCitationGeoKey, szCTString, 0, sizeof(szCTString) ) )
{
CPLString osLCCT = szCTString;
osLCCT.tolower();
if( strstr(osLCCT,"us") && strstr(osLCCT,"survey")
&& (strstr(osLCCT,"feet") || strstr(osLCCT,"foot")) )
strcpy(units, "us_survey_feet");
else if(strstr(osLCCT, "linear_feet")
|| strstr(osLCCT, "linear_foot")
|| strstr(osLCCT, "international"))
strcpy(units, "international_feet");
else if( strstr(osLCCT,"meter") )
strcpy(units, "meters");
if (strlen(units) > 0)
hasUnits = TRUE;
if( strstr( szCTString, "Projection Name = ") && strstr( szCTString, "_StatePlane_"))
{
const char *pStr = strstr( szCTString, "Projection Name = ") + strlen("Projection Name = ");
const char* pReturn = strchr( pStr, '\n');
char CSName[128];
strncpy(CSName, pStr, pReturn-pStr);
CSName[pReturn-pStr] = '\0';
if( poSRS->ImportFromESRIStatePlaneWKT(0, NULL, NULL, 32767, CSName) == OGRERR_NONE )
{
// for some erdas citation keys, the state plane CS name is incomplete, the unit check is necessary.
OGRBoolean done = FALSE;
if (hasUnits)
{
OGR_SRSNode *poUnit = poSRS->GetAttrNode( "PROJCS|UNIT" );
if( poUnit != NULL && poUnit->GetChildCount() >= 2 )
{
CPLString unitName = poUnit->GetChild(0)->GetValue();
unitName.tolower();
if (strstr(units, "us_survey_feet"))
{
if (strstr(unitName, "us_survey_feet") || strstr(unitName, "foot_us") )
done = TRUE;
}
else if (strstr(units, "international_feet"))
{
if (strstr(unitName, "feet") || strstr(unitName, "foot"))
done = TRUE;
}
else if (strstr(units, "meters"))
{
if (strstr(unitName, "meter") )
done = TRUE;
}
}
}
if (done)
return TRUE;
}
}
}
if( !hasUnits )
{
char *pszUnitsName = NULL;
GTIFGetUOMLengthInfo( psDefn->UOMLength, &pszUnitsName, NULL );
if( pszUnitsName && strlen(pszUnitsName) > 0 )
{
CPLString osLCCT = pszUnitsName;
GTIFFreeMemory( pszUnitsName );
osLCCT.tolower();
if( strstr(osLCCT, "us") && strstr(osLCCT, "survey")
&& (strstr(osLCCT, "feet") || strstr(osLCCT, "foot")))
strcpy(units, "us_survey_feet");
else if(strstr(osLCCT, "feet") || strstr(osLCCT, "foot"))
strcpy(units, "international_feet");
else if(strstr(osLCCT, "meter"))
//.........这里部分代码省略.........