added reuse headers

This commit is contained in:
georgemoralis 2024-02-24 17:42:45 +02:00
parent d137abe203
commit a3d88a3d02
13 changed files with 51 additions and 9 deletions

View File

@ -1,4 +1,7 @@
//Generated By moduleGenerator // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "libkernel.h" #include "libkernel.h"
#include "common/log.h" #include "common/log.h"
#include "error_codes.h" #include "error_codes.h"

View File

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
#include "library_common.h" #include "library_common.h"

View File

@ -1,4 +1,7 @@
//Generated By moduleGenerator // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "libscegnmdriver.h" #include "libscegnmdriver.h"
#include "common/log.h" #include "common/log.h"
#include "error_codes.h" #include "error_codes.h"

View File

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
#include "library_common.h" #include "library_common.h"

View File

@ -1,4 +1,7 @@
//Generated By moduleGenerator // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "libscepad.h" #include "libscepad.h"
#include "common/log.h" #include "common/log.h"
#include "error_codes.h" #include "error_codes.h"

View File

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
#include "library_common.h" #include "library_common.h"

View File

@ -1,4 +1,7 @@
//Generated By moduleGenerator // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "libscesystemservice.h" #include "libscesystemservice.h"
#include "common/log.h" #include "common/log.h"
#include "error_codes.h" #include "error_codes.h"

View File

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
#include "library_common.h" #include "library_common.h"

View File

@ -1,4 +1,7 @@
//Generated By moduleGenerator // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "libsceuserservice.h" #include "libsceuserservice.h"
#include "common/log.h" #include "common/log.h"
#include "error_codes.h" #include "error_codes.h"

View File

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
#include "library_common.h" #include "library_common.h"

View File

@ -1,4 +1,7 @@
//Generated By moduleGenerator // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// Generated By moduleGenerator
#include "libscevideoout.h" #include "libscevideoout.h"
#include "common/log.h" #include "common/log.h"
#include "error_codes.h" #include "error_codes.h"

View File

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once #pragma once
#include "library_common.h" #include "library_common.h"

View File

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <filesystem> #include <filesystem>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
@ -23,7 +26,8 @@ void GenerateCodeFiles(
std::string lowModName = moduleName; std::string lowModName = moduleName;
std::transform(lowModName.begin(), lowModName.end(), lowModName.begin(), ::tolower); std::transform(lowModName.begin(), lowModName.end(), lowModName.begin(), ::tolower);
std::string headerName(lowModName + ".h"); std::string headerName(lowModName + ".h");
std::string headerCode("#pragma once\n\n#include \"library_common.h\" \n\n"); std::string headerCode("// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project\n// SPDX-License-Identifier: GPL-2.0-or-later\n\n");
headerCode+="#pragma once\n\n#include \"library_common.h\" \n\n";
std::string trimmedName = moduleName; std::string trimmedName = moduleName;
if (moduleName.find("libSce") != std::string::npos) { if (moduleName.find("libSce") != std::string::npos) {
trimmedName = moduleName.substr(6, moduleName.size() - 1); trimmedName = moduleName.substr(6, moduleName.size() - 1);
@ -51,8 +55,10 @@ void GenerateCodeFiles(
headerFile.close(); headerFile.close();
std::string sourceName(lowModName + ".cpp"); std::string sourceName(lowModName + ".cpp");
std::string sourceCode("// Generated By moduleGenerator\n#include \"" + headerName + std::string sourceCode("// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project\n// "
"\"\n#include \"common/log.h\"\n#include \"error_codes.h\"\n\n"); "SPDX-License-Identifier: GPL-2.0-or-later\n\n");
sourceCode+="// Generated By moduleGenerator\n#include \"" + headerName +
"\"\n#include \"common/log.h\"\n#include \"error_codes.h\"\n\n";
sourceCode += "namespace Libraries::" + trimmedName + "{\n\n"; sourceCode += "namespace Libraries::" + trimmedName + "{\n\n";