+ remove useless string init. (string foobar="")

This commit is contained in:
kelson42 2011-10-24 13:13:50 +00:00
parent c40a87837e
commit 8dce6d645e
1 changed files with 12 additions and 15 deletions

View File

@ -58,9 +58,9 @@ namespace kiwix {
/* Destructor */ /* Destructor */
Reader::~Reader() { Reader::~Reader() {
if (this->zimFileHandler != NULL) { if (this->zimFileHandler != NULL) {
delete this->zimFileHandler; delete this->zimFileHandler;
} }
} }
/* Reset the cursor for GetNextArticle() */ /* Reset the cursor for GetNextArticle() */
@ -168,38 +168,38 @@ namespace kiwix {
} }
string Reader::getTitle() { string Reader::getTitle() {
string value=""; string value;
this->getMetatag("Title", value); this->getMetatag("Title", value);
return value; return value;
} }
string Reader::getDescription() { string Reader::getDescription() {
string value=""; string value;
this->getMetatag("Description", value); this->getMetatag("Description", value);
return value; return value;
} }
string Reader::getLanguage() { string Reader::getLanguage() {
string value=""; string value;
this->getMetatag("Language", value); this->getMetatag("Language", value);
return value; return value;
} }
string Reader::getDate() { string Reader::getDate() {
string value=""; string value;
this->getMetatag("Date", value); this->getMetatag("Date", value);
return value; return value;
} }
string Reader::getCreator() { string Reader::getCreator() {
string value=""; string value;
this->getMetatag("Creator", value); this->getMetatag("Creator", value);
return value; return value;
} }
/* Return the first page URL */ /* Return the first page URL */
string Reader::getFirstPageUrl() { string Reader::getFirstPageUrl() {
string url = ""; string url;
zim::size_type firstPageOffset = zimFileHandler->getNamespaceBeginOffset('A'); zim::size_type firstPageOffset = zimFileHandler->getNamespaceBeginOffset('A');
zim::Article article = zimFileHandler->getArticle(firstPageOffset); zim::Article article = zimFileHandler->getArticle(firstPageOffset);
@ -300,7 +300,6 @@ namespace kiwix {
/* Search titles by prefix*/ /* Search titles by prefix*/
bool Reader::searchSuggestions(const string &prefix, unsigned int suggestionsCount) { bool Reader::searchSuggestions(const string &prefix, unsigned int suggestionsCount) {
bool retVal = true; bool retVal = true;
/* Reset the suggestions */ /* Reset the suggestions */
@ -325,8 +324,6 @@ namespace kiwix {
/* Get next suggestion */ /* Get next suggestion */
bool Reader::getNextSuggestion(string &title) { bool Reader::getNextSuggestion(string &title) {
bool retVal = false;
if (this->suggestionsOffset != this->suggestions.end()) { if (this->suggestionsOffset != this->suggestions.end()) {
/* title */ /* title */
title = *(this->suggestionsOffset); title = *(this->suggestionsOffset);
@ -334,10 +331,10 @@ namespace kiwix {
/* increment the cursor for the next call */ /* increment the cursor for the next call */
this->suggestionsOffset++; this->suggestionsOffset++;
retVal = true; return true;
} }
return retVal; return false;
} }
/* Check if the file has as checksum */ /* Check if the file has as checksum */