本文整理汇总了C++中ListHashSet::add方法的典型用法代码示例。如果您正苦于以下问题:C++ ListHashSet::add方法的具体用法?C++ ListHashSet::add怎么用?C++ ListHashSet::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListHashSet
的用法示例。
在下文中一共展示了ListHashSet::add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pemData
// success of certificates extraction
bool pemData(X509_STORE_CTX* ctx, ListHashSet<String>& certificates)
{
bool ok = true;
STACK_OF(X509)* certs = X509_STORE_CTX_get1_chain(ctx);
for (int i = 0; i < sk_X509_num(certs); i++) {
X509* uCert = sk_X509_value(certs, i);
BIO* bio = BIO_new(BIO_s_mem());
int res = PEM_write_bio_X509(bio, uCert);
if (!res) {
ok = false;
BIO_free(bio);
break;
}
unsigned char* certificateData;
long length = BIO_get_mem_data(bio, &certificateData);
if (length < 0) {
ok = false;
BIO_free(bio);
break;
}
certificateData[length] = '\0';
String certificate = certificateData;
certificates.add(certificate);
BIO_free(bio);
}
sk_X509_pop_free(certs, X509_free);
return ok;
}
示例2: addSubresourceAttributeURLs
void StyledElement::addSubresourceAttributeURLs(ListHashSet<URL>& urls) const
{
auto* inlineStyle = this->inlineStyle();
if (!inlineStyle)
return;
inlineStyle->traverseSubresources([&] (auto& resource) {
urls.add(resource.url());
return false;
});
}
示例3:
ListHashSet<String> ClipboardGtk::types() const
{
if (policy() != ClipboardReadable && policy() != ClipboardTypesReadable)
return ListHashSet<String>();
if (m_clipboard)
PasteboardHelper::defaultPasteboardHelper()->getClipboardContents(m_clipboard);
ListHashSet<String> types;
if (m_dataObject->hasText()) {
types.add("text/plain");
types.add("Text");
types.add("text");
}
if (m_dataObject->hasMarkup())
types.add("text/html");
if (m_dataObject->hasURIList()) {
types.add("text/uri-list");
types.add("URL");
}
if (m_dataObject->hasFilenames())
types.add("Files");
return types;
}
示例4:
ListHashSet<String> Pasteboard::types()
{
if (m_gtkClipboard)
PasteboardHelper::defaultPasteboardHelper()->getClipboardContents(m_gtkClipboard);
ListHashSet<String> types;
if (m_dataObject->hasText()) {
types.add("text/plain");
types.add("Text");
types.add("text");
}
if (m_dataObject->hasMarkup())
types.add("text/html");
if (m_dataObject->hasURIList()) {
types.add("text/uri-list");
types.add("URL");
}
if (m_dataObject->hasFilenames())
types.add("Files");
return types;
}
示例5: dirtyLinesFromChangedChild
void LineBoxList::dirtyLinesFromChangedChild(LayoutObject* container, LayoutObject* child)
{
if (!container->parent() || (container->isLayoutBlock() && (container->selfNeedsLayout() || !container->isLayoutBlockFlow())))
return;
LayoutInline* inlineContainer = container->isLayoutInline() ? toLayoutInline(container) : 0;
InlineBox* firstBox = inlineContainer ? inlineContainer->firstLineBoxIncludingCulling() : firstLineBox();
// If we have no first line box, then just bail early.
if (!firstBox) {
// For an empty inline, go ahead and propagate the check up to our parent, unless the parent
// is already dirty.
if (container->isInline() && !container->ancestorLineBoxDirty()) {
container->parent()->dirtyLinesFromChangedChild(container);
container->setAncestorLineBoxDirty(); // Mark the container to avoid dirtying the same lines again across multiple destroy() calls of the same subtree.
}
return;
}
// Try to figure out which line box we belong in. First try to find a previous
// line box by examining our siblings. If we didn't find a line box, then use our
// parent's first line box.
RootInlineBox* box = 0;
LayoutObject* curr = 0;
ListHashSet<LayoutObject*, 16> potentialLineBreakObjects;
potentialLineBreakObjects.add(child);
for (curr = child->previousSibling(); curr; curr = curr->previousSibling()) {
potentialLineBreakObjects.add(curr);
if (curr->isFloatingOrOutOfFlowPositioned())
continue;
if (curr->isReplaced()) {
InlineBox* wrapper = toLayoutBox(curr)->inlineBoxWrapper();
if (wrapper)
box = &wrapper->root();
} else if (curr->isText()) {
InlineTextBox* textBox = toLayoutText(curr)->lastTextBox();
if (textBox)
box = &textBox->root();
} else if (curr->isLayoutInline()) {
InlineBox* lastSiblingBox = toLayoutInline(curr)->lastLineBoxIncludingCulling();
if (lastSiblingBox)
box = &lastSiblingBox->root();
}
if (box)
break;
}
if (!box) {
if (inlineContainer && !inlineContainer->alwaysCreateLineBoxes()) {
// https://bugs.webkit.org/show_bug.cgi?id=60778
// We may have just removed a <br> with no line box that was our first child. In this case
// we won't find a previous sibling, but firstBox can be pointing to a following sibling.
// This isn't good enough, since we won't locate the root line box that encloses the removed
// <br>. We have to just over-invalidate a bit and go up to our parent.
if (!inlineContainer->ancestorLineBoxDirty()) {
inlineContainer->parent()->dirtyLinesFromChangedChild(inlineContainer);
inlineContainer->setAncestorLineBoxDirty(); // Mark the container to avoid dirtying the same lines again across multiple destroy() calls of the same subtree.
}
return;
}
box = &firstBox->root();
}
// If we found a line box, then dirty it.
if (box) {
RootInlineBox* adjacentBox;
box->markDirty();
// dirty the adjacent lines that might be affected
// NOTE: we dirty the previous line because RootInlineBox objects cache
// the address of the first object on the next line after a BR, which we may be
// invalidating here. For more info, see how LayoutBlock::layoutInlineChildren
// calls setLineBreakInfo with the result of findNextLineBreak. findNextLineBreak,
// despite the name, actually returns the first LayoutObject after the BR.
// <rdar://problem/3849947> "Typing after pasting line does not appear until after window resize."
adjacentBox = box->prevRootBox();
if (adjacentBox)
adjacentBox->markDirty();
adjacentBox = box->nextRootBox();
// If |child| or any of its immediately previous siblings with culled lineboxes is the object after a line-break in |box| or the linebox after it
// then that means |child| actually sits on the linebox after |box| (or is its line-break object) and so we need to dirty it as well.
if (adjacentBox && (potentialLineBreakObjects.contains(box->lineBreakObj()) || potentialLineBreakObjects.contains(adjacentBox->lineBreakObj()) || child->isBR() || isIsolated(container->style()->unicodeBidi())))
adjacentBox->markDirty();
}
}