当前位置: 首页>>代码示例>>C++>>正文


C++ Nullable::value方法代码示例

本文整理汇总了C++中Nullable::value方法的典型用法代码示例。如果您正苦于以下问题:C++ Nullable::value方法的具体用法?C++ Nullable::value怎么用?C++ Nullable::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nullable的用法示例。


在下文中一共展示了Nullable::value方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AdjustRowNumber

/**
* @return true, if row number was adjusted, false otherwise
*/
static bool AdjustRowNumber(Nullable<Codeword>& codeword, const Nullable<Codeword>& otherCodeword) {
	if (codeword != nullptr && otherCodeword != nullptr
		&& otherCodeword.value().hasValidRowNumber() && otherCodeword.value().bucket() == codeword.value().bucket()) {
		codeword.value().setRowNumber(otherCodeword.value().rowNumber());
		return true;
	}
	return false;
}
开发者ID:huycn,项目名称:zxing-cpp,代码行数:11,代码来源:PDFDetectionResult.cpp

示例2: match

bool CSSClassSelector::match(Element& e, ViewCSSImp* view, bool dynamic)
{
    Nullable<std::u16string> classes = e.getAttribute(u"class");
    if (!classes.hasValue())
        return false;
    return contains(classes.value(), name);
}
开发者ID:UIKit0,项目名称:escudo,代码行数:7,代码来源:CSSSelector.cpp

示例3: eval

