VString PartLineTwo(VString line, VString &two, VString el, VString el2){ unsigned char *pos = line, *pos2 = pos; if(!rtms(line.endu(), el, el, pos)) pos = line.endu(); if(!rtms(line.endu(), el2, el2, pos2)) pos2 = line.endu(); pos = pos < pos2 ? pos : pos2; if(pos == line.endu()){ two.Clean(); return line; } two.setu(pos+el.sz, line.endu()-pos-el.sz); return VString(line.uchar(), pos-line.uchar()); }
VString PartLineST(VString line, VString &two){ // one = "Text Part ONe" [Space || Tab] "Text Part Two" -> two unsigned char *ln = line, *to =line.endu(); while(ln < to && (*ln != ' ' || *ln !='\t')) ln ++; if(ln == to){ two.Clean(); return line; } line = line.str(ln - line.data); while(ln < to && (*ln == ' ' || *ln =='\t')) ln ++; two.setu(ln, to - ln); return line; }
// PartLine VString PartLine(VString line, VString &two, VString el){ unsigned char *pos=line; if(!rtms(line.endu(), el, el, pos)){ two.Clean(); return line; } two.setu(pos+el.sz, line.endu()-pos-el.sz); return VString(line.uchar(), pos-line.uchar()); }