void ScaenaAnimationWriter::writeAnimation(string filename, list<AnimationDataTransfer*>* animations){ Logger::getInstance()->logInfo(new Log("Procesando el SAF de salida...")); XmlTree* xmlTree = animationsToXmlTree(animations); XmlParser::writeXmlToFile(getFinalFilename(filename).c_str(), xmlTree); }
//----------------------------------------------------------------------------// void MinizipResourceProvider::loadRawDataContainer(const String& filename, RawDataContainer& output, const String& resourceGroup) { const String final_filename = getFinalFilename(filename, resourceGroup); if (d_pimpl->d_loadLocal && doesFileExist(final_filename)) { DefaultResourceProvider::loadRawDataContainer(filename, output, resourceGroup); return; } if (d_pimpl->d_zfile == 0) { throw InvalidRequestException( "'" + final_filename + "' cannot be " "loaded because the archive has not been set"); } #if CEGUI_STRING_CLASS == CEGUI_STRING_CLASS_STD if (unzLocateFile(d_pimpl->d_zfile, final_filename.c_str(), 0) != UNZ_OK) #elif CEGUI_STRING_CLASS == CEGUI_STRING_CLASS_UNICODE if (unzLocateFile(d_pimpl->d_zfile, final_filename.toUtf8String().c_str(), 0) != UNZ_OK) #endif { throw InvalidRequestException("'" + final_filename + "' does not exist"); } unz_file_info file_info; if (unzGetCurrentFileInfo(d_pimpl->d_zfile, &file_info, 0, 0, 0, 0, 0, 0) != UNZ_OK) { throw FileIOException("'" + final_filename + "' error reading file header"); } if (unzOpenCurrentFile(d_pimpl->d_zfile) != Z_OK) { throw FileIOException("'" + final_filename + "' error opening file"); } std::uint64_t size = file_info.uncompressed_size; std::uint8_t* buffer = new std::uint8_t[size]; if (unzReadCurrentFile(d_pimpl->d_zfile, buffer, size) < 0) { throw FileIOException("'" + final_filename + "' error reading file"); } if (unzCloseCurrentFile(d_pimpl->d_zfile) != UNZ_OK) { throw GenericException("'" + final_filename + "' error validating file"); } output.setData(buffer); output.setSize(size); }