void HTMLElementImp::eval()
{
    DocumentWindowPtr window = getOwnerDocumentImp()->activate();
    Nullable<std::u16string> attr = getAttribute(u"style");
    if (attr.hasValue()) {
        CSSParser parser;
        style = parser.parseDeclarations(attr.value());
        parser.getStyleDeclaration()->setOwner(this);
    }
    attr = getAttribute(u"onclick");
    if (attr.hasValue())
        setOnclick(window->getContext()->compileFunction(attr.value()));
    attr = getAttribute(u"onload");
    if (attr.hasValue())
        setOnload(window->getContext()->compileFunction(attr.value()));
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:16,代码来源:HTMLElementImp.cpp

示例4: evalValign

bool HTMLElementImp::evalValign(HTMLElementImp* element)
{
    Nullable<std::u16string> value = element->getAttribute(u"valign");
    if (value.hasValue()) {
        element->getStyle().setProperty(u"vertical-align", value.value(), u"non-css");
        return true;
    }
    return false;
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:9,代码来源:HTMLElementImp.cpp

示例5: evalColor

bool HTMLElementImp::evalColor(HTMLElementImp* element, const std::u16string& attr, const std::u16string& prop)
{
    Nullable<std::u16string> value = element->getAttribute(attr);
    if (value.hasValue()) {
        css::CSSStyleDeclaration style = element->getStyle();
        style.setProperty(prop, value.value(), u"non-css");
        return true;
    }
    return false;
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:10,代码来源:HTMLElementImp.cpp

示例6: evalBackground

bool HTMLElementImp::evalBackground(HTMLElementImp* element)
{
    Nullable<std::u16string> attr = element->getAttribute(u"background");
    if (attr.hasValue()) {
        css::CSSStyleDeclaration style = element->getStyle();
        style.setProperty(u"background-image", u"url(" + attr.value() + u")", u"non-css");
        return true;
    }
    return false;
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:10,代码来源:HTMLElementImp.cpp

示例7: length

HTMLFormControlsCollectionImp::HTMLFormControlsCollectionImp(const HTMLFormElementPtr& form) :
    length(0)
{
    ElementPtr i = form;
    while (i = i->getNextElement(form)) {
        if (isListedElement(i)) {
            std::u16string name;
            Nullable<std::u16string> a = i->getAttribute(u"name");
            if (a.hasValue())
                name = a.value();
            if (name.empty()) {
                a = i->getAttribute(u"id");
                if (a.hasValue())
                    name = a.value();
            }
            Object found = namedItem(name);
            if (!found) {
                map.insert(std::pair<const std::u16string, Object>(name, i));
                ++length;
                continue;
            }
            if (html::RadioNodeList::hasInstance(found)) {
                html::RadioNodeList r = interface_cast<html::RadioNodeList>(found);
                if (auto list = std::dynamic_pointer_cast<RadioNodeListImp>(r.self())) {
                    list->addItem(i);
                    ++length;
                }
                continue;
            }
            auto list = std::make_shared<RadioNodeListImp>();
            if (list) {
                list->addItem(interface_cast<Element>(found));
                list->addItem(i);
                ++length;
                map.erase(name);
                map.insert(std::pair<const std::u16string, Object>(name, list));
            }
        }
    }
}
开发者ID:UIKit0,项目名称:escudo,代码行数:40,代码来源:HTMLFormControlsCollectionImp.cpp

示例8: readKeyValueMap

	static boost::python::object readKeyValueMap(PolymorphicSharedPtr<KeyspaceStorage>& inStorage)
		{
		boost::python::dict keysAndValues;

		pair<map<SharedState::Key, KeyState>, vector<LogEntry> > state;

		inStorage->readState(state);
		
		inStorage->compressKeyStates(state.first, state.second);

		const KeyType& keyType = KeyTypeFactory::getTypeFor(inStorage->getKeyspace().type());

		for (auto it = state.first.begin(); it != state.first.end(); ++it)
			{
			Nullable<ValueType> val = keyType.computeValueForKeyState(it->second);

			if (val && val->value())
				keysAndValues[it->first] = *val->value();
			}

		return keysAndValues;
		}
开发者ID:WantonSoup,项目名称:ufora,代码行数:22,代码来源:SharedState.py.cpp

示例9: evalPxOrPercentage

bool HTMLElementImp::evalPxOrPercentage(HTMLElementImp* element, const std::u16string& attr, const std::u16string& prop)
{
    Nullable<std::u16string> value = element->getAttribute(attr);
    if (value.hasValue()) {
        std::u16string length = value.value();
        if (toPxOrPercentage(length)) {
            css::CSSStyleDeclaration style = element->getStyle();
            style.setProperty(prop, length, u"non-css");
            return true;
        }
    }
    return false;
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:13,代码来源:HTMLElementImp.cpp

示例10: evalVspace

bool HTMLElementImp::evalVspace(HTMLElementImp* element, const std::u16string& prop)
{
    Nullable<std::u16string> value = element->getAttribute(prop);
    if (value.hasValue()) {
        std::u16string px = value.value();
        if (toPx(px)) {
            css::CSSStyleDeclaration style = element->getStyle();
            style.setProperty(u"margin-top", px, u"non-css");
            style.setProperty(u"margin-bottom", px, u"non-css");
            return true;
        }
    }
    return false;
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:14,代码来源:HTMLElementImp.cpp

示例11: evalBorder

bool HTMLElementImp::evalBorder(HTMLElementImp* element)
{
    Nullable<std::u16string> value = element->getAttribute(u"border");
    if (value.hasValue()) {
        std::u16string px = value.value();
        if (toPx(px)) {
            css::CSSStyleDeclaration style = element->getStyle();
            style.setProperty(u"border-width", px, u"non-css");
            style.setProperty(u"border-style", u"solid", u"non-css");
            return true;
        }
    }
    return false;
}
开发者ID:giobeatle1794,项目名称:es-operating-system,代码行数:14,代码来源:HTMLElementImp.cpp

示例12: AdjustIndicatorColumnRowNumbers

static void AdjustIndicatorColumnRowNumbers(Nullable<DetectionResultColumn>& detectionResultColumn, const BarcodeMetadata& barcodeMetadata)
{
	if (detectionResultColumn != nullptr) {
		detectionResultColumn.value().adjustCompleteIndicatorColumnRowNumbers(barcodeMetadata);
	}
}
开发者ID:huycn,项目名称:zxing-cpp,代码行数:6,代码来源:PDFDetectionResult.cpp


注:本文中的Nullable::value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。