headers: Rename *.h to *.hpp and use #pragma once

This commit is contained in:
Joel16 2022-08-01 12:01:10 -04:00
parent 44c9be6ef3
commit d8b1be755c
32 changed files with 97 additions and 139 deletions

View File

@ -1,6 +1,4 @@
#ifndef NX_SHELL_CONFIG_H
#define NX_SHELL_CONFIG_H
#pragma once
#include <switch.h>
@ -17,5 +15,3 @@ namespace Config {
int Save(config_t &config);
int Load(void);
}
#endif

View File

@ -1,5 +1,4 @@
#ifndef NX_SHELL_FS_H
#define NX_SHELL_FS_H
#pragma once
#include <string>
#include <switch.h>
@ -35,5 +34,3 @@ namespace FS {
Result GetTotalStorageSpace(s64 &size);
Result GetUsedStorageSpace(s64 &size);
}
#endif

View File

@ -1,5 +1,4 @@
#ifndef NX_SHELL_GUI_H
#define NX_SHELL_GUI_H
#pragma once
namespace GUI {
bool Init(void);
@ -8,5 +7,3 @@ namespace GUI {
void Render(void);
void Exit(void);
}
#endif

View File

@ -1,10 +1,7 @@
#ifndef NX_SHELL_KEYBOARD_H
#define NX_SHELL_KEYBOARD_H
#pragma once
#include <string>
namespace Keyboard {
std::string GetText(const std::string &guide_text, const std::string &initial_text);
}
#endif

View File

@ -1,5 +1,4 @@
#ifndef NX_SHELL_LANGUAGE_H
#define NX_SHELL_LANGUAGE_H
#pragma once
namespace Lang {
typedef enum {
@ -81,5 +80,3 @@ namespace Lang {
}
extern const char **strings[Lang::Max];
#endif

View File

@ -1,10 +1,7 @@
#ifndef NX_SHELL_LOG_H
#define NX_SHELL_LOG_H
#pragma once
namespace Log {
void Init(void);
void Error(const char *data, ...);
void Exit(void);
}
#endif

View File

@ -1,5 +1,4 @@
#ifndef NX_SHELL_NET_H
#define NX_SHELL_NET_H
#pragma once
#include <string>
@ -9,5 +8,3 @@ namespace Net {
std::string GetLatestReleaseJSON(void);
void GetLatestReleaseNRO(const std::string &tag);
}
#endif

View File

@ -1,10 +1,9 @@
#ifndef NX_SHELL_POPUPS_H
#define NX_SHELL_POPUPS_H
#pragma once
#include <string>
#include "imgui.h"
#include "windows.h"
#include "windows.hpp"
namespace Popups {
inline void SetupPopup(const char *id) {
@ -27,5 +26,3 @@ namespace Popups {
void UpdatePopup(bool &state, bool &connection_status, bool &available, const std::string &tag);
void ProgressBar(float offset, float size, const std::string &title, const std::string &text);
}
#endif

View File

@ -1,15 +1,12 @@
#ifndef NX_SHELL_TABS_H
#define NX_SHELL_TABS_H
#pragma once
#include <switch.h>
#include <vector>
#include "imgui.h"
#include "windows.h"
#include "windows.hpp"
namespace Tabs {
void FileBrowser(WindowData &data);
void Settings(WindowData &data);
}
#endif

View File

@ -1,5 +1,4 @@
#ifndef NX_SHELL_TEXTURES_H
#define NX_SHELL_TEXTURES_H
#pragma once
#include <glad/glad.h>
#include <switch.h>
@ -22,5 +21,3 @@ namespace Textures {
void Init(void);
void Exit(void);
}
#endif

View File

@ -1,5 +1,4 @@
#ifndef NX_SHELL_UTILS_H
#define NX_SHELL_UTILS_H
#pragma once
#include <switch.h>
@ -8,5 +7,3 @@ extern char __application_path[FS_MAX_PATH];
namespace Utils {
void GetSizeString(char *string, double size);
}
#endif

View File

@ -1,5 +1,4 @@
#ifndef NX_SHELL_WINDOWS_H
#define NX_SHELL_WINDOWS_H
#pragma once
#include <switch.h>
#include <vector>
@ -51,5 +50,3 @@ namespace Windows {
void ResetCheckbox(WindowData &data);
void MainWindow(WindowData &data, u64 &key, bool progress);
}
#endif

View File

@ -2,9 +2,9 @@
#include <cstring>
#include <jansson.h>
#include "config.h"
#include "fs.h"
#include "log.h"
#include "config.hpp"
#include "fs.hpp"
#include "log.hpp"
#define CONFIG_VERSION 3

View File

@ -3,11 +3,11 @@
#include <cstring>
#include <filesystem>
#include "config.h"
#include "fs.h"
#include "language.h"
#include "log.h"
#include "popups.h"
#include "config.hpp"
#include "fs.hpp"
#include "language.hpp"
#include "log.hpp"
#include "popups.hpp"
// Global vars
FsFileSystem *fs;

View File

@ -4,10 +4,9 @@
#include <cstdio>
#include <switch.h>
#include "gui.h"
#include "imgui.h"
#include "imgui_impl_switch.h"
#include "log.h"
#include "gui.hpp"
#include "imgui_impl_switch.hpp"
#include "log.hpp"
namespace GUI {
static EGLDisplay s_display = EGL_NO_DISPLAY;

View File

@ -1,10 +1,10 @@
#include "imgui.h"
#include "imgui_impl_switch.h"
#include <stdio.h>
// GL includes
#include <glad/glad.h>
#include "imgui_impl_switch.hpp"
// Vertex arrays are not supported on ES2/WebGL1 unless Emscripten which uses an extension
#ifndef IMGUI_IMPL_OPENGL_ES2
#define IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY

View File

@ -1,10 +1,10 @@
#include <cstring>
#include <switch.h>
#include "config.h"
#include "keyboard.h"
#include "language.h"
#include "log.h"
#include "config.hpp"
#include "keyboard.hpp"
#include "language.hpp"
#include "log.hpp"
namespace Keyboard {
// Empty strings are invalid.

View File

@ -1,6 +1,6 @@
#include <switch.h>
#include "language.h"
#include "language.hpp"
// TODO: Japanese
static const char *strings_jp[] {

View File

@ -1,7 +1,7 @@
#include <cstdarg>
#include "config.h"
#include "fs.h"
#include "config.hpp"
#include "fs.hpp"
namespace Log {
static FsFile log_file;

View File

@ -3,14 +3,14 @@
#include <string.h>
#include <switch.h>
#include <imgui.h>
#include "config.h"
#include "fs.h"
#include "gui.h"
#include "log.h"
#include "textures.h"
#include "windows.h"
#include "config.hpp"
#include "fs.hpp"
#include "gui.hpp"
#include "imgui.h"
#include "log.hpp"
#include "textures.hpp"
#include "windows.hpp"
char __application_path[FS_MAX_PATH];
WindowData data;

View File

@ -5,9 +5,9 @@
#include <jansson.h>
#include <switch.h>
#include "fs.h"
#include "log.h"
#include "net.h"
#include "fs.hpp"
#include "log.hpp"
#include "net.hpp"
namespace Net {
static s64 offset = 0;

View File

@ -1,12 +1,12 @@
#include <algorithm>
#include <cstring>
#include "config.h"
#include "fs.h"
#include "config.hpp"
#include "fs.hpp"
#include "imgui.h"
#include "language.h"
#include "log.h"
#include "popups.h"
#include "language.hpp"
#include "log.hpp"
#include "popups.hpp"
namespace Popups {
void DeletePopup(WindowData &data) {

View File

@ -2,15 +2,14 @@
#include <cstring>
#include <glad/glad.h>
#include "config.h"
#include "fs.h"
#include "gui.h"
#include "imgui.h"
#include "imgui_impl_switch.h"
#include "config.hpp"
#include "fs.hpp"
#include "gui.hpp"
#include "imgui_impl_switch.hpp"
#include "imgui_internal.h"
#include "keyboard.h"
#include "language.h"
#include "popups.h"
#include "keyboard.hpp"
#include "language.hpp"
#include "popups.hpp"
namespace Popups {
static bool copy = false, move = false;

View File

@ -1,11 +1,11 @@
#include <glad/glad.h>
#include <switch.h>
#include "gui.h"
#include "imgui_impl_switch.h"
#include "log.h"
#include "popups.h"
#include "windows.h"
#include "gui.hpp"
#include "imgui_impl_switch.hpp"
#include "log.hpp"
#include "popups.hpp"
#include "windows.hpp"
// Todo maybe use a thread to run this?
namespace Popups {

View File

@ -1,10 +1,10 @@
#include "config.h"
#include "fs.h"
#include "gui.h"
#include "config.hpp"
#include "fs.hpp"
#include "gui.hpp"
#include "imgui.h"
#include "language.h"
#include "popups.h"
#include "utils.h"
#include "language.hpp"
#include "popups.hpp"
#include "utils.hpp"
namespace Popups {
static char *FormatDate(char *string, time_t timestamp) {

View File

@ -1,13 +1,13 @@
#include "config.h"
#include "fs.h"
#include "gui.h"
#include "config.hpp"
#include "fs.hpp"
#include "gui.hpp"
#include "imgui.h"
#include "language.h"
#include "log.h"
#include "net.h"
#include "popups.h"
#include "utils.h"
#include "windows.h"
#include "language.hpp"
#include "log.hpp"
#include "net.hpp"
#include "popups.hpp"
#include "utils.hpp"
#include "windows.hpp"
namespace Popups {
static bool done = false;

View File

@ -1,13 +1,13 @@
#include <algorithm>
#include <cstring>
#include "config.h"
#include "fs.h"
#include "config.hpp"
#include "fs.hpp"
#include "imgui.h"
#include "imgui_internal.h"
#include "tabs.h"
#include "textures.h"
#include "utils.h"
#include "tabs.hpp"
#include "textures.hpp"
#include "utils.hpp"
int sort = 0;

View File

@ -1,11 +1,11 @@
#include "config.h"
#include "fs.h"
#include "gui.h"
#include "config.hpp"
#include "fs.hpp"
#include "gui.hpp"
#include "imgui.h"
#include "language.h"
#include "net.h"
#include "popups.h"
#include "tabs.h"
#include "language.hpp"
#include "net.hpp"
#include "popups.hpp"
#include "tabs.hpp"
namespace Tabs {
static bool update_popup = false, network_status = false, update_available = false;

View File

@ -31,12 +31,11 @@
#include <switch.h>
#include "fs.h"
#include "gui.h"
#include "imgui.h"
#include "imgui_impl_switch.h"
#include "log.h"
#include "textures.h"
#include "fs.hpp"
#include "gui.hpp"
#include "imgui_impl_switch.hpp"
#include "log.hpp"
#include "textures.hpp"
#define BYTES_PER_PIXEL 4
#define MAX_IMAGE_BYTES (48 * 1024 * 1024)

View File

@ -1,7 +1,5 @@
#include <cstdio>
#include "utils.h"
namespace Utils {
void GetSizeString(char *string, double size) {
int i = 0;

View File

@ -1,11 +1,11 @@
#include <algorithm>
#include <cstring>
#include "config.h"
#include "config.hpp"
#include "imgui.h"
#include "popups.h"
#include "tabs.h"
#include "windows.h"
#include "popups.hpp"
#include "tabs.hpp"
#include "windows.hpp"
namespace Windows {
static void SetupWindow(void) {