// read the attribute from one of the file's text line void ReadAttribute(tPvHandle aCamera,char* aLine) { char* lValue = strchr(aLine,'='); char* lLabel; if(lValue) { lValue[0] = '\0'; lValue++; lLabel = strtrim(aLine); lValue = strtrim(lValue); if(strlen(lLabel) && strlen(lValue)) { tPvAttributeInfo lInfo; if(!PvAttrInfo(aCamera,lLabel,&lInfo)) { if(lInfo.Datatype != ePvDatatypeCommand && (lInfo.Flags & ePvFlagWrite)) { if(!String2Value(aCamera,lLabel,lInfo.Datatype,lValue)) fprintf(stderr,"attribute %s couldn't be loaded\n",lLabel); } } } } }
const SStringW & SNamedString::Get(const SStringW & strValue) const { if(strValue.IsEmpty()) return strValue; if(strValue.Left(ARRAYSIZE(KPrefixString)-1)==KPrefixString) { return String2Value(strValue.Mid(ARRAYSIZE(KPrefixString)-1)); }else { return strValue; } }
const COLORREF & SNamedColor::Get(const SStringW & strValue) const { if(strValue.Left(ARRAYSIZE(KPrefixColor)-1)==KPrefixColor) { return String2Value(strValue.Mid(ARRAYSIZE(KPrefixColor)-1)); }else { static COLORREF crRet; crRet = SColorParser::GetNullValue(); SColorParser::ParseValue(strValue, crRet); return crRet; } }
const SLayoutSize & SNamedDimension::Get(const SStringW & strValue) const { if (strValue.Left(ARRAYSIZE(KPrefixDimension) - 1) == KPrefixDimension) { return String2Value(strValue.Mid(ARRAYSIZE(KPrefixDimension) - 1)); } else { static SLayoutSize dimRet; dimRet = SDimensionParser::GetNullValue(); SDimensionParser::ParseValue(strValue, dimRet); return dimRet; } }