示例#1
0
文件: func.cpp 项目: dShvetsov/RBasic
int Mode(std::list<R_type *> a)
{
    if (a.empty())
    {
        throw "Function Mode must have >1 arguments";
    }
    std::string sNull("NULL");
    std::string sLog("Logical");
    std::string sNum("Numeric");
    std::   string sChar("Character");
    int ind = TTV.put(Character);
    for (std::list<R_type *>::iterator i = a.begin(); i != a.end(); i++)
    {
        kind_of_type t = (*i)->get_type();
        switch(t)
        {
        case Nulltype:
            TTV[ind]->add(sNull);
            break;
        case Logical:
            TTV[ind]->add(sLog);
            break;
        case Numeric:
            TTV[ind]->add(sNum);
            break;
        case Character:
            TTV[ind]->add(sChar);
            break;
        }
    }
    return ind;
}
示例#2
0
void UploadResumeThread::doRun()
{
	assert(m_pUpInfo);

	getWebCore()->resumeUpload(getItemId(), m_szKey.c_str(), *m_pUpInfo);

	const char* localFilePath = getUploadManager()->findUpload(m_szKey.c_str());
	gcString sLocalFP(localFilePath);

	if (localFilePath && validFile(localFilePath))
	{
		onCompleteStrEvent(sLocalFP);
		return;
	}

	//gona try and search for the file in the data/mods/id folder
	const char* appDataPath = getUserCore()->getAppDataPath();
	gcString searchPath("{0}{1}{2}", appDataPath, DIRS_STR, getItemId().getFolderPathExtension());
	gcString sNull("NULL");

	if (doSearch(searchPath.c_str()))
		return;

	if (getUserCore()->isAdmin())
	{
		searchPath = gcString("{0}{1}temp{1}", appDataPath, DIRS_STR);
		
		if (doSearch(searchPath.c_str()))
			return;
	}

	onCompleteStrEvent(sNull);
}