static bool fitString(CMyString str, CMyString sample, int shift) { str.MakeLower(); sample.MakeLower(); CMyString shiftSample = sample.Mid(shift); if (shiftSample.Find(str) == 0) return true; if (sample.Find(str) == 0) return true; return false; }
static CMyString firstChanStr(CMyString& descr) { CMyString numStr = _T("1234"); int index = descr.Find(_T("C")); int iP = descr.Find(_T("P")); int len = 0; CMyString chanStr = _T(""); if ((iP >= 0) && (index < 0 || (iP < index))) index = iP; if ((index < 0) || (descr.GetLength() == index + 1) || (!numStr.Found(descr[index + 1]))) { len = 0; } else { len = 2; if ((index > 0) && (descr[index - 1] == 'A')) { index--; len++; } } CMyString str = descr.Mid(index,len); descr = descr.Mid(index + len); return str; }
static CMyString firstType(CMyString type) { if (type.Find(_T("64fc")) == 0) return _T("64fc"); if (type.Find(_T("64sc")) == 0) return _T("64sc"); if (type.Find(_T("64s" )) == 0) return _T("64s") ; if (type.Find(_T("64f" )) == 0) return _T("64f") ; if (type.Find(_T("32fc")) == 0) return _T("32fc"); if (type.Find(_T("32sc")) == 0) return _T("32sc"); if (type.Find(_T("32u" )) == 0) return _T("32u") ; if (type.Find(_T("32s" )) == 0) return _T("32s") ; if (type.Find(_T("32f" )) == 0) return _T("32f") ; if (type.Find(_T("24u" )) == 0) return _T("24u") ; if (type.Find(_T("24s" )) == 0) return _T("24s") ; if (type.Find(_T("16sc")) == 0) return _T("16sc"); if (type.Find(_T("16u" )) == 0) return _T("16u") ; if (type.Find(_T("16s" )) == 0) return _T("16s") ; if (type.Find(_T("16f" )) == 0) return _T("16f") ; if (type.Find(_T("8sc" )) == 0) return _T("8sc") ; if (type.Find(_T("8u" )) == 0) return _T("8u") ; if (type.Find(_T("8s" )) == 0) return _T("8s") ; if (type.Find(_T("1u" )) == 0) return _T("8u") ; return _T(""); }