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


C++ AttributeMap::empty方法代码示例

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


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

示例1: addMap

void StyleSheetTable::addMap(const std::string &tag, const std::string &aClass, const AttributeMap &map) {
	if ((!tag.empty() || !aClass.empty()) && !map.empty()) {
		Key key(tag, aClass);
		myControlMap[key] = createControl(map);
		const std::vector<std::string> &pbb = values(map, "page-break-before");
		if (!pbb.empty()) {
			if ((pbb[0] == "always") ||
					(pbb[0] == "left") ||
					(pbb[0] == "right")) {
				myPageBreakBeforeMap[key] = true;
			} else if (pbb[0] == "avoid") {
				myPageBreakBeforeMap[key] = false;
			}
		}
		const std::vector<std::string> &pba = values(map, "page-break-after");
		if (!pba.empty()) {
			if ((pba[0] == "always") ||
					(pba[0] == "left") ||
					(pba[0] == "right")) {
				myPageBreakAfterMap[key] = true;
			} else if (pba[0] == "avoid") {
				myPageBreakAfterMap[key] = false;
			}
		}
	}
}
开发者ID:ALEXGUOQ,项目名称:FBReader,代码行数:26,代码来源:StyleSheetTable.cpp

示例2: log

void
CollectionScanner::scanFiles( const QStringList& entries )
{
    DEBUG_BLOCK

    typedef QPair<QString, QString> CoverBundle;

    QStringList validImages;    validImages    << "jpg" << "png" << "gif" << "jpeg";
    QStringList validPlaylists; validPlaylists << "m3u" << "pls";

    QValueList<CoverBundle> covers;
    QStringList images;

    foreachType( QStringList, entries ) {
        const QString path = *it;
        const QString ext  = extension( path );
        const QString dir  = directory( path );

        // Write path to logfile
        if( !m_logfile.isEmpty() ) {
            QFile log( m_logfile );
            if( log.open( IO_WriteOnly ) )
                log.writeBlock( path.local8Bit(), path.length() );
        }

        if( validImages.contains( ext ) )
            images += path;

        else if( m_importPlaylists && validPlaylists.contains( ext ) ) {
            AttributeMap attributes;
            attributes["path"] = path;
            writeElement( "playlist", attributes );
        }

        else {
            MetaBundle::EmbeddedImageList images;
            MetaBundle mb( KURL::fromPathOrURL( path ), true, TagLib::AudioProperties::Fast, &images );
            const AttributeMap attributes = readTags( mb );

            if( !attributes.empty() ) {
                writeElement( "tags", attributes );

                CoverBundle cover( attributes["artist"], attributes["album"] );

                if( !covers.contains( cover ) )
                    covers += cover;

                foreachType( MetaBundle::EmbeddedImageList, images ) {
                    AttributeMap attributes;
                    attributes["path"] = path;
                    attributes["hash"] = (*it).hash();
                    attributes["description"] = (*it).description();
                    writeElement( "embed", attributes );
                }
            }
        }
开发者ID:tmarques,项目名称:waheela,代码行数:56,代码来源:collectionscanner.cpp

示例3: addMap

void StyleSheetTable::addMap(shared_ptr<CSSSelector> selectorPtr, const AttributeMap &map) {
	if (!selectorPtr.isNull() && !map.empty()) {
		const CSSSelector &selector = *selectorPtr;
		myControlMap[selector] = createOrUpdateControl(map, myControlMap[selector]);

		const std::string &pbb = value(map, "page-break-before");
		if (pbb == "always" || pbb == "left" || pbb == "right") {
			myPageBreakBeforeMap[selector] = true;
		} else if (pbb == "avoid") {
			myPageBreakBeforeMap[selector] = false;
		}

		const std::string &pba = value(map, "page-break-after");
		if (pba == "always" || pba == "left" || pba == "right") {
			myPageBreakAfterMap[selector] = true;
		} else if (pba == "avoid") {
			myPageBreakAfterMap[selector] = false;
		}
	}
}
开发者ID:2php,项目名称:FBReaderJ,代码行数:20,代码来源:StyleSheetTable.cpp


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