Yab2Cpp/yab-IDE/BuildFactory/parts/YabMain.cpp.end
2015-04-13 13:40:27 -07:00

44 lines
888 B
Plaintext

for(int i=1; i<argc; i++)
{
if(argv[i][0]!='-')
{
BFile file(argv[i], B_READ_ONLY);
if(file.InitCheck()==B_OK)
{
char readData[1024];
int pos;
file.Read(readData,1024);
BString tmpString(readData);
pos = tmpString.IFindFirst("MIMETYPE");
if(pos!=B_ERROR)
{
int quote1, quote2;
quote1 = tmpString.FindFirst("\"",pos);
if(quote1!=B_ERROR)
{
quote2 = tmpString.FindFirst("\"",quote1+1);
if(quote2!=B_ERROR)
{
tmp.SetTo("");
tmpString.CopyInto(tmp,quote1+1,quote2-quote1-1);
}
}
}
}
break;
}
}
strcpy(t,tmp.String());
return (const char*)t;
}
int main(int argc, char** argv)
{
int ret;
YabInterface *yabInterface = new YabInterface(argc, argv, readSignature(argc, argv));
yabInterface->Run();
ret = yabInterface->GetErrorCode();
delete yabInterface;
return ret;
}