Base: remove unneeded includes

This commit is contained in:
Benjamin Bræstrup Sayoc
2025-02-12 18:38:23 +01:00
committed by Chris Hennes
parent e7763236bc
commit dda05369c4
71 changed files with 151 additions and 121 deletions

View File

@@ -26,15 +26,12 @@
#include <cassert>
#endif
/// Here the FreeCAD includes sorted by Base,App,Gui......
#include "Type.h"
#include "Exception.h"
#include "Interpreter.h"
#include "Console.h"
using namespace Base;
using namespace std;
struct Base::TypeData
@@ -55,9 +52,9 @@ struct Base::TypeData
Type::instantiationMethod instMethod;
};
map<string, unsigned int> Type::typemap;
vector<TypeData*> Type::typedata;
set<string> Type::loadModuleSet;
std::map<std::string, unsigned int> Type::typemap;
std::vector<TypeData*> Type::typedata;
std::set<std::string> Type::loadModuleSet;
void* Type::createInstance() const
{
@@ -90,7 +87,7 @@ void* Type::createInstanceByName(const char* TypeName, bool bLoadModule)
void Type::importModule(const char* TypeName)
{
// cut out the module name
const string mod = getModuleName(TypeName);
const std::string mod = getModuleName(TypeName);
// ignore base modules
if (mod == "App" || mod == "Gui" || mod == "Base") {
@@ -111,12 +108,13 @@ void Type::importModule(const char* TypeName)
loadModuleSet.insert(mod);
}
string Type::getModuleName(const char* ClassName)
std::string Type::getModuleName(const char* ClassName)
{
string_view classNameView(ClassName);
std::string_view classNameView(ClassName);
auto pos = classNameView.find("::");
return pos != string_view::npos ? string(classNameView.substr(0, pos)) : string();
return pos != std::string_view::npos ? std::string(classNameView.substr(0, pos))
: std::string();
}
Type Type::badType()