Esempio n. 1
0
tVecStr ImageManager::filterByDate ( tVecStr list , BppTree & tree )
{
	TreeIterator& it = tree.first();

	while ( !it.end() )
	{
		KeyStr* key = dynamic_cast<KeyStr*>(it.getKey());
		if( imgTree.exists( *key ) )
		{
			ValueInt* idImg = dynamic_cast<ValueInt*>( imgTree.find( *key ));
			if( idImg != NULL )
			{
				ImgRegistry* reg=dynamic_cast<ImgRegistry*>(orgImages.GetRegistry(idImg->getValue()));
				Date d = reg->GetDate();
				if (! ( d == Date::getDate( key->getKey().c_str()) ))
				{
					list.push_back( key->getKey() );
				}
			}
			delete idImg;
		}
		delete key;
		++it;
	}
	tree.deleteIterator(it);
	return list;
}
TEST_F(ExprConcatTest, Value)
{
	ValueInt* v = dynamic_cast<ValueInt*>(testRule->value(*startState));
	if(v)
		EXPECT_EQ(5, v->getValue());
	else
		FAIL();
}
TEST_F(RepeatTest, State)
{
	StateTuple endState = testRuleState->sigma(*startState);
	ValueInt* v = dynamic_cast<ValueInt*>(endState.getPStateValue("x"));
	if(v)
		EXPECT_EQ(10, v->getValue());
	else
		FAIL();
}
Esempio n. 4
0
/* -------------------------------------------------------------------------- */
void ImageManager::DeleteImage(string imgPath, tVecStr* imgErasedList, bool filterAll, bool removetoTree)
{
	KeyStr key(imgPath);
	if(!imgTree.empty())
	{
		if(imgTree.exists(key))
		{
			ValueInt* vInt = dynamic_cast<ValueInt*>(imgTree.find(key));
			DeleteImage(vInt->getValue(), imgErasedList, filterAll, removetoTree);
			delete vInt;
		}
	}
}
Esempio n. 5
0
/* -------------------------------------------------------------------------- */
void ImageManager::ShowMessageFromDirectory(const char* dirPath)
{
    if( imgTree.empty())
        return;
    tVecStr fileList = FileSystem::GetFiles(dirPath,File);
    if(fileList.empty())
        return;
    std::list<string> listNameMsg;
    
    string strDirPath(dirPath);
    StrToken::FormatPath(strDirPath);
    
    for( unsigned int i=0; i<fileList.size(); i++)
    {
    	string fullPath = strDirPath + fileList[i];
        KeyStr key(fileList[i]);
        ValueInt* vInt = dynamic_cast<ValueInt*>(imgTree.find(key));
        if( vInt == NULL)
           continue;
        ImgRegistry* imgReg = dynamic_cast<ImgRegistry*>(orgImages.GetRegistry(vInt->getValue()));
        tRegisterList* listIdMsg = this->orgListMsgs.GetList(imgReg->GetPtrFreeSpaceList());
        if( listIdMsg != NULL )
        {
            itRegisterList it;
            MessageManager* messageManager = MessageManager::GetInstance();
            for( it=listIdMsg->begin(); it != listIdMsg->end(); it++ )
            {
                ListMsgRegistry* listMsgReg = dynamic_cast<ListMsgRegistry*>(*it);
                ID_type idMsg = listMsgReg->GetIDMessage();
                std::string nameMsg = messageManager->GetNameMessage(idMsg);
                listNameMsg.push_back(nameMsg);
                delete listMsgReg;
            }
            delete listIdMsg;
        }
       
        delete vInt;
        delete imgReg;
        delete listIdMsg;
    }
    listNameMsg.unique();
    std::list<string>::iterator it;
    for(it=listNameMsg.begin(); it != listNameMsg.end(); it++)
    {
        std::cout << (*it) << "\n";
    }
}
Esempio n. 6
0
CountPtr<Value> ValueFloat::div(const ValueInt& left)     const
{
	if(m_val == 0)
	{
		//WARN_P(_("Division by zero"));
		return VALUENULL;
	}
	else
	{
		return CountPtr<Value>(new ValueFloat(left.getVal() / m_val));
	}
}
Esempio n. 7
0
CountPtr<Value> ValueFloat::mult(const ValueInt& left)    const { return CountPtr<Value>(new ValueFloat(left.getVal() * m_val)); }
Esempio n. 8
0
CountPtr<Value> ValueFloat::gt(const ValueInt& left)      const { return (left.getVal() > m_val) ? VALUEBOOL_TRUE : VALUEBOOL_FALSE; }