bool AnimationFile::loadFromFile( const std::string& path, std::map<std::string, std::shared_ptr<PluginFactoryInterface<AnimationHandler>>>& animationHandlers ) { auto file = readFileToVector( path ); m_animationHandler = animationHandlers[file.at( 0 )]->create(); if( m_animationHandler == nullptr ) throw exception(); m_animationHandler->load( file ); return true; }
int compacta(const char *filename) { // ler arquivo e criar vetor de pesos unsigned int *vec = readFileToVector(filename); // criar arvore usando o vetor de pesos struct listHeader *lista_de_pesos = vectorToListOfTrees(vec); // printList(lista_de_pesos); //debug struct tree *raiz_da_arvore = makePathTree(lista_de_pesos); printTree(raiz_da_arvore); //FIXME // TODO: ..and now W.Wallace would like to call for freedom! free(vec); freeList(lista_de_pesos); // freeTree(raiz_da_arvore); //FIXME return 0; }