Skip to content

Commit

Permalink
Move to snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
teusbenschop committed May 25, 2024
1 parent 024613a commit 639fae8
Show file tree
Hide file tree
Showing 88 changed files with 785 additions and 781 deletions.
4 changes: 2 additions & 2 deletions assets/header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void Assets_Header::set_navigator ()
void Assets_Header::set_stylesheet ()
{
const std::string bible = m_webserver_request.database_config_user()->getBible ();
const std::string stylesheet = database::config::bible::getEditorStylesheet (bible);
const std::string stylesheet = database::config::bible::get_editor_stylesheet (bible);
m_included_stylesheet = std::move(stylesheet);
}

Expand All @@ -85,7 +85,7 @@ void Assets_Header::set_stylesheet ()
void Assets_Header::set_editor_stylesheet ()
{
const std::string bible = m_webserver_request.database_config_user()->getBible ();
const std::string stylesheet = database::config::bible::getEditorStylesheet (bible);
const std::string stylesheet = database::config::bible::get_editor_stylesheet (bible);
m_included_editor_stylesheet = std::move(stylesheet);
}

Expand Down
18 changes: 9 additions & 9 deletions bb/css.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ std::string bible_css (Webserver_Request& webserver_request)
font = filter::strings::trim (font);
#ifdef HAVE_CLIENT
// Bibledit client storage.
database::config::bible::setTextFontClient (bible, font);
database::config::bible::set_text_font_client (bible, font);
#else
// Bibledit Cloud storage.
database::config::bible::setTextFont (bible, font);
database::config::bible::set_text_font (bible, font);
#endif

const std::string s_direction = webserver_request.post ["direction"];
Expand All @@ -80,17 +80,17 @@ std::string bible_css (Webserver_Request& webserver_request)
const std::string s_mode = webserver_request.post ["mode"];
const int i_mode = Filter_Css::writingModeValue (s_mode);

database::config::bible::setTextDirection (bible, i_mode * 10 + i_direction);
database::config::bible::set_text_direction (bible, i_mode * 10 + i_direction);

int lineheight = filter::strings::convert_to_int (webserver_request.post["lineheight"]);
if (lineheight < 50) lineheight = 50;
if (lineheight > 300) lineheight = 300;
database::config::bible::setLineHeight (bible, lineheight);
database::config::bible::set_line_height (bible, lineheight);

float letterspacing = filter::strings::convert_to_float (webserver_request.post["letterspacing"]);
if (letterspacing < -3) letterspacing = -3;
if (letterspacing > 3) letterspacing = 3;
database::config::bible::setLetterSpacing (bible, static_cast<int>(10 * letterspacing));
database::config::bible::set_letter_spacing (bible, static_cast<int>(10 * letterspacing));

page += assets_page::success ("The information was saved.");
}
Expand All @@ -102,7 +102,7 @@ std::string bible_css (Webserver_Request& webserver_request)
const std::string font = fonts::logic::get_text_font (bible);
view.set_variable ("font", font);

const int direction = database::config::bible::getTextDirection (bible);
const int direction = database::config::bible::get_text_direction (bible);

view.set_variable ("direction_none", Filter_Css::directionUnspecified (direction));
view.set_variable ("direction_ltr", Filter_Css::directionLeftToRight (direction));
Expand All @@ -114,10 +114,10 @@ std::string bible_css (Webserver_Request& webserver_request)
view.set_variable ("mode_btlr", Filter_Css::writingModeBottomTopLeftRight (direction));
view.set_variable ("mode_btrl", Filter_Css::writingModeBottomTopRightLeft (direction));

const int lineheight = database::config::bible::getLineHeight (bible);
const int lineheight = database::config::bible::get_line_height (bible);
view.set_variable ("lineheight", filter::strings::convert_to_string (lineheight));

float letterspacing = static_cast<float> (database::config::bible::getLetterSpacing (bible));
float letterspacing = static_cast<float> (database::config::bible::get_letter_spacing (bible));
letterspacing /= 10;
view.set_variable ("letterspacing", filter::strings::convert_to_string (letterspacing));

Expand All @@ -126,7 +126,7 @@ std::string bible_css (Webserver_Request& webserver_request)
const std::string custom_css = Filter_Css::get_css (custom_class,
fonts::logic::get_font_path (font), direction,
lineheight,
database::config::bible::getLetterSpacing (bible));
database::config::bible::get_letter_spacing (bible));
view.set_variable ("custom_css", custom_css);

