Skip to content

Commit

Permalink
Namespace std::
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed Apr 18, 2024
1 parent 0e3cf1e commit fcaeebb
Show file tree
Hide file tree
Showing 27 changed files with 55 additions and 56 deletions.
17 changes: 8 additions & 9 deletions checks/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
#include <assets/header.h>
#include <menu/logic.h>
#include <journal/logic.h>
using namespace std;


string checks_settings_url ()
std::string checks_settings_url ()
{
return "checks/settings";
}
Expand All @@ -56,19 +55,19 @@ bool checks_settings_acl ([[maybe_unused]] Webserver_Request& webserver_request)
}


string checks_settings (Webserver_Request& webserver_request)
std::string checks_settings (Webserver_Request& webserver_request)
{
string page {};
std::string page {};
Assets_Header header = Assets_Header (translate("Manage Checks"), webserver_request);
header.add_bread_crumb (menu_logic_settings_menu (), menu_logic_settings_text ());
page = header.run ();
Assets_View view {};


if (webserver_request.query.count ("bible")) {
string bible = webserver_request.query["bible"];
const std::string bible = webserver_request.query["bible"];
if (bible.empty()) {
Dialog_List dialog_list = Dialog_List ("settings", translate("Select which Bible to manage"), string(), string());
Dialog_List dialog_list = Dialog_List ("settings", translate("Select which Bible to manage"), std::string(), std::string());
std::vector <std::string> bibles = access_bible::bibles (webserver_request);
for (const auto & selectable_bible : bibles) {
dialog_list.add_row (selectable_bible, "bible", selectable_bible);
Expand All @@ -79,7 +78,7 @@ string checks_settings (Webserver_Request& webserver_request)
webserver_request.database_config_user()->setBible (bible);
}
}
string bible = access_bible::clamp (webserver_request, webserver_request.database_config_user()->getBible ());
const std::string bible = access_bible::clamp (webserver_request, webserver_request.database_config_user()->getBible ());


if (webserver_request.query.count ("run")) {
Expand All @@ -89,8 +88,8 @@ string checks_settings (Webserver_Request& webserver_request)
}


string checkbox = webserver_request.post ["checkbox"];
bool checked = filter::strings::convert_to_bool (webserver_request.post ["checked"]);
const std::string checkbox = webserver_request.post ["checkbox"];
const bool checked = filter::strings::convert_to_bool (webserver_request.post ["checked"]);


if (checkbox == "doublespacesusfm") {
Expand Down
2 changes: 1 addition & 1 deletion checks/verses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void checks_verses::missing_punctuation_at_end (const std::string& bible, int bo
if (verse == 0) continue;
if (text.empty ()) continue;
for (const auto & ignore_text : ignores) {
text = filter::strings::replace (ignore_text, string(), text);
text = filter::strings::replace (ignore_text, std::string(), text);
}
const size_t text_length = filter::strings::unicode_string_length (text);
const string lastCharacter = filter::strings::unicode_string_substr (text, text_length - 1, 1);
Expand Down
6 changes: 3 additions & 3 deletions checksum/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ string checksum_logic::get_book (Webserver_Request& webserver_request, const std
for (auto chapter : chapters) {
checksums.push_back (get_chapter (webserver_request, bible, book, chapter));
}
string checksum = filter::strings::implode (checksums, string());
string checksum = filter::strings::implode (checksums, std::string());
checksum = md5 (checksum);
return checksum;
}
Expand All @@ -92,7 +92,7 @@ string checksum_logic::get_bible (Webserver_Request& webserver_request, const st
for (auto book : books) {
checksums.push_back (get_book (webserver_request, bible, book));
}
string checksum = filter::strings::implode (checksums, string());
string checksum = filter::strings::implode (checksums, std::string());
checksum = md5 (checksum);
return checksum;
}
Expand All @@ -105,7 +105,7 @@ string checksum_logic::get_bibles (Webserver_Request& webserver_request, const s
for (const auto & bible : bibles) {
checksums.push_back (get_bible (webserver_request, bible));
}
string checksum = filter::strings::implode (checksums, string());
string checksum = filter::strings::implode (checksums, std::string());
checksum = md5 (checksum);
return checksum;
}
Expand Down
2 changes: 1 addition & 1 deletion edit/save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ string edit_save (Webserver_Request& webserver_request)
return translate("Save failure");
}

if (!access_bible::book_write (webserver_request, string(), bible, book)) {
if (!access_bible::book_write (webserver_request, std::string(), bible, book)) {
return translate("No write access");
}

Expand Down
2 changes: 1 addition & 1 deletion edit/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ string edit_update (Webserver_Request& webserver_request)

bool bible_write_access = false;
if (good2go) {
bible_write_access = access_bible::book_write (webserver_request, string(), bible, book);
bible_write_access = access_bible::book_write (webserver_request, std::string(), bible, book);
}


Expand Down
2 changes: 1 addition & 1 deletion editone2/save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ string editone2_save (Webserver_Request& webserver_request)
}


if (!access_bible::book_write (webserver_request, string(), bible, book)) {
if (!access_bible::book_write (webserver_request, std::string(), bible, book)) {
return translate ("No write access");
}

Expand Down
2 changes: 1 addition & 1 deletion editone2/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ string editone2_update (Webserver_Request& webserver_request)

bool bible_write_access = false;
if (good2go) {
bible_write_access = access_bible::book_write (webserver_request, string(), bible, book);
bible_write_access = access_bible::book_write (webserver_request, std::string(), bible, book);
}


Expand Down
2 changes: 1 addition & 1 deletion editor/html2usfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ string editor_export_verse_quill (string stylesheet, string html)
string usfm = editor_export.get ();

// Remove that recognizable style converted to USFM.
usfm = filter::strings::replace (R"(\)" + style, string(), usfm);
usfm = filter::strings::replace (R"(\)" + style, std::string(), usfm);
usfm = filter::strings::trim (usfm);

return usfm;
Expand Down
2 changes: 1 addition & 1 deletion editusfm/save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ string editusfm_save (Webserver_Request& webserver_request)


// Check on write access.
if (access_bible::book_write (webserver_request, string(), bible, book)) {
if (access_bible::book_write (webserver_request, std::string(), bible, book)) {
// Safely store the chapter.
string explanation;
string message = filter::usfm::safely_store_chapter (webserver_request, bible, book, chapter, chapter_data_to_save, explanation);
Expand Down
2 changes: 1 addition & 1 deletion filter/google.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tuple <string, std::string> get_json_key_value_error ()
string path = config::logic::google_translate_json_key_path ();

if (!file_or_dir_exists (path)) {
return { string(), "Cannot find the JSON key to access Google Translate. Looking for this file: " + path };
return { std::string(), "Cannot find the JSON key to access Google Translate. Looking for this file: " + path };
}

string error;
Expand Down
2 changes: 1 addition & 1 deletion filter/url.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ string filter_url_dirname_internal (string url, const char * separator)
}
size_t pos = url.find_last_of (separator);
if (pos != std::string::npos) url = url.substr (0, pos);
else url = string();
else url = std::string();
}
if (url.empty ()) url = ".";
return url;
Expand Down
2 changes: 1 addition & 1 deletion mimetic098/contenttype.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ using namespace std;
const char ContentType::label[] = "Content-Type";

int ContentType::Boundary::ms_i = 0;
string ContentType::Boundary::ms_common_boundary = string();
string ContentType::Boundary::ms_common_boundary = std::string();


ContentType::Boundary::Boundary()
Expand Down
2 changes: 1 addition & 1 deletion mimetic098/utils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct Int
return m_i;
}

operator string() const
operator std::string() const
{
return m_si;
}
Expand Down
2 changes: 1 addition & 1 deletion pugixml/pugixml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9599,7 +9599,7 @@ PUGI__NS_BEGIN
ast_func_namespace_uri_1, // namespace-uri(left)
ast_func_name_0, // name()
ast_func_name_1, // name(left)
ast_func_string_0, // string()
ast_func_string_0, // std::string()
ast_func_string_1, // string(left)
ast_func_concat, // concat(left, right, siblings)
ast_func_starts_with, // starts_with(left, right)
Expand Down
2 changes: 1 addition & 1 deletion resource/external.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ string gbs_plus_processor (string url, int book, [[maybe_unused]] int chapter, i
post ["slug_id"] = bits[11];
post ["book_id"] = filter::strings::convert_to_string(book);
string error {};
string annotation_html {filter_url_http_post (annotation_url, string(), post, error, false, false, {})};
string annotation_html {filter_url_http_post (annotation_url, std::string(), post, error, false, false, {})};
if (error.empty()) {
annotation_html = filter::strings::fix_invalid_html_gumbo (annotation_html);
pugi::xml_document annotation_document {};
Expand Down
4 changes: 2 additions & 2 deletions resource/select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ string resource_select (Webserver_Request& webserver_request)
// One of those properties is the title.
// This selection mechanism here shows that title only.
if (webserver_request.query.count ("comparative")) {
Dialog_List dialog_list = Dialog_List (caller, translate("Select a Comparative resource"), disconnected_info, string(), true);
Dialog_List dialog_list = Dialog_List (caller, translate("Select a Comparative resource"), disconnected_info, std::string(), true);
dialog_list.add_query ("page", webserver_request.query["page"]);
if (is_def) dialog_list.add_query ("type", webserver_request.query["type"]);
std::vector <std::string> resources;
Expand Down Expand Up @@ -266,7 +266,7 @@ string resource_select (Webserver_Request& webserver_request)
// One of those properties is the title.
// This selection mechanism here shows that title only.
if (webserver_request.query.count ("translated")) {
Dialog_List dialog_list = Dialog_List (caller, translate("Select a Translated resource"), disconnected_info, string(), true);
Dialog_List dialog_list = Dialog_List (caller, translate("Select a Translated resource"), disconnected_info, std::string(), true);
dialog_list.add_query ("page", webserver_request.query["page"]);
if (is_def) dialog_list.add_query ("type", webserver_request.query["type"]);
std::vector <std::string> resources;
Expand Down
6 changes: 3 additions & 3 deletions resource/translated1edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ string resource_translated1edit (Webserver_Request& webserver_request)
if (webserver_request.query.count ("original")) {
string value = webserver_request.query["original"];
if (value.empty()) {
Dialog_List dialog_list = Dialog_List ("translated1edit", translate("Select a resource to be used as the original resource"), translate ("The original resource will be translated from the source language to the target language."), string());
Dialog_List dialog_list = Dialog_List ("translated1edit", translate("Select a resource to be used as the original resource"), translate ("The original resource will be translated from the source language to the target language."), std::string());
dialog_list.add_query ("name", name);
std::vector <std::string> resources = resource_logic_get_names (webserver_request, true);
for (const auto & resource : resources) {
Expand All @@ -115,7 +115,7 @@ string resource_translated1edit (Webserver_Request& webserver_request)
if (webserver_request.query.count ("source")) {
string value = webserver_request.query["source"];
if (value.empty()) {
Dialog_List dialog_list = Dialog_List ("translated1edit", translate("Select the language of the original resource"), translate ("The language the original resource is written in."), string());
Dialog_List dialog_list = Dialog_List ("translated1edit", translate("Select the language of the original resource"), translate ("The language the original resource is written in."), std::string());
dialog_list.add_query ("name", name);
std::vector <std::pair <string, std::string> > languages = filter::google::get_languages ("en");
for (const auto & language : languages) {
Expand All @@ -134,7 +134,7 @@ string resource_translated1edit (Webserver_Request& webserver_request)
if (webserver_request.query.count ("target")) {
string value = webserver_request.query["target"];
if (value.empty()) {
Dialog_List dialog_list = Dialog_List ("translated1edit", translate("Select the language to translate the resource into"), translate ("The language the resource will be translated into."), string());
Dialog_List dialog_list = Dialog_List ("translated1edit", translate("Select the language to translate the resource into"), translate ("The language the resource will be translated into."), std::string());
dialog_list.add_query ("name", name);
std::vector <std::pair <string, std::string> > languages = filter::google::get_languages ("en");
for (const auto & language : languages) {
Expand Down
2 changes: 1 addition & 1 deletion sources/abbott-smith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void sources_abbott_smith_parse_entry_element (Database_AbbottSmith * database_a

// If there's more Strong's numbers in the entry, store those too, but without any lemma.
for (auto strong2 : strongs) {
database_abbottsmith->store (string(), string(), strong2, contents);
database_abbottsmith->store (string(), std::string(), strong2, contents);
}
}

Expand Down
2 changes: 1 addition & 1 deletion statistics/statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void statistics_statistics ()

size_t change_notificatons_count = 0;
if (webserver_request.database_config_user()->getUserPendingChangesNotification (user)) {
string any_bible = string();
string any_bible = std::string();
std::vector <int> ids = database_modifications.getNotificationIdentifiers (user, any_bible);
change_notificatons_count = ids.size();
body << "<p><a href=" << quoted (siteUrl + changes_changes_url ()) << ">" << translate("Number of change notifications") << "</a>: " << ids.size() << "</p>" << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion styles/indexm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ string styles_indexm (Webserver_Request& webserver_request)
}
}
if (webserver_request.query.count ("new")) {
Dialog_Entry dialog_entry = Dialog_Entry ("indexm", translate("Please enter the name for the new stylesheet"), string(), "new", string());
Dialog_Entry dialog_entry = Dialog_Entry ("indexm", translate("Please enter the name for the new stylesheet"), std::string(), "new", std::string());
page += dialog_entry.run();
return page;
}
Expand Down
4 changes: 2 additions & 2 deletions styles/sheets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ void Styles_Sheets::recreate ()
std::vector <std::string> stylesheets = database_styles.getSheets ();
for (const auto & stylesheet : stylesheets) {
string path = get_location (stylesheet, false);
create (stylesheet, path, false, string());
create (stylesheet, path, false, std::string());
path = get_location (stylesheet, true);
create (stylesheet, path, true, string());
create (stylesheet, path, true, std::string());
}
}

Expand Down
Loading

0 comments on commit fcaeebb

Please sign in to comment.