Skip to content

Commit

Permalink
Mention std:: before every relevant type
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed Apr 20, 2024
1 parent 9cf9cd7 commit a7a1f4d
Show file tree
Hide file tree
Showing 34 changed files with 239 additions and 909 deletions.
3 changes: 1 addition & 2 deletions esword/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <filter/url.h>
#include <filter/url.h>
#include <database/sqlite.h>
using namespace std;


// Class for creating e-Sword documents.
Expand All @@ -33,7 +32,7 @@ Esword_Text::Esword_Text (std::string bible)
currentBook = 0;
currentChapter = 0;
currentVerse = 0;
currentText = "";
currentText.clear();
bible = database_sqlite_no_sql_injection (bible);
sql.push_back ("PRAGMA foreign_keys=OFF;");
sql.push_back ("PRAGMA synchronous=OFF;");
Expand Down
3 changes: 1 addition & 2 deletions executable/bibledit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <windows.h>
#endif
#include <config/globals.h>
using namespace std;

// Fix for architecture hurd-i386 that does not define MAXPATHLEN.
#ifndef MAXPATHLEN
Expand All @@ -50,7 +49,7 @@ static void sigint_handler ([[maybe_unused]] int s)
}


static string backtrace_path ()
static std::string backtrace_path ()
{
return filter_url_create_root_path ({filter_url_temp_dir (), "backtrace.txt"});
}
Expand Down
1 change: 0 additions & 1 deletion executable/generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <sources/styles.h>
#include <sources/abbott-smith.h>
#include <i18n/logic.h>
using namespace std;


int main (int argc, char **argv)
Expand Down
1 change: 0 additions & 1 deletion export/bibledropbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <styles/sheets.h>
#include <webserver/request.h>
#include <email/send.h>
using namespace std;


void export_bibledropbox (std::string user, std::string bible)
Expand Down
1 change: 0 additions & 1 deletion export/esword.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <filter/usfm.h>
#include <locale/translate.h>
#include <styles/sheets.h>
using namespace std;


void export_esword (std::string bible, bool log)
Expand Down
1 change: 0 additions & 1 deletion export/html.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <html/header.h>
#include <locale/translate.h>
#include <styles/sheets.h>
using namespace std;


void export_html_book (std::string bible, int book, bool log)
Expand Down
1 change: 0 additions & 1 deletion export/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <filter/url.h>
#include <filter/string.h>
#include <filter/roles.h>
using namespace std;


void export_index ()
Expand Down
1 change: 0 additions & 1 deletion export/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <filter/shell.h>
#include <locale/translate.h>
#include <styles/sheets.h>
using namespace std;


void export_info (std::string bible, bool log)
Expand Down
19 changes: 9 additions & 10 deletions export/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <filter/string.h>
#include <filter/passage.h>
#include <locale/translate.h>
using namespace std;


// Schedule all Bibles for exports.
Expand Down Expand Up @@ -125,14 +124,14 @@ void export_logic::schedule_e_sword (const std::string& bible, bool log)


// The main exports directory.
string export_logic::main_directory ()
std::string export_logic::main_directory ()
{
return filter_url_create_root_path ({"exports"});
}


