Skip to content

Commit

Permalink
Prefix namespace "std"
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed Apr 19, 2024
1 parent c4b79bb commit 5892917
Show file tree
Hide file tree
Showing 23 changed files with 217 additions and 238 deletions.
5 changes: 2 additions & 3 deletions confirm/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <pugixml.hpp>
#endif
#pragma GCC diagnostic pop
using namespace std;


#ifdef HAVE_CLOUD
Expand Down Expand Up @@ -75,7 +74,7 @@ void Confirm_Worker::setup (std::string mailto, std::string username,
node.text ().set (information.c_str());
node = document.append_child ("p");
std::string siteUrl = config::logic::site_url (m_webserver_request);
std::string confirmation_url = filter_url_build_http_query (siteUrl + session_confirm_url (), "id", to_string(confirmation_id));
std::string confirmation_url = filter_url_build_http_query (siteUrl + session_confirm_url (), "id", std::to_string(confirmation_id));
node.text ().set (confirmation_url.c_str());
std::stringstream output;
document.print (output, "", pugi::format_raw);
Expand All @@ -87,7 +86,7 @@ void Confirm_Worker::setup (std::string mailto, std::string username,

// Handles a confirmation email received "from" with "subject" and "body".
// Returns true if the mail was handled, else false.
bool Confirm_Worker::handleEmail ([[maybe_unused]]string from, std::string subject, std::string body)
bool Confirm_Worker::handleEmail ([[maybe_unused]]std::string from, std::string subject, std::string body)
{
// Find out in the confirmation database whether the subject line contains an active ID.
// If not, bail out.
Expand Down
5 changes: 2 additions & 3 deletions consistency/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
#include <dialog/list.h>
#include <resource/logic.h>
#include <menu/logic.h>
using namespace std;


string consistency_index_url ()
std::string consistency_index_url ()
{
return "consistency/index";
}
Expand All @@ -50,7 +49,7 @@ bool consistency_index_acl (Webserver_Request& webserver_request)
}


string consistency_index (Webserver_Request& webserver_request)
std::string consistency_index (Webserver_Request& webserver_request)
{
std::string page;
Assets_Header header = Assets_Header (translate("Consistency"), webserver_request);
Expand Down
5 changes: 2 additions & 3 deletions consistency/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
#include <webserver/request.h>
#include <consistency/logic.h>
#include <database/volatile.h>
using namespace std;


string consistency_input_url ()
std::string consistency_input_url ()
{
return "consistency/input";
}
Expand All @@ -38,7 +37,7 @@ bool consistency_input_acl (Webserver_Request& webserver_request)
}


string consistency_input (Webserver_Request& webserver_request)
std::string consistency_input (Webserver_Request& webserver_request)
{
const int id = filter::strings::convert_to_int (webserver_request.post ["id"]);
const std::string passages = webserver_request.post ["passages"];
Expand Down
7 changes: 3 additions & 4 deletions consistency/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <webserver/request.h>
#include <access/bible.h>
#include <locale/translate.h>
using namespace std;


Consistency_Logic::Consistency_Logic (Webserver_Request& webserver_request, int id) :
Expand All @@ -36,7 +35,7 @@ m_webserver_request (webserver_request), m_id (id)
}


string Consistency_Logic::response ()
std::string Consistency_Logic::response ()
{
// The resources to display in the Consistency tool.
std::vector <std::string> resources = m_webserver_request.database_config_user()->getConsistencyResources ();
Expand Down Expand Up @@ -134,14 +133,14 @@ string Consistency_Logic::response ()
}


string Consistency_Logic::verseText (std::string resource, int book, int chapter, int verse)
std::string Consistency_Logic::verseText (std::string resource, int book, int chapter, int verse)
{
return resource_logic_get_html (m_webserver_request, resource, book, chapter, verse, false);
}


// This function omits the verse text from a line of text from the search results.
string Consistency_Logic::omit_verse_text (std::string input)
std::string Consistency_Logic::omit_verse_text (std::string input)
{
// Imagine the following $input:
// 1 Peter 4:17 For the time has come for judgment to begin with the household of God. If it begins first with us, what will happen to those who don’t obey the Good News of God?
Expand Down
5 changes: 2 additions & 3 deletions consistency/poll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
#include <webserver/request.h>
#include <consistency/logic.h>
#include <database/volatile.h>
using namespace std;


string consistency_poll_url ()
std::string consistency_poll_url ()
{
return "consistency/poll";
}
Expand All @@ -38,7 +37,7 @@ bool consistency_poll_acl (Webserver_Request& webserver_request)
}


string consistency_poll (Webserver_Request& webserver_request)
std::string consistency_poll (Webserver_Request& webserver_request)
{
const int id = filter::strings::convert_to_int (webserver_request.query ["id"]);
Consistency_Logic consistency_logic = Consistency_Logic (webserver_request, id);
Expand Down
3 changes: 1 addition & 2 deletions database/abbottsmith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <filter/url.h>
#include <filter/string.h>
#include <database/sqlite.h>
using namespace std;


// This is the database that contains Abbott-Smith's Manual Greek Lexicon.
Expand Down Expand Up @@ -80,7 +79,7 @@ void Database_AbbottSmith::store (std::string lemma, std::string lemma_casefold,
}


string Database_AbbottSmith::get (std::string lemma, std::string strong)
std::string Database_AbbottSmith::get (std::string lemma, std::string strong)
{
std::string contents;
SqliteDatabase sql = SqliteDatabase (filename ());
Expand Down
10 changes: 5 additions & 5 deletions database/bibleactions.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/string.h>
#include <config/globals.h>
#include <database/sqlite.h>
using namespace std;


const char * Database_BibleActions::filename ()
Expand Down Expand Up @@ -78,7 +77,7 @@ void Database_BibleActions::record (std::string bible, int book, int chapter, st
}


vector <std::string> Database_BibleActions::getBibles ()
std::vector <std::string> Database_BibleActions::getBibles ()
{
SqliteDatabase sql (filename ());
sql.add ("SELECT DISTINCT bible FROM bibleactions ORDER BY bible;");
Expand All @@ -87,7 +86,7 @@ vector <std::string> Database_BibleActions::getBibles ()
}


vector <int> Database_BibleActions::getBooks (std::string bible)
std::vector <int> Database_BibleActions::getBooks (std::string bible)
{
SqliteDatabase sql (filename ());
sql.add ("SELECT DISTINCT book FROM bibleactions WHERE bible =");
Expand All @@ -100,7 +99,7 @@ vector <int> Database_BibleActions::getBooks (std::string bible)
}


vector <int> Database_BibleActions::getChapters (std::string bible, int book)
std::vector <int> Database_BibleActions::getChapters (std::string bible, int book)
{
SqliteDatabase sql (filename ());
sql.add ("SELECT DISTINCT chapter FROM bibleactions WHERE bible =");
Expand All @@ -115,7 +114,7 @@ vector <int> Database_BibleActions::getChapters (std::string bible, int book)
}


string Database_BibleActions::getUsfm (std::string bible, int book, int chapter)
std::string Database_BibleActions::getUsfm (std::string bible, int book, int chapter)
{
SqliteDatabase sql (filename ());
sql.add ("SELECT usfm FROM bibleactions WHERE bible =");
Expand Down Expand Up @@ -147,3 +146,4 @@ void Database_BibleActions::erase (std::string bible, int book, int chapter)
sql.execute ();
}


11 changes: 4 additions & 7 deletions database/bibleimages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <filter/string.h>
#include <webserver/request.h>
#include <database/logic.h>
using namespace std;


// Database resilience:
// The data is stored as images and files in the filesystem.
// That should be resilient enough.


vector <std::string> Database_BibleImages::get ()
std::vector <std::string> Database_BibleImages::get ()
{
std::vector <std::string> files = filter_url_scandir (folder ());
std::vector <std::string> images;
Expand All @@ -53,7 +52,7 @@ void Database_BibleImages::store (std::string file)
}


string Database_BibleImages::get (std::string image)
std::string Database_BibleImages::get (std::string image)
{
std::string contents = filter_url_file_get_contents (path(image));
return contents;
Expand All @@ -67,15 +66,13 @@ void Database_BibleImages::erase (std::string image)
}


string Database_BibleImages::folder ()
std::string Database_BibleImages::folder ()
{
return filter_url_create_root_path ({"images"});
}


string Database_BibleImages::path (std::string image)
std::string Database_BibleImages::path (std::string image)
{
return filter_url_create_path ({folder (), image});
}


11 changes: 5 additions & 6 deletions database/books.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 <filter/diff.h>
#include <locale/translate.h>
#include <database/booksdata.h>
using namespace std;


namespace database::books {
Expand Down Expand Up @@ -56,7 +55,7 @@ book_id get_id_from_english (const std::string& english)
}


string get_english_from_id (book_id id)
std::string get_english_from_id (book_id id)
{
for (unsigned int i = 0; i < data_count; i++) {
if (id == books_table[i].id) {
Expand All @@ -67,7 +66,7 @@ string get_english_from_id (book_id id)
}


string get_usfm_from_id (book_id id)
std::string get_usfm_from_id (book_id id)
{
for (unsigned int i = 0; i < data_count; i++) {
if (id == books_table[i].id) {
Expand All @@ -78,7 +77,7 @@ string get_usfm_from_id (book_id id)
}


string get_bibleworks_from_id (book_id id)
std::string get_bibleworks_from_id (book_id id)
{
for (unsigned int i = 0; i < data_count; i++) {
if (id == books_table[i].id) {
Expand All @@ -89,7 +88,7 @@ string get_bibleworks_from_id (book_id id)
}


string get_osis_from_id (book_id id)
std::string get_osis_from_id (book_id id)
{
for (unsigned int i = 0; i < data_count; i++) {
if (id == books_table[i].id) {
Expand Down Expand Up @@ -173,7 +172,7 @@ book_id get_id_from_onlinebible (const std::string& onlinebible)
}


string get_onlinebible_from_id (book_id id)
std::string get_onlinebible_from_id (book_id id)
{
for (unsigned int i = 0; i < data_count; i++) {
if (id == books_table[i].id) {
Expand Down
Loading

0 comments on commit 5892917

Please sign in to comment.