"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/c2b/documentContents.h" between
cb2bib-2.0.0.tar.gz and cb2bib-2.0.1.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.

documentContents.h  (cb2bib-2.0.0):documentContents.h  (cb2bib-2.0.1)
/*************************************************************************** /***************************************************************************
* Copyright (C) 2004-2019 by Pere Constans * Copyright (C) 2004-2021 by Pere Constans
* constans@molspaces.com * constans@molspaces.com
* cb2Bib version 2.0.0. Licensed under the GNU GPL version 3. * cb2Bib version 2.0.1. 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.
***************************************************************************/ ***************************************************************************/
#ifndef DOCUMENTCONTENTS_H #ifndef DOCUMENTCONTENTS_H
#define DOCUMENTCONTENTS_H #define DOCUMENTCONTENTS_H
#include "cb2bib_utilities.h" #include "cb2bib_utilities.h"
#include <QHash> #include <QHash>
#include <QString> #include <QString>
skipping to change at line 29 skipping to change at line 29
enum Type enum Type
{ {
Simplified, Simplified,
Complete Complete
}; };
inline const QString& signature() const inline const QString& signature() const
{ {
if (!_is_signature_loaded) if (!_is_signature_loaded)
{ {
_signature = QString::fromUtf8(_cache.value(_signature_key)); _signature = c2bUtils::byteArrayToString(_cache.value(_signature_key ));
_is_signature_loaded = true; _is_signature_loaded = true;
} }
return _signature; return _signature;
} }
inline const QString& text() const inline const QString& text() const
{ {
if (!_is_text_loaded) if (!_is_text_loaded)
{ {
if (_type == Simplified) if (_type == Simplified)
_text = c2bUtils::toAscii(c2bUtils::fromUtf8(c2bUtils::uncompres _text = c2bUtils::toAscii(c2bUtils::decompressString(_cache.valu
s(_cache.value(_text_key))), e(_text_key)), c2bUtils::KeepWords);
c2bUtils::KeepWords);
else else
_text = c2bUtils::fromUtf8(c2bUtils::uncompress(_cache.value(_te xt_key))); _text = c2bUtils::decompressString(_cache.value(_text_key));
_is_text_loaded = true; _is_text_loaded = true;
} }
return _text; return _text;
} }
private: private:
inline explicit documentContents(const QHash<QString, QByteArray>& cache) inline explicit documentContents(const QHash<QString, QByteArray>& cache)
: _type(Complete), _cache(cache), _is_signature_loaded(false), _is_text_ loaded(false) {} : _type(Complete), _cache(cache), _is_signature_loaded(false), _is_text_ loaded(false) {}
inline ~documentContents() {} inline ~documentContents() {}
 End of changes. 5 change blocks. 
7 lines changed or deleted 6 lines changed or added

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