page += view.render ("bb", "css");
Expand Down
2 changes: 1 addition & 1 deletion bb/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void bible_logic::log_change (const std::string& bible,
const std::string bookname = database::books::get_english_from_id (static_cast<book_id>(book));
const std::string passage = bible + " " + bookname + " " + filter::strings::convert_to_string (chapter);

const std::string stylesheet = database::config::bible::getExportStylesheet (bible);
const std::string stylesheet = database::config::bible::get_export_stylesheet (bible);

const std::vector <int> existing_verse_numbers = filter::usfm::get_verse_numbers (existing_usfm);
const std::vector <int> verse_numbers = filter::usfm::get_verse_numbers (usfm);
Expand Down
8 changes: 4 additions & 4 deletions bb/order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ std::string bible_order (Webserver_Request& webserver_request)
std::vector <std::string> v_book_order {};
for (const auto book : interspersed) v_book_order.push_back (filter::strings::convert_to_string (static_cast<int>(book)));
const std::string s_book_order = filter::strings::implode (v_book_order, " ");
database::config::bible::setBookOrder (bible, s_book_order);
database::config::bible::set_book_order (bible, s_book_order);
}


Expand Down Expand Up @@ -176,13 +176,13 @@ std::string bible_order (Webserver_Request& webserver_request)
std::vector <std::string> v_book_order {};
for (const auto book : interspersed) v_book_order.push_back (filter::strings::convert_to_string (static_cast<int>(book)));
const std::string s_book_order = filter::strings::implode (v_book_order, " ");
database::config::bible::setBookOrder (bible, s_book_order);
database::config::bible::set_book_order (bible, s_book_order);
}


// Deuterocanonicals or Apocrypha at the end of the entire Bible.
if (order == "end") {
database::config::bible::setBookOrder (bible, std::string());
database::config::bible::set_book_order (bible, std::string());
}

// Handle updates to the custom book order.
Expand All @@ -196,7 +196,7 @@ std::string bible_order (Webserver_Request& webserver_request)
s_books.push_back (filter::strings::convert_to_string (book));
filter::strings::array_move_up_down (s_books, move, !moveup.empty ());
const std::string s_order = filter::strings::implode (s_books, " ");
database::config::bible::setBookOrder (bible, s_order);
database::config::bible::set_book_order (bible, s_order);
}

const std::vector <int> books = filter_passage_get_ordered_books (bible);
Expand Down
24 changes: 12 additions & 12 deletions bb/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ std::string bible_settings (Webserver_Request& webserver_request)
page += dialog_list.run ();
return page;
} else {
if (write_access) database::config::bible::setVersificationSystem (bible, versification);
if (write_access) database::config::bible::set_versification_system (bible, versification);
}
}
const std::string versification = database::config::bible::getVersificationSystem (bible);
const std::string versification = database::config::bible::get_versification_system (bible);
view.set_variable ("versification", versification);


Expand Down Expand Up @@ -228,21 +228,21 @@ std::string bible_settings (Webserver_Request& webserver_request)

// Public feedback.
if (checkbox == "public") {
if (write_access) database::config::bible::setPublicFeedbackEnabled (bible, checked);
if (write_access) database::config::bible::set_public_feedback_enabled (bible, checked);
}
view.set_variable ("public", filter::strings::get_checkbox_status (database::config::bible::getPublicFeedbackEnabled (bible)));
view.set_variable ("public", filter::strings::get_checkbox_status (database::config::bible::get_public_feedback_enabled (bible)));



// RSS feed.
#ifdef HAVE_CLOUD
if (checkbox == "rss") {
if (write_access) {
database::config::bible::setSendChangesToRSS (bible, checked);
database::config::bible::set_send_changes_to_rss (bible, checked);
rss_logic_feed_on_off ();
}
}
view.set_variable ("rss", filter::strings::get_checkbox_status (database::config::bible::getSendChangesToRSS (bible)));
view.set_variable ("rss", filter::strings::get_checkbox_status (database::config::bible::get_send_changes_to_rss (bible)));
#endif


Expand All @@ -260,10 +260,10 @@ std::string bible_settings (Webserver_Request& webserver_request)
page += dialog_list.run ();
return page;
} else {
if (write_access) database::config::bible::setEditorStylesheet (bible, stylesheet);
if (write_access) database::config::bible::set_editor_stylesheet (bible, stylesheet);
}
}
std::string stylesheet = database::config::bible::getEditorStylesheet (bible);
std::string stylesheet = database::config::bible::get_editor_stylesheet (bible);
view.set_variable ("stylesheetediting", stylesheet);


