Hi,
I'm writing a program to sort text files alphabetically in two levels. I got it working with *.txt files, but I'd like to do the same with *.rtf files.
Do you know, how I could get the plain text from the rich text format (preferably line by line).
The program basically uses an entry class like that:
Code:
class Entry
{
string entry; //original line of text
string entry_c; /*lowercase line of text, with some special
characters trimmed from beginning*/
vector<Subentry> sub; //similar class of subentries
//...
bool operator < (const Entry& a)
{return this->entry_c < a.entry_c;} /*for sort algorithm, sort vector of Entry's
by trimmed, lowercase lines*/
}
With a rtf file I could use the same classes, except string entry would have the line in rich text format and entry_c would have the (trimmed) plain text. Is it doable and does it make sense?