// A Bible's export directory.
string export_logic::bible_directory (const std::string& bible)
std::string export_logic::bible_directory (const std::string& bible)
{
return filter_url_create_path ({main_directory (), bible});
}
Expand All @@ -143,7 +142,7 @@ string export_logic::bible_directory (const std::string& bible)
// 0: directory for the full USFM.
// 1: directory for the basic USFM.
// 2: root USFM directory.
string export_logic::usfm_directory (const std::string& bible, int type)
std::string export_logic::usfm_directory (const std::string& bible, int type)
{
std::string directory = filter_url_create_path ({bible_directory (bible), "usfm"});
switch (type) {
Expand All @@ -155,13 +154,13 @@ string export_logic::usfm_directory (const std::string& bible, int type)
}


string export_logic::web_directory (const std::string& bible)
std::string export_logic::web_directory (const std::string& bible)
{
return filter_url_create_path ({bible_directory (bible), "web"});
}


string export_logic::web_back_link_directory (const std::string& bible)
std::string export_logic::web_back_link_directory (const std::string& bible)
{
return "/exports/" + bible + "/web/";
}
Expand All @@ -170,19 +169,19 @@ string export_logic::web_back_link_directory (const std::string& bible)
// Provides the base book file name, e.g. 01_Genesis.
// Or 00_Bible for an entire Bible when $book = 0;
// Takes in account the order of the books, possibly modified by the user.
string export_logic::base_book_filename (const std::string& bible, int book)
std::string export_logic::base_book_filename (const std::string& bible, int book)
{
std::string filename;
if (book) {
// The file name has a number that indicates the defined order of the book.
// See https://github.com/bibledit/cloud/issues/810
// Localize the English book name: https://github.com/bibledit/cloud/issues/241
std::vector <int> ordered_books = filter_passage_get_ordered_books (bible);
vector<int>::iterator iterator;
std::vector<int>::iterator iterator;
iterator = find(ordered_books.begin(), ordered_books.end(), book);
if (iterator != ordered_books.end()) {
long order = iterator - ordered_books.begin() + 1;
filename = filter::strings::fill (to_string (order), 2, '0');
const long order = iterator - ordered_books.begin() + 1;
filename = filter::strings::fill (std::to_string (order), 2, '0');
filename.append ("_");
}
filename.append (translate (database::books::get_english_from_id (static_cast<book_id>(book))));
Expand Down
1 change: 0 additions & 1 deletion export/odt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <filter/passage.h>
#include <locale/translate.h>
#include <styles/sheets.h>
using namespace std;


void export_odt_book (std::string bible, int book, bool log)
Expand Down
1 change: 0 additions & 1 deletion export/onlinebible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <locale/translate.h>
#include <styles/sheets.h>
#include <olb/text.h>
using namespace std;


void export_onlinebible (std::string bible, bool log)
Expand Down
1 change: 0 additions & 1 deletion export/textusfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <filter/usfm.h>
#include <locale/translate.h>
#include <styles/sheets.h>
using namespace std;


void export_text_usfm_book (std::string bible, int book, bool log)
Expand Down
1 change: 0 additions & 1 deletion export/usfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <filter/shell.h>
#include <locale/translate.h>
#include <styles/sheets.h>
using namespace std;


void export_usfm (std::string bible, bool log)
Expand Down
9 changes: 4 additions & 5 deletions export/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <html/header.h>
#include <locale/translate.h>
#include <styles/sheets.h>
using namespace std;


void export_web_book (std::string bible, int book, bool log)
Expand Down Expand Up @@ -79,8 +78,8 @@ void export_web_book (std::string bible, int book, bool log)
Html_Header htmlHeader = Html_Header (html_text_rich_book_index);
htmlHeader.search_back_link (backLinkPath + filter_url_html_file_name_bible ("", book), translate("Go back to") + " " + bibleBookText);
htmlHeader.create ({
pair (bible, filter_url_html_file_name_bible ()),
pair (translate (database::books::get_english_from_id (static_cast<book_id>(book))), filter_url_html_file_name_bible ())
std::pair (bible, filter_url_html_file_name_bible ()),
std::pair (translate (database::books::get_english_from_id (static_cast<book_id>(book))), filter_url_html_file_name_bible ())
});
html_text_rich_book_index.new_paragraph ("navigationbar");
html_text_rich_book_index.add_text ("|");
Expand Down Expand Up @@ -110,7 +109,7 @@ void export_web_book (std::string bible, int book, bool log)
// Create breadcrumbs and navigator for the chapter.
Html_Header html_header = Html_Header (*filter_text_chapter.html_text_linked);
html_header.search_back_link (backLinkPath + filter_url_html_file_name_bible ("", book, chapter), translate("Go back to") + " " + bibleBookText + " " + filter::strings::convert_to_string (chapter));
std::vector <std::pair <string, std::string> > breadcrumbs_navigator;
std::vector <std::pair <std::string, std::string> > breadcrumbs_navigator;
breadcrumbs_navigator.push_back (std::pair (bible, filter_url_html_file_name_bible ()));
breadcrumbs_navigator.push_back (std::pair (translate (database::books::get_english_from_id (static_cast<book_id>(book))), filter_url_html_file_name_bible ()));
if (!is_first_chapter) {
Expand Down Expand Up @@ -192,7 +191,7 @@ void export_web_index (std::string bible, bool log)
// On top are the breadcrumbs, starting with a clickable Bible name.
Html_Header htmlHeader = Html_Header (html_text_rich_bible_index);
htmlHeader.search_back_link (backLinkPath + filter_url_html_file_name_bible (), translate("Go back to Bible"));
htmlHeader.create ({ pair (bible, filter_url_html_file_name_bible ())});
htmlHeader.create ({ std::pair (bible, filter_url_html_file_name_bible ())});


// Prepare for the list of books in de html index file.
Expand Down
25 changes: 12 additions & 13 deletions filter/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <database/logs.h>
#include <microtar/microtar.h>
#include <miniz/miniz.h>
using namespace std;


// Work around old Microsoft macro definitions.
Expand All @@ -34,7 +33,7 @@ using namespace std;

// Compresses a $folder into zip format.
// Returns the path to the compressed archive it created.
string filter_archive_zip_folder (std::string folder)
std::string filter_archive_zip_folder (std::string folder)
{
#ifdef HAVE_CLOUD
return filter_archive_zip_folder_shell_internal (folder);
Expand All @@ -47,7 +46,7 @@ string filter_archive_zip_folder (std::string folder)

// Compresses a $folder into zip format.
// Returns the path to the compressed archive it created.
string filter_archive_zip_folder_shell_internal (std::string folder)
std::string filter_archive_zip_folder_shell_internal (std::string folder)
{
if (!file_or_dir_exists (folder)) return std::string();
std::string zippedfile = filter_url_tempfile () + ".zip";
Expand All @@ -71,7 +70,7 @@ string filter_archive_zip_folder_shell_internal (std::string folder)

// Compresses a $folder into zip format.
// Returns the path to the compressed archive it created.
string filter_archive_zip_folder_miniz_internal (std::string folder)
std::string filter_archive_zip_folder_miniz_internal (std::string folder)
{
if (!file_or_dir_exists (folder)) {
return std::string();
Expand Down Expand Up @@ -107,7 +106,7 @@ string filter_archive_zip_folder_miniz_internal (std::string folder)

// Uncompresses a zip archive identified by $file.
// Returns the path to the folder it created.
string filter_archive_unzip (std::string file)
std::string filter_archive_unzip (std::string file)
{
#ifdef HAVE_CLOUD
return filter_archive_unzip_shell_internal (file);
Expand All @@ -120,7 +119,7 @@ string filter_archive_unzip (std::string file)

// Uncompresses a zip archive identified by $file.
// Returns the path to the folder it created.
string filter_archive_unzip_shell_internal ([[maybe_unused]] std::string file)
std::string filter_archive_unzip_shell_internal ([[maybe_unused]] std::string file)
{
std::string folder = filter_url_tempfile ();
#ifdef HAVE_CLOUD
Expand Down Expand Up @@ -148,7 +147,7 @@ string filter_archive_unzip_shell_internal ([[maybe_unused]] std::string file)

// Uncompresses the $zipfile.
// Returns the path to the folder it created.
string filter_archive_unzip_miniz_internal (std::string zipfile)
std::string filter_archive_unzip_miniz_internal (std::string zipfile)
{
// Directory where to unzip the archive.
std::string folder = filter_url_tempfile ();
Expand Down Expand Up @@ -239,7 +238,7 @@ string filter_archive_unzip_miniz_internal (std::string zipfile)

// Compresses a file identified by $filename into gzipped tar format.
// Returns the path to the compressed archive it created.
string filter_archive_tar_gzip_file (std::string filename)
std::string filter_archive_tar_gzip_file (std::string filename)
{
std::string tarball = filter_url_tempfile () + ".tar.gz";
std::string dirname = filter_url_escape_shell_argument (filter_url_dirname (filename));
Expand All @@ -266,7 +265,7 @@ string filter_archive_tar_gzip_file (std::string filename)

// Compresses a $folder into gzipped tar format.
// Returns the path to the compressed archive it created.
string filter_archive_tar_gzip_folder (std::string folder)
std::string filter_archive_tar_gzip_folder (std::string folder)
{
std::string tarball = filter_url_tempfile () + ".tar.gz";
folder = filter_url_escape_shell_argument (folder);
Expand All @@ -292,7 +291,7 @@ string filter_archive_tar_gzip_folder (std::string folder)

// Uncompresses a .tar.gz archive identified by $file.
// Returns the path to the folder it created.
string filter_archive_untar_gzip (std::string file)
std::string filter_archive_untar_gzip (std::string file)
{
file = filter_url_escape_shell_argument (file);
std::string folder = filter_url_tempfile ();
Expand Down Expand Up @@ -320,7 +319,7 @@ string filter_archive_untar_gzip (std::string file)

// Uncompresses a known archive identified by $file.
// Returns the path to the folder it created.
string filter_archive_uncompress (std::string file)
std::string filter_archive_uncompress (std::string file)
{
int type = filter_archive_is_archive (file);
if (type == 1) {
Expand Down Expand Up @@ -359,7 +358,7 @@ int filter_archive_is_archive (std::string file)


// Create a tarball at $tarpath with input $files from $directory.
string filter_archive_microtar_pack (std::string tarpath, std::string directory, std::vector <std::string> files)
std::string filter_archive_microtar_pack (std::string tarpath, std::string directory, std::vector <std::string> files)
{
mtar_t tar;
int res;
Expand Down Expand Up @@ -398,7 +397,7 @@ string filter_archive_microtar_pack (std::string tarpath, std::string directory,


// Unpack the tarball at $tarpath and store the individual files at $outputpath.
string filter_archive_microtar_unpack (std::string tarball, std::string directory)
std::string filter_archive_microtar_unpack (std::string tarball, std::string directory)
{
mtar_t tar;
mtar_header_t h;
Expand Down
Loading

0 comments on commit a7a1f4d

Please sign in to comment.