本文整理汇总了C++中wrapper_map_t::end方法的典型用法代码示例。如果您正苦于以下问题:C++ wrapper_map_t::end方法的具体用法?C++ wrapper_map_t::end怎么用?C++ wrapper_map_t::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wrapper_map_t
的用法示例。
在下文中一共展示了wrapper_map_t::end方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: disableWrapper
bool disableWrapper(const String& scheme) {
String lscheme = f_strtolower(scheme);
if (lscheme.same(s_file)) {
// Zend quietly succeeds, but does nothing
return true;
}
bool ret = false;
// Unregister request-specific wrappers entirely
if (s_request_wrappers->m_wrappers.find(lscheme) !=
s_request_wrappers->m_wrappers.end()) {
s_request_wrappers->m_wrappers.erase(lscheme);
ret = true;
}
// Disable builtin wrapper if it exists
if (s_wrappers.find(lscheme.data()) == s_wrappers.end()) {
// No builtin to disable
return ret;
}
if (s_request_wrappers->m_disabled.find(lscheme) !=
s_request_wrappers->m_disabled.end()) {
// Already disabled
return ret;
}
// Disable it
s_request_wrappers->m_disabled.insert(lscheme);
return true;
}
示例2: getWrapper
Wrapper* getWrapper(CStrRef scheme) {
String lscheme = StringUtil::ToLower(scheme);
auto it = s_wrappers.find(lscheme.data());
if (it != s_wrappers.end()) {
return it->second;
}
return nullptr;
}
示例3: enumWrappers
Array enumWrappers() {
Array ret = Array::Create();
// Enum global wrappers which are not disabled
for (auto it = s_wrappers.begin(); it != s_wrappers.end(); ++it) {
if (s_request_wrappers->m_disabled.find(it->first) ==
s_request_wrappers->m_disabled.end()) {
ret.append(it->first);
}
}
// Enum request local wrappers
for (auto it = s_request_wrappers->m_wrappers.begin();
it != s_request_wrappers->m_wrappers.end(); ++it) {
ret.append(it->first);
}
return ret;
}
示例4: registerRequestWrapper
bool registerRequestWrapper(CStrRef scheme, std::unique_ptr<Wrapper> wrapper) {
String lscheme = StringUtil::ToLower(scheme);
// Global, non-disabled wrapper
if ((s_wrappers.find(lscheme.data()) != s_wrappers.end()) &&
(s_request_wrappers->m_disabled.find(lscheme) ==
s_request_wrappers->m_disabled.end())) {
return false;
}
// A wrapper has already been registered for that scheme
if (s_request_wrappers->m_wrappers.find(lscheme) !=
s_request_wrappers->m_wrappers.end()) {
return false;
}
s_request_wrappers->m_wrappers[lscheme] = std::move(wrapper);
return true;
}
示例5: getWrapper
Wrapper* getWrapper(const String& scheme) {
String lscheme = f_strtolower(scheme);
// Request local wrapper?
{
auto it = s_request_wrappers->m_wrappers.find(lscheme);
if (it != s_request_wrappers->m_wrappers.end()) {
return it->second.get();
}
}
// Global, non-disabled wrapper?
{
auto it = s_wrappers.find(lscheme.data());
if ((it != s_wrappers.end()) &&
(s_request_wrappers->m_disabled.find(lscheme) ==
s_request_wrappers->m_disabled.end())) {
return it->second;
}
}
return nullptr;
}
示例6: registerWrapper
bool registerWrapper(const std::string &scheme, Wrapper *wrapper) {
assert(s_wrappers.find(scheme) == s_wrappers.end());
s_wrappers[scheme] = wrapper;
return true;
}