From e466196c1ac5809a1d5c38f8d853e1d81d24c712 Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Fri, 21 Apr 2023 22:45:16 -0700 Subject: [PATCH] Adds UTF-8 BOM to all C++ files. --- sbf-cpp/Abilities.cpp | 2 +- sbf-cpp/Abilities.h | 2 +- sbf-cpp/Abilities_test.cpp | 2 +- sbf-cpp/Archetypes.cpp | 2 +- sbf-cpp/Archetypes.h | 2 +- sbf-cpp/Archetypes_test.cpp | 2 +- sbf-cpp/Attributes.cpp | 2 +- sbf-cpp/Attributes.h | 2 +- sbf-cpp/Attributes_test.cpp | 2 +- sbf-cpp/Backgrounds.cpp | 2 +- sbf-cpp/Backgrounds.h | 2 +- sbf-cpp/Backgrounds_test.cpp | 2 +- sbf-cpp/Character.cpp | 2 +- sbf-cpp/Character.h | 2 +- sbf-cpp/Character_test.cpp | 2 +- sbf-cpp/Clans.cpp | 2 +- sbf-cpp/Clans.h | 2 +- sbf-cpp/Clans_test.cpp | 2 +- sbf-cpp/Colors.cpp | 2 +- sbf-cpp/Colors.h | 2 +- sbf-cpp/Colors_test.cpp | 2 +- sbf-cpp/Derangements.cpp | 2 +- sbf-cpp/Derangements.h | 2 +- sbf-cpp/Derangements_test.cpp | 2 +- sbf-cpp/Disciplines.cpp | 2 +- sbf-cpp/Disciplines.h | 2 +- sbf-cpp/Disciplines_test.cpp | 2 +- sbf-cpp/Freebies._test.cpp | 0 sbf-cpp/Freebies.cpp | 0 sbf-cpp/Freebies.h | 15 ++++++++ sbf-cpp/Genders.cpp | 2 +- sbf-cpp/Genders.h | 2 +- sbf-cpp/Genders_test.cpp | 2 +- sbf-cpp/Menus.cpp | 2 +- sbf-cpp/Menus.h | 2 +- sbf-cpp/Ranks.cpp | 2 +- sbf-cpp/Ranks.h | 2 +- sbf-cpp/Ranks_test.cpp | 2 +- sbf-cpp/Utils.cpp | 2 +- sbf-cpp/Utils.h | 2 +- sbf-cpp/Utils_test.cpp | 2 +- sbf-cpp/Virtues.cpp | 2 +- sbf-cpp/Virtues.h | 2 +- sbf-cpp/Virtues_test.cpp | 2 +- sbf-cpp/main.cpp | 2 +- sbf-cpp/main.h | 2 +- sbf-cpp/sbf.cpp | 68 ----------------------------------- 47 files changed, 58 insertions(+), 111 deletions(-) create mode 100644 sbf-cpp/Freebies._test.cpp create mode 100644 sbf-cpp/Freebies.cpp create mode 100644 sbf-cpp/Freebies.h diff --git a/sbf-cpp/Abilities.cpp b/sbf-cpp/Abilities.cpp index 4fbaf1a..93cf3db 100644 --- a/sbf-cpp/Abilities.cpp +++ b/sbf-cpp/Abilities.cpp @@ -1,4 +1,4 @@ -#include "Abilities.h" +#include "Abilities.h" #include #include diff --git a/sbf-cpp/Abilities.h b/sbf-cpp/Abilities.h index 9cd1a8f..4a9b799 100644 --- a/sbf-cpp/Abilities.h +++ b/sbf-cpp/Abilities.h @@ -1,4 +1,4 @@ -#ifndef ABILITIES_H__ +#ifndef ABILITIES_H__ #define ABILITIES_H__ /*************************************************************************************** * @file Abilities.h diff --git a/sbf-cpp/Abilities_test.cpp b/sbf-cpp/Abilities_test.cpp index 735c96f..037428a 100644 --- a/sbf-cpp/Abilities_test.cpp +++ b/sbf-cpp/Abilities_test.cpp @@ -1,4 +1,4 @@ -#include "Abilities.h" +#include "Abilities.h" #include #include diff --git a/sbf-cpp/Archetypes.cpp b/sbf-cpp/Archetypes.cpp index bc92779..1986c91 100644 --- a/sbf-cpp/Archetypes.cpp +++ b/sbf-cpp/Archetypes.cpp @@ -1,4 +1,4 @@ -#include "Archetypes.h" +#include "Archetypes.h" #include #include diff --git a/sbf-cpp/Archetypes.h b/sbf-cpp/Archetypes.h index 8e263d9..a9f7a79 100644 --- a/sbf-cpp/Archetypes.h +++ b/sbf-cpp/Archetypes.h @@ -1,4 +1,4 @@ -#ifndef ARCHETYPES_H__ +#ifndef ARCHETYPES_H__ #define ARCHETYPES_H__ /*************************************************************************************** * @file Archetypes.h diff --git a/sbf-cpp/Archetypes_test.cpp b/sbf-cpp/Archetypes_test.cpp index 0c05fa3..a14316d 100644 --- a/sbf-cpp/Archetypes_test.cpp +++ b/sbf-cpp/Archetypes_test.cpp @@ -1,4 +1,4 @@ -#include "Archetypes.h" +#include "Archetypes.h" #include #include diff --git a/sbf-cpp/Attributes.cpp b/sbf-cpp/Attributes.cpp index 4ad6604..1e2de44 100644 --- a/sbf-cpp/Attributes.cpp +++ b/sbf-cpp/Attributes.cpp @@ -1,4 +1,4 @@ -#include "Attributes.h" +#include "Attributes.h" #include #include diff --git a/sbf-cpp/Attributes.h b/sbf-cpp/Attributes.h index 147a75d..13da2b0 100644 --- a/sbf-cpp/Attributes.h +++ b/sbf-cpp/Attributes.h @@ -1,4 +1,4 @@ -#ifndef ATTRIBUTES_H__ +#ifndef ATTRIBUTES_H__ #define ATTRIBUTES_H__ /*************************************************************************************** * @file Attributes.h diff --git a/sbf-cpp/Attributes_test.cpp b/sbf-cpp/Attributes_test.cpp index dd0b918..8551566 100644 --- a/sbf-cpp/Attributes_test.cpp +++ b/sbf-cpp/Attributes_test.cpp @@ -1,4 +1,4 @@ -#include "Attributes.h" +#include "Attributes.h" #include #include diff --git a/sbf-cpp/Backgrounds.cpp b/sbf-cpp/Backgrounds.cpp index 8c2930b..e97e1f3 100644 --- a/sbf-cpp/Backgrounds.cpp +++ b/sbf-cpp/Backgrounds.cpp @@ -1,4 +1,4 @@ -#include "Backgrounds.h" +#include "Backgrounds.h" #include #include diff --git a/sbf-cpp/Backgrounds.h b/sbf-cpp/Backgrounds.h index 30fb389..17761dc 100644 --- a/sbf-cpp/Backgrounds.h +++ b/sbf-cpp/Backgrounds.h @@ -1,4 +1,4 @@ -#ifndef BACKGROUNDS_H__ +#ifndef BACKGROUNDS_H__ #define BACKGROUNDS_H__ /*************************************************************************************** * @file Backgrounds.h diff --git a/sbf-cpp/Backgrounds_test.cpp b/sbf-cpp/Backgrounds_test.cpp index 49f11eb..eaa545a 100644 --- a/sbf-cpp/Backgrounds_test.cpp +++ b/sbf-cpp/Backgrounds_test.cpp @@ -1,4 +1,4 @@ -#include "Backgrounds.h" +#include "Backgrounds.h" #include #include diff --git a/sbf-cpp/Character.cpp b/sbf-cpp/Character.cpp index c46cfcc..4057106 100644 --- a/sbf-cpp/Character.cpp +++ b/sbf-cpp/Character.cpp @@ -1,4 +1,4 @@ -#include "Character.h" +#include "Character.h" namespace SBF { diff --git a/sbf-cpp/Character.h b/sbf-cpp/Character.h index a851aad..92ee0e6 100644 --- a/sbf-cpp/Character.h +++ b/sbf-cpp/Character.h @@ -1,4 +1,4 @@ -#ifndef CHARACTER_H__ +#ifndef CHARACTER_H__ #define CHARACTER_H__ /*************************************************************************************** * @file Character.h diff --git a/sbf-cpp/Character_test.cpp b/sbf-cpp/Character_test.cpp index ecf6eb6..038a894 100644 --- a/sbf-cpp/Character_test.cpp +++ b/sbf-cpp/Character_test.cpp @@ -1,4 +1,4 @@ -#include "Character.h" +#include "Character.h" #include "test.h" using namespace SBF; diff --git a/sbf-cpp/Clans.cpp b/sbf-cpp/Clans.cpp index 7a42b85..3edd4fb 100644 --- a/sbf-cpp/Clans.cpp +++ b/sbf-cpp/Clans.cpp @@ -1,4 +1,4 @@ -#include "Clans.h" +#include "Clans.h" #include #include diff --git a/sbf-cpp/Clans.h b/sbf-cpp/Clans.h index 0248c6d..231b5c8 100644 --- a/sbf-cpp/Clans.h +++ b/sbf-cpp/Clans.h @@ -1,4 +1,4 @@ -#ifndef CLANS_H__ +#ifndef CLANS_H__ #define CLANS_H__ /*************************************************************************************** * @file Clans.h diff --git a/sbf-cpp/Clans_test.cpp b/sbf-cpp/Clans_test.cpp index 8cb6596..05042b3 100644 --- a/sbf-cpp/Clans_test.cpp +++ b/sbf-cpp/Clans_test.cpp @@ -1,4 +1,4 @@ -#include "Clans.h" +#include "Clans.h" #include #include diff --git a/sbf-cpp/Colors.cpp b/sbf-cpp/Colors.cpp index 7ca6002..19e75ff 100644 --- a/sbf-cpp/Colors.cpp +++ b/sbf-cpp/Colors.cpp @@ -1,4 +1,4 @@ -#include "Colors.h" +#include "Colors.h" namespace SBF { diff --git a/sbf-cpp/Colors.h b/sbf-cpp/Colors.h index 8230956..5bee3d7 100644 --- a/sbf-cpp/Colors.h +++ b/sbf-cpp/Colors.h @@ -1,4 +1,4 @@ -#ifndef COLORS_H__ +#ifndef COLORS_H__ #define COLORS_H__ /*************************************************************************************** * @file Colors.h diff --git a/sbf-cpp/Colors_test.cpp b/sbf-cpp/Colors_test.cpp index c16394d..e39a127 100644 --- a/sbf-cpp/Colors_test.cpp +++ b/sbf-cpp/Colors_test.cpp @@ -1,4 +1,4 @@ -#include "Colors.h" +#include "Colors.h" #include #include diff --git a/sbf-cpp/Derangements.cpp b/sbf-cpp/Derangements.cpp index a64f274..5d87de1 100644 --- a/sbf-cpp/Derangements.cpp +++ b/sbf-cpp/Derangements.cpp @@ -1,4 +1,4 @@ -#include "Derangements.h" +#include "Derangements.h" #include #include diff --git a/sbf-cpp/Derangements.h b/sbf-cpp/Derangements.h index ebf33eb..cd23a6b 100644 --- a/sbf-cpp/Derangements.h +++ b/sbf-cpp/Derangements.h @@ -1,4 +1,4 @@ -#ifndef DERANGEMENTS_H__ +#ifndef DERANGEMENTS_H__ #define DERANGEMENTS_H__ #include "Colors.h" /*************************************************************************************** diff --git a/sbf-cpp/Derangements_test.cpp b/sbf-cpp/Derangements_test.cpp index a17248e..8521b2b 100644 --- a/sbf-cpp/Derangements_test.cpp +++ b/sbf-cpp/Derangements_test.cpp @@ -1,4 +1,4 @@ -#include "Derangements.h" +#include "Derangements.h" #include #include diff --git a/sbf-cpp/Disciplines.cpp b/sbf-cpp/Disciplines.cpp index 19a4443..2aecd78 100644 --- a/sbf-cpp/Disciplines.cpp +++ b/sbf-cpp/Disciplines.cpp @@ -1,4 +1,4 @@ -#include "Disciplines.h" +#include "Disciplines.h" #include #include diff --git a/sbf-cpp/Disciplines.h b/sbf-cpp/Disciplines.h index e170b74..1bbad70 100644 --- a/sbf-cpp/Disciplines.h +++ b/sbf-cpp/Disciplines.h @@ -1,4 +1,4 @@ -#ifndef DISCIPLINES_H__ +#ifndef DISCIPLINES_H__ #define DISCIPLINES_H__ /*************************************************************************************** * @file Disciplines.h diff --git a/sbf-cpp/Disciplines_test.cpp b/sbf-cpp/Disciplines_test.cpp index 24c30ef..1626838 100644 --- a/sbf-cpp/Disciplines_test.cpp +++ b/sbf-cpp/Disciplines_test.cpp @@ -1,4 +1,4 @@ -#include "Disciplines.h" +#include "Disciplines.h" #include #include diff --git a/sbf-cpp/Freebies._test.cpp b/sbf-cpp/Freebies._test.cpp new file mode 100644 index 0000000..e69de29 diff --git a/sbf-cpp/Freebies.cpp b/sbf-cpp/Freebies.cpp new file mode 100644 index 0000000..e69de29 diff --git a/sbf-cpp/Freebies.h b/sbf-cpp/Freebies.h new file mode 100644 index 0000000..0a04275 --- /dev/null +++ b/sbf-cpp/Freebies.h @@ -0,0 +1,15 @@ +#ifndef FREEBIES_H__ +#define FREEBIES_H__ + +#include + +namespace SBF { +struct FreebieType { + int id; + int cost; + std::string name; + std::string label; +}; +} // End namespace SBF + +#endif diff --git a/sbf-cpp/Genders.cpp b/sbf-cpp/Genders.cpp index 885c6db..b295140 100644 --- a/sbf-cpp/Genders.cpp +++ b/sbf-cpp/Genders.cpp @@ -1,4 +1,4 @@ -#include "Genders.h" +#include "Genders.h" #include #include diff --git a/sbf-cpp/Genders.h b/sbf-cpp/Genders.h index e713dd9..b3cc266 100644 --- a/sbf-cpp/Genders.h +++ b/sbf-cpp/Genders.h @@ -1,4 +1,4 @@ -#ifndef GENDERS_H__ +#ifndef GENDERS_H__ #define GENDERS_H__ /*************************************************************************************** * @file Genders.h diff --git a/sbf-cpp/Genders_test.cpp b/sbf-cpp/Genders_test.cpp index dd2dd06..8237dc8 100644 --- a/sbf-cpp/Genders_test.cpp +++ b/sbf-cpp/Genders_test.cpp @@ -1,4 +1,4 @@ -#include "Genders.h" +#include "Genders.h" #include #include diff --git a/sbf-cpp/Menus.cpp b/sbf-cpp/Menus.cpp index 97a9e96..e66030a 100644 --- a/sbf-cpp/Menus.cpp +++ b/sbf-cpp/Menus.cpp @@ -1,4 +1,4 @@ -#include "Menus.h" +#include "Menus.h" namespace SBF { diff --git a/sbf-cpp/Menus.h b/sbf-cpp/Menus.h index 1a65ceb..59102b6 100644 --- a/sbf-cpp/Menus.h +++ b/sbf-cpp/Menus.h @@ -1,4 +1,4 @@ -#ifndef MENUS_H__ +#ifndef MENUS_H__ #define MENUS_H__ /*************************************************************************************** diff --git a/sbf-cpp/Ranks.cpp b/sbf-cpp/Ranks.cpp index c294b61..34b2bfb 100644 --- a/sbf-cpp/Ranks.cpp +++ b/sbf-cpp/Ranks.cpp @@ -1,4 +1,4 @@ -#include "Ranks.h" +#include "Ranks.h" #include #include diff --git a/sbf-cpp/Ranks.h b/sbf-cpp/Ranks.h index fb9aa4f..06e317d 100644 --- a/sbf-cpp/Ranks.h +++ b/sbf-cpp/Ranks.h @@ -1,4 +1,4 @@ -#ifndef RANKS_H__ +#ifndef RANKS_H__ #define RANKS_H__ /*************************************************************************************** * @file Ranks.h diff --git a/sbf-cpp/Ranks_test.cpp b/sbf-cpp/Ranks_test.cpp index d51ac00..b0311ea 100644 --- a/sbf-cpp/Ranks_test.cpp +++ b/sbf-cpp/Ranks_test.cpp @@ -1,4 +1,4 @@ -#include "Ranks.h" +#include "Ranks.h" #include #include diff --git a/sbf-cpp/Utils.cpp b/sbf-cpp/Utils.cpp index a816965..a383ae0 100644 --- a/sbf-cpp/Utils.cpp +++ b/sbf-cpp/Utils.cpp @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED #include "Utils.h" #include diff --git a/sbf-cpp/Utils.h b/sbf-cpp/Utils.h index 6ade032..9fc43c7 100644 --- a/sbf-cpp/Utils.h +++ b/sbf-cpp/Utils.h @@ -1,4 +1,4 @@ -#ifndef UTILS_H__ +#ifndef UTILS_H__ #define UTILS_H__ /*************************************************************************************** * @file Utils.h diff --git a/sbf-cpp/Utils_test.cpp b/sbf-cpp/Utils_test.cpp index df9c84a..74adee8 100644 --- a/sbf-cpp/Utils_test.cpp +++ b/sbf-cpp/Utils_test.cpp @@ -1,4 +1,4 @@ -#include "Utils.h" +#include "Utils.h" #include #include diff --git a/sbf-cpp/Virtues.cpp b/sbf-cpp/Virtues.cpp index 0c874aa..ae4d622 100644 --- a/sbf-cpp/Virtues.cpp +++ b/sbf-cpp/Virtues.cpp @@ -1,4 +1,4 @@ -#include "Virtues.h" +#include "Virtues.h" #include #include diff --git a/sbf-cpp/Virtues.h b/sbf-cpp/Virtues.h index 9e7eb76..4ed5de1 100644 --- a/sbf-cpp/Virtues.h +++ b/sbf-cpp/Virtues.h @@ -1,4 +1,4 @@ -#ifndef VIRTUES_H__ +#ifndef VIRTUES_H__ #define VIRTUES_H__ /*************************************************************************************** * @file Virtues.h diff --git a/sbf-cpp/Virtues_test.cpp b/sbf-cpp/Virtues_test.cpp index 949682b..b6d320f 100644 --- a/sbf-cpp/Virtues_test.cpp +++ b/sbf-cpp/Virtues_test.cpp @@ -1,4 +1,4 @@ -#include "Virtues.h" +#include "Virtues.h" #include #include diff --git a/sbf-cpp/main.cpp b/sbf-cpp/main.cpp index de66712..ab8b4e9 100644 --- a/sbf-cpp/main.cpp +++ b/sbf-cpp/main.cpp @@ -1,4 +1,4 @@ -#define _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED #include #include diff --git a/sbf-cpp/main.h b/sbf-cpp/main.h index 97e0f60..b267337 100644 --- a/sbf-cpp/main.h +++ b/sbf-cpp/main.h @@ -1,4 +1,4 @@ -#ifndef MAIN_H__ +#ifndef MAIN_H__ #define MAIN_H__ /*************************************************************************************** diff --git a/sbf-cpp/sbf.cpp b/sbf-cpp/sbf.cpp index 866d82f..aff1753 100644 --- a/sbf-cpp/sbf.cpp +++ b/sbf-cpp/sbf.cpp @@ -1,8 +1,6 @@ #define _XOPEN_SOURCE_EXTENDED #include "sbf.h" -#include - #include #include #include @@ -11,73 +9,7 @@ using namespace std; -/* -| ╔ | WACS_D_ULCORNER | WACS_BDDB | -| ╚ | WACS_D_LLCORNER | WACS_DDBB | -| ╗ | WACS_D_URCORNER | WACS_BBDD | -| ╝ | WACS_D_LRCORNER | WACS_DBBD | -| ╣ | WACS_D_RTEE | WACS_DBDD | -| ╠ | WACS_D_LTEE | WACS_DDDB | -| ╩ | WACS_D_BTEE | WACS_DDBD | -| ╦ | WACS_D_TTEE | WACS_BDDD | -| ═ | WACS_D_HLINE | WACS_BDBD | -| ║ | WACS_D_VLINE | WACS_DBDB | -| ╬ | WACS_D_PLUS | WACS_DDDD | -*/ - -int set_double_border(WINDOW* screen) { - return wborder_set(screen, - WACS_D_VLINE /*left side*/, - WACS_D_VLINE /*right side*/, - WACS_D_HLINE /*top side*/, - WACS_D_HLINE /*bottom side*/, - WACS_D_ULCORNER /*top left corner*/, - WACS_D_URCORNER /*top right corner*/, - WACS_D_LLCORNER /*bottom left corner*/, - WACS_D_LRCORNER /*bottom right corner*/); -} - int main(int argc, char* argv[]) { setlocale(LC_ALL, ""); - char buffer[255] = {0}; - WINDOW* pWindow = nullptr; - // Load ncurses and initialize stdscr. - initscr(); - pWindow = stdscr; - // Enable raw mode to give us direct access to extra keys. - raw(); - // Disable echoing characters as they are typed. - noecho(); - // Enable keypad characters. (function keys, arrow keys, and numpad keys.) - keypad(pWindow, true); - // Remove the delay when pressing esc. - set_escdelay(0); - - int key = KEY_RESIZE; - while (key != KEY_ESCAPE) { - if (key == KEY_RESIZE) { - // Clear the screen. - werase(pWindow); - // Draw a box around the window with default chars. - set_double_border(pWindow); - // Display the event - mvwaddstr(pWindow, 2, 2, "Resized"); - // Get the window width and height. - int width; - int height; - getmaxyx(pWindow, height, width); - // Display the width and height. - snprintf(buffer, sizeof(buffer), "width: %i, height: %i", width, height); - mvwaddstr(pWindow, 1, 2, buffer); - } else { - // Display the keycode of the key that was pressed in hex and octal. - snprintf(buffer, sizeof(buffer), "0x%04X %04o pressed", key, key); - mvwaddstr(pWindow, 2, 2, buffer); - } - wrefresh(pWindow); - key = wgetch(pWindow); - } - endwin(); - return 0; }