Leo Tolstoy. War and Peace
| 1562 | |
| 1563 | // Leo Tolstoy. War and Peace |
| 1564 | bool testAuthorDotTitleFormat() |
| 1565 | { |
| 1566 | int i = 0; |
| 1567 | for ( ; i<length() && get(i)->rpos==0; i++ ) |
| 1568 | ; |
| 1569 | if ( i>=length() ) |
| 1570 | return false; |
| 1571 | bookTitle.clear(); |
| 1572 | bookAuthors.clear(); |
| 1573 | lString16 firstLine = get(i)->text; |
| 1574 | firstLine.trim(); |
| 1575 | int dotPos = firstLine.pos(L". "); |
| 1576 | if ( dotPos<=0 ) |
| 1577 | return false; |
| 1578 | bookAuthors = firstLine.substr( 0, dotPos ); |
| 1579 | bookTitle = firstLine.substr( dotPos + 2, firstLine.length() - dotPos - 2); |
| 1580 | if ( bookTitle.empty() || (lGetCharProps(bookTitle[bookTitle.length()]) & CH_PROP_PUNCT) ) |
| 1581 | return false; |
| 1582 | return true; |
| 1583 | } |
| 1584 | |
| 1585 | /// check beginning of file for book title, author and series |
| 1586 | bool DetectBookDescription(LVXMLParserCallback * callback) |