Expand All @@ -281,26 +281,26 @@ std::string bible_settings (Webserver_Request& webserver_request)
page += dialog_list.run ();
return page;
} else {
if (write_access) database::config::bible::setExportStylesheet (bible, export_stylesheet);
if (write_access) database::config::bible::set_export_stylesheet (bible, export_stylesheet);
}
}
stylesheet = database::config::bible::getExportStylesheet (bible);
stylesheet = database::config::bible::get_export_stylesheet (bible);
view.set_variable ("stylesheetexport", stylesheet);


// Automatic daily checks on text.
#ifdef HAVE_CLOUD
if (checkbox == "checks") {
if (write_access) {
database::config::bible::setDailyChecksEnabled (bible, checked);
database::config::bible::set_daily_checks_enabled (bible, checked);
if (!checked) {
// If checking is switched off, also remove any existing checking results for this Bible.
Database_Check database_check;
database_check.truncateOutput(bible);
}
}
}
view.set_variable ("checks", filter::strings::get_checkbox_status (database::config::bible::getDailyChecksEnabled (bible)));
view.set_variable ("checks", filter::strings::get_checkbox_status (database::config::bible::get_daily_checks_enabled (bible)));
#endif


Expand Down
2 changes: 1 addition & 1 deletion book/create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool book_create (const std::string & bible, const book_id book, const int chapt


// Subsequent chapters.
const std::string versification = database::config::bible::getVersificationSystem (bible);
const std::string versification = database::config::bible::get_versification_system (bible);
const std::vector <Passage> versification_data = database_versifications.getBooksChaptersVerses (versification);
for (const auto& row : versification_data) {
if (book == static_cast<book_id>(row.m_book)) {
Expand Down
4 changes: 2 additions & 2 deletions changes/modifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void changes_process_identifiers (Webserver_Request& webserver_request,
{
if (oldId != 0) {
Database_Modifications database_modifications {};
const std::string stylesheet = database::config::bible::getExportStylesheet (bible);
const std::string stylesheet = database::config::bible::get_export_stylesheet (bible);
Database_Modifications_Text old_chapter_text = database_modifications.getUserChapter (user, bible, book, chapter, oldId);
const std::string old_chapter_usfm = old_chapter_text.oldtext;
Database_Modifications_Text new_chapter_text = database_modifications.getUserChapter (user, bible, book, chapter, newId);
Expand Down Expand Up @@ -279,7 +279,7 @@ void changes_modifications ()
for (const auto & bible : bibles) {


const std::string stylesheet = database::config::bible::getExportStylesheet (bible);
const std::string stylesheet = database::config::bible::get_export_stylesheet (bible);


std::vector <std::string> changeNotificationUsers;
Expand Down
2 changes: 1 addition & 1 deletion checks/logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void checks_logic_start_all ()
Database_Bibles database_bibles {};
const std::vector <std::string>& bibles = database_bibles.get_bibles ();
for (const auto& bible : bibles) {
const bool enabled = database::config::bible::getDailyChecksEnabled (bible);
const bool enabled = database::config::bible::get_daily_checks_enabled (bible);
if (enabled) checks_logic_start (bible);
}
}
Expand Down
54 changes: 27 additions & 27 deletions checks/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,38 +66,38 @@ void checks_run (std::string bible)
database_check.truncateOutput (bible);


const std::string stylesheet = database::config::bible::getExportStylesheet (bible);
const std::string stylesheet = database::config::bible::get_export_stylesheet (bible);


bool check_double_spaces_usfm = database::config::bible::getCheckDoubleSpacesUsfm (bible);
bool check_full_stop_in_headings = database::config::bible::getCheckFullStopInHeadings (bible);
bool check_space_before_punctuation = database::config::bible::getCheckSpaceBeforePunctuation (bible);
bool check_space_before_final_note_marker = database::config::bible::getCheckSpaceBeforeFinalNoteMarker (bible);
bool check_sentence_structure = database::config::bible::getCheckSentenceStructure (bible);
bool check_paragraph_structure = database::config::bible::getCheckParagraphStructure (bible);
bool check_double_spaces_usfm = database::config::bible::get_check_double_spaces_usfm (bible);
bool check_full_stop_in_headings = database::config::bible::get_check_full_stop_in_headings (bible);
bool check_space_before_punctuation = database::config::bible::get_check_space_before_punctuation (bible);
bool check_space_before_final_note_marker = database::config::bible::get_check_space_before_final_note_marker (bible);
bool check_sentence_structure = database::config::bible::get_check_sentence_structure (bible);
bool check_paragraph_structure = database::config::bible::get_check_paragraph_structure (bible);
Checks_Sentences checks_sentences;
checks_sentences.enter_capitals (database::config::bible::getSentenceStructureCapitals (bible));
checks_sentences.enter_small_letters (database::config::bible::getSentenceStructureSmallLetters (bible));
std::string end_marks = database::config::bible::getSentenceStructureEndPunctuation (bible);
checks_sentences.enter_capitals (database::config::bible::get_sentence_structure_capitals (bible));
checks_sentences.enter_small_letters (database::config::bible::get_sentence_structure_small_letters (bible));
std::string end_marks = database::config::bible::get_sentence_structure_end_punctuation (bible);
checks_sentences.enter_end_marks (end_marks);
std::string center_marks = database::config::bible::getSentenceStructureMiddlePunctuation (bible);
std::string center_marks = database::config::bible::get_sentence_structure_middle_punctuation (bible);
checks_sentences.enter_center_marks (center_marks);
std::string disregards = database::config::bible::getSentenceStructureDisregards (bible);
std::string disregards = database::config::bible::get_sentence_structure_disregards (bible);
checks_sentences.enter_disregards (disregards);
checks_sentences.enter_names (database::config::bible::getSentenceStructureNames (bible));
std::vector <std::string> within_sentence_paragraph_markers = filter::strings::explode (database::config::bible::getSentenceStructureWithinSentenceMarkers (bible), ' ');
bool check_books_versification = database::config::bible::getCheckBooksVersification (bible);
bool check_chapters_verses_versification = database::config::bible::getCheckChaptesVersesVersification (bible);
bool check_well_formed_usfm = database::config::bible::getCheckWellFormedUsfm (bible);
checks_sentences.enter_names (database::config::bible::get_sentence_structure_names (bible));
std::vector <std::string> within_sentence_paragraph_markers = filter::strings::explode (database::config::bible::get_sentence_structure_within_sentence_markers (bible), ' ');
bool check_books_versification = database::config::bible::get_check_books_versification (bible);
bool check_chapters_verses_versification = database::config::bible::get_check_chaptes_verses_versification (bible);
bool check_well_formed_usfm = database::config::bible::get_check_well_formed_usfm (bible);
Checks_Usfm checks_usfm = Checks_Usfm (bible);
bool check_missing_punctuation_end_verse = database::config::bible::getCheckMissingPunctuationEndVerse (bible);
bool check_patterns = database::config::bible::getCheckPatterns (bible);
std::string s_checking_patterns = database::config::bible::getCheckingPatterns (bible);
bool check_missing_punctuation_end_verse = database::config::bible::get_check_missing_punctuation_end_verse (bible);
bool check_patterns = database::config::bible::get_check_patterns (bible);
std::string s_checking_patterns = database::config::bible::get_checking_patterns (bible);
std::vector <std::string> checking_patterns = filter::strings::explode (s_checking_patterns, '\n');
bool check_matching_pairs = database::config::bible::getCheckMatchingPairs (bible);
bool check_matching_pairs = database::config::bible::get_check_matching_pairs (bible);
std::vector <std::pair <std::string, std::string> > matching_pairs;
{
const std::string fragment = database::config::bible::getMatchingPairs (bible);
const std::string fragment = database::config::bible::get_matching_pairs (bible);
std::vector <std::string> pairs = filter::strings::explode (fragment, ' ');
for (auto& pair : pairs) {
pair = filter::strings::trim (pair);
Expand All @@ -109,11 +109,11 @@ void checks_run (std::string bible)
}
}
}
bool check_space_end_verse = database::config::bible::getCheckSpaceEndVerse (bible);
bool check_french_punctuation = database::config::bible::getCheckFrenchPunctuation (bible);
bool check_french_citation_style = database::config::bible::getCheckFrenchCitationStyle (bible);
bool transpose_fix_space_in_notes = database::config::bible::getTransposeFixSpacesNotes (bible);
bool check_valid_utf8_text = database::config::bible::getCheckValidUTF8Text (bible);
bool check_space_end_verse = database::config::bible::get_check_space_end_verse (bible);
bool check_french_punctuation = database::config::bible::get_check_french_punctuation (bible);
bool check_french_citation_style = database::config::bible::get_check_french_citation_style (bible);
bool transpose_fix_space_in_notes = database::config::bible::get_transpose_fix_spaces_notes (bible);
bool check_valid_utf8_text = database::config::bible::get_check_valid_utf8_text (bible);


const std::vector <int> books = webserver_request.database_bibles()->get_books (bible);
Expand Down
Loading

0 comments on commit 639fae8

Please sign in to comment.