text
stringlengths 0
2.2M
|
---|
if(f!=NULL)
|
{
|
ClassInfo* t = new ClassInfo();
|
*t = f();
|
ciMap->insert({ca, t});
|
return t;
|
}
|
else
|
return &nullclass;
|
}
|
void Reflector::destroy(void* instance, std::string className, const std::string& app) {
|
int serOpt = 0;
|
StringUtil::trim(className);
|
if(className=="void"){
|
delete instance;
|
return;
|
}
|
if(className.find(",")!=std::string::npos)
|
{
|
className = className.substr(0, className.find(",")+1);
|
}
|
int level = StringUtil::countOccurrences(className, "<");
|
if(className=="std::string" || className=="string")serOpt = 1;
|
else if(className=="char")serOpt = 2;
|
else if(className=="unsigned char")serOpt = 3;
|
else if(className=="int")serOpt = 4;
|
else if(className=="unsigned int")serOpt = 5;
|
else if(className=="short")serOpt = 6;
|
else if(className=="unsigned short")serOpt = 7;
|
else if(className=="long")serOpt = 8;
|
else if(className=="unsigned long")serOpt = 9;
|
else if(className=="long long")serOpt = 10;
|
else if(className=="unsigned long long")serOpt = 11;
|
else if(className=="float")serOpt = 12;
|
else if(className=="double")serOpt = 13;
|
else if(className=="long double")serOpt = 14;
|
else if(className=="bool")serOpt = 15;
|
else if(className=="Date")serOpt = 16;
|
else if(className=="BinaryData")serOpt = 17;
|
else if(level>1)
|
{
|
serOpt = 18;
|
}
|
else if(className=="std::ifstream")serOpt = 19;
|
else if(className.find("std::vector<")!=std::string::npos || className.find("vector<")!=std::string::npos ||
|
className.find("std::list<")!=std::string::npos || className.find("list<")!=std::string::npos ||
|
className.find("std::set<")!=std::string::npos || className.find("set<")!=std::string::npos ||
|
className.find("std::multiset<")!=std::string::npos || className.find("multiset<")!=std::string::npos ||
|
className.find("std::queue<")!=std::string::npos || className.find("queue<")!=std::string::npos ||
|
className.find("std::deque<")!=std::string::npos || className.find("deque<")!=std::string::npos)
|
{
|
std::string cc = className.substr(0, className.find("<"));
|
if(cc.find("std::")==0) cc = cc.substr(5);
|
std::string ic = className.substr(className.find("<")+1);
|
if(ic.find(",")!=std::string::npos) ic = ic.substr(0, ic.find(","));
|
else ic = ic.substr(0, ic.find(">"));
|
int icsO = 0;
|
if(ic=="std::string" || ic=="string")icsO = 1;
|
else if(ic=="char")icsO = 2;
|
else if(ic=="unsigned char")icsO = 3;
|
else if(ic=="int")icsO = 4;
|
else if(ic=="unsigned int")icsO = 5;
|
else if(ic=="short")icsO = 6;
|
else if(ic=="unsigned short")icsO = 7;
|
else if(ic=="long")icsO = 8;
|
else if(ic=="unsigned long")icsO = 9;
|
else if(ic=="long long")icsO = 10;
|
else if(ic=="unsigned long long")icsO = 11;
|
else if(ic=="float")icsO = 12;
|
else if(ic=="double")icsO = 13;
|
else if(ic=="long double")icsO = 14;
|
else if(ic=="bool")icsO = 15;
|
else if(ic=="Date")icsO = 16;
|
else if(ic=="BinaryData")icsO = 17;
|
else if(ic=="std::ifstream")icsO = 19;
|
if(cc=="vector") serOpt = 100 + icsO;
|
else if(cc=="list") serOpt = 200 + icsO;
|
else if(cc=="set") serOpt = 300 + icsO;
|
else if(cc=="multiset") serOpt = 400 + icsO;
|
else if(cc=="queue") serOpt = 500 + icsO;
|
else if(cc=="deque") serOpt = 600 + icsO;
|
}
|
destroy(serOpt, instance, className, app);
|
}
|
void Reflector::destroy(void* instance, std::string className, std::string_view app) {
|
int serOpt = 0;
|
StringUtil::trim(className);
|
if(className=="void"){
|
delete instance;
|
return;
|
}
|
if(className.find(",")!=std::string::npos)
|
{
|
className = className.substr(0, className.find(",")+1);
|
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.