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; }
void CFunc::ParseFunction(CMyString& base, CMyString& type1, CMyString& type2, CMyString& type3, CMyString& descr) const { CMyString type; ParseFunction(base,type,descr); int len = type.GetLength(); type1 = firstType(type); int len1 = type1.GetLength(); if (len1 == len) { type2 = type3 = type1; } else { type2 = firstType(type.Mid(len1)); int len2 = type2.GetLength(); if (len1 + len2 == len) { type3 = type2; if (!descr.Found(_T("I"))) type2 = type1; } else { type3 = firstType(type.Mid(len1+len2)); } } }
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; }