同步操作将从 sulayman_tien/poco 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
//// TemplateCache.cpp//// Library: JSON// Package: JSON// Module: TemplateCache//// Copyright (c) 2012, Applied Informatics Software Engineering GmbH.// and Contributors.//// SPDX-License-Identifier: BSL-1.0//#include "Poco/File.h"#include "Poco/JSON/TemplateCache.h"namespace Poco {namespace JSON {TemplateCache* TemplateCache::_pInstance = 0;TemplateCache::TemplateCache(): _pLogger(0){setup();}TemplateCache::~TemplateCache(){_pInstance = 0;}void TemplateCache::setup(){poco_assert (_pInstance == 0);_pInstance = this;}Template::Ptr TemplateCache::getTemplate(const Path& path){if (_pLogger){poco_trace_f1(*_pLogger, "Trying to load %s", path.toString());}Path templatePath = resolvePath(path);std::string templatePathname = templatePath.toString();if (_pLogger){poco_trace_f1(*_pLogger, "Path resolved to %s", templatePathname);}File templateFile(templatePathname);Template::Ptr tpl;std::map<std::string, Template::Ptr>::iterator it = _cache.find(templatePathname);if (it == _cache.end()){if (templateFile.exists()){if (_pLogger){poco_information_f1(*_pLogger, "Loading template %s", templatePath.toString());}tpl = new Template(templatePath);try{tpl->parse();_cache[templatePathname] = tpl;}catch (JSONTemplateException& jte){if (_pLogger){poco_error_f2(*_pLogger, "Template %s contains an error: %s", templatePath.toString(), jte.message());}}}else{if (_pLogger){poco_error_f1(*_pLogger, "Template file %s doesn't exist", templatePath.toString());}throw FileNotFoundException(templatePathname);}}else{tpl = it->second;if (tpl->parseTime() < templateFile.getLastModified()){if (_pLogger){poco_information_f1(*_pLogger, "Reloading template %s", templatePath.toString());}tpl = new Template(templatePath);try{tpl->parse();_cache[templatePathname] = tpl;}catch (JSONTemplateException& jte){if (_pLogger){poco_error_f2(*_pLogger, "Template %s contains an error: %s", templatePath.toString(), jte.message());}}}}return tpl;}Path TemplateCache::resolvePath(const Path& path) const{if (path.isAbsolute())return path;for (const auto& p: _includePaths){Path templatePath(p, path);File templateFile(templatePath);if (templateFile.exists()){if (_pLogger){poco_trace_f2(*_pLogger, "%s template file resolved to %s", path.toString(), templatePath.toString());}return templatePath;}if (_pLogger){poco_trace_f1(*_pLogger, "%s doesn't exist", templatePath.toString());}}throw FileNotFoundException(path.toString());}} } // Poco::JSON
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。