本文整理汇总了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;
}
示例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);
}
示例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()));
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例12: AdjustIndicatorColumnRowNumbers
static void AdjustIndicatorColumnRowNumbers(Nullable<DetectionResultColumn>& detectionResultColumn, const BarcodeMetadata& barcodeMetadata)
{
if (detectionResultColumn != nullptr) {
detectionResultColumn.value().adjustCompleteIndicatorColumnRowNumbers(barcodeMetadata);
}
}