int VAISNAVADAY::GetFestivalClass(TString &str) { int i, j, val; i = str.Find("[c"); if (i >= 0) { // i += 2; if ((i + 2) < str.GetLength()) { val = int(str.GetAt(i+2) - '0'); j = str.Find("]", i); if (j >= str.GetLength()) j = str.GetLength(); if (j > i) { str.Delete(i, j - i + 1); } if (val < 0 || val > 6) return -1; return val; } else return -1; } else { return -1; } }
void VAISNAVADAY::GetFastingSubject(TString &strFest, int &nFast, TString &strFastSubj) { int nf, nf2; // default values nFast = 0; strFastSubj.Empty(); // finding fast subject nf = strFest.Find("[f:"); if (nf >= 0 && nf < strFest.GetLength()) { // ziskava typ postu nFast = strFest.GetAt(nf+3) - '0'; nf2 = strFest.Find("]", nf); if (nf2 >= 0) { strFest.Mid(nf + 5, nf2 - nf - 5, strFastSubj); } strFest.Delete(nf, strFest.GetLength() - nf); } }