"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/c2b/documentParser.cpp" between
cb2bib-1.9.9.tar.gz and cb2bib-2.0.0.tar.gz

About: cb2Bib is a multiplatform application for rapidly extracting unformatted, or unstandardized bibliographic references from email alerts, journal Web pages, and PDF files.

documentParser.cpp  (cb2bib-1.9.9):documentParser.cpp  (cb2bib-2.0.0)
/*************************************************************************** /***************************************************************************
* Copyright (C) 2004-2018 by Pere Constans * Copyright (C) 2004-2019 by Pere Constans
* constans@molspaces.com * constans@molspaces.com
* cb2Bib version 1.9.9. Licensed under the GNU GPL version 3. * cb2Bib version 2.0.0. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution. * See the LICENSE file that comes with this distribution.
***************************************************************************/ ***************************************************************************/
#include "documentParser.h" #include "documentParser.h"
#include "QtDebug" documentParser::documentParser(const QString& text, const int maximum)
documentParser::documentParser(const QString& text, const int maximum) : : _space(QChar(' ')), _text(text), _maximum_words(maximum), _minimum_words(2
_space(QChar(' ')), ), _text_length(text.length())
_text(text),
_maximum_words(maximum),
_minimum_words(2),
_text_length(text.length())
{ {
_current_nwords = 0; _current_nwords = 0;
_current_ssentence_length = 0; _current_ssentence_length = 0;
_current_ssentence_origin = 0; _current_ssentence_origin = 0;
_nwords = 0; _nwords = 0;
_position = 0; _position = 0;
if (_text_length > 0) if (_text_length > 0)
{ {
if (_is_letter(_text[0])) if (_is_letter(_text[0]))
skipping to change at line 41 skipping to change at line 36
{ {
_ssentence_origin = nextWord(0); _ssentence_origin = nextWord(0);
_position = _ssentence_origin; _position = _ssentence_origin;
_all_done = (_ssentence_origin == _text_length); _all_done = (_ssentence_origin == _text_length);
} }
} }
else else
_all_done = true; _all_done = true;
} }
documentParser::~documentParser() documentParser::~documentParser() {}
{}
bool documentParser::parses() bool documentParser::parses()
{ {
if (_all_done) if (_all_done)
return false; return false;
// Assumed 0-terminated string, i.e., text[_text_length] = 0 // Assumed 0-terminated string, i.e., text[_text_length] = 0
const QChar* const text(_text.constData()); const QChar* const text(_text.constData());
int i(_position); int i(_position);
while (i++ < _text_length) while (i++ < _text_length)
 End of changes. 4 change blocks. 
11 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)