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


C++ ContentNode类代码示例

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


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

示例1: getContentNodeByUrl

bool ContentNode::getContentNodeByUrl(QSqlDatabase& database,
                                      const QString & url,
                                      ContentNode & node)
{
    QSqlQuery query(database);
    query.prepare( "select id, name, location, title, authors, description, "
                   "last_access, publisher,  "
                   "rating, read_time, read_count, progress, attributes "
                   "from content where md5 = :md5" );
    query.bindValue(":md5", url);

    if (query.exec() && query.next())
    {
        int index = 0;
        node.id_ = query.value(index++).toInt();
        node.name_ = query.value(index++).toString();
        node.location_ = query.value(index++).toString();
        node.title_ = query.value(index++).toString();
        node.mutable_authors() = query.value(index++).toString();
        node.mutable_description() = query.value(index++).toString();
        node.mutable_last_access() = query.value(index++).toString();
        node.mutable_publisher() = query.value(index++).toString();
        node.mutable_md5() = url;
        node.mutable_rating() = query.value(index++).toInt();
        node.mutable_read_time() = query.value(index++).toInt();
        node.mutable_read_count() = query.value(index++).toInt();
        node.mutable_progress() = query.value(index++).toString();
        node.mutable_attributes() = query.value(index++).toByteArray();
        return true;
    }
    return false;
}
开发者ID:qbikez,项目名称:booxsdk,代码行数:32,代码来源:content_node.cpp

示例2: fromPath

void ContentNode::fromPath(ContentNode & node,const QString &path)
{
    node.clear();
    QFileInfo info(path);
    node.mutable_name() = info.fileName();
    node.mutable_location() = info.path();
    node.mutable_size() = info.size();
}
开发者ID:qbikez,项目名称:booxsdk,代码行数:8,代码来源:content_node.cpp

示例3: getNContentNodes

bool ContentNode::hasItemNodes()
{
	int nContentNodes = getNContentNodes();
	for (int n=0; n<nContentNodes; n++) {
		ContentNode *cnode = getContentNode(n);
		if (cnode->isItemNode() == true)
			return true;
	}
	return false;
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:10,代码来源:ContentNode.cpp

示例4: getContentNode

bool ContentManager::addToRecentDocuments(const QString &doc_path)
{
    ContentNode node;
    getContentNode(node, doc_path);

    if (node.id() == CMS_INVALID_ID)
    {
        return false;
    }

    return addToRecentDocuments(node.id());
}
开发者ID:peter-x,项目名称:booxsdk,代码行数:12,代码来源:content_manager.cpp

示例5: removeContentNode

/// Remove content metadata for given content node. Caller should no longer
/// use the content node. This function also removes the content node
/// from its parent categories.
bool ContentManager::removeContentNode(ContentNode& info)
{
    // Remove the options.
    ContentOptions::removeOptions(*database_, info.id());

    // Remove from content category table, which also removes
    // from recent document list.
    ContentCategory::removeContentCategory(*database_, info.id());

    // Remove the content itself.
    ContentNode::removeContentNode(*database_, info);
    return true;
}
开发者ID:peter-x,项目名称:booxsdk,代码行数:16,代码来源:content_manager.cpp

示例6: removeContentNode

bool ContentNode::removeContentNode(QSqlDatabase& database,
                                    ContentNode& node)
{
    QSqlQuery query(database);
    query.prepare( "delete from content where id = ?");
    query.addBindValue(node.id());

    if (query.exec())
    {
        node.clear();
        return true;
    }
    return false;
}
开发者ID:qbikez,项目名称:booxsdk,代码行数:14,代码来源:content_node.cpp

示例7: removeChildContent

/// Remove child content from specified category.
bool ContentManager::removeChildContent(ContentCategory & category,
                                        const ContentNode & node)
{
    return ContentCategory::removeChildContent(*database_,
                                               category,
                                               node.id());
}
开发者ID:peter-x,项目名称:booxsdk,代码行数:8,代码来源:content_manager.cpp

示例8: getParentCategories

/// Retrieve parent category id list that contains the content.
bool ContentManager::getParentCategories(const ContentNode &node,
                                         cms_ids & categories)
{
    return ContentCategory::getContentParentCategories(*database_,
                                                       node.id(),
                                                       categories);
}
开发者ID:peter-x,项目名称:booxsdk,代码行数:8,代码来源:content_manager.cpp

示例9: browseMetaData

ContentNode *MediaPlayer::getContentDirectory(Device *dev)
{
	CyberXML::Node *rootNode = browseMetaData(dev, "0", "*", 0, 0, "");
	if (rootNode == NULL)
		return NULL;

	ContentNode *contentRootNode = new RootNode();
	contentRootNode->set(rootNode);
	delete rootNode;

	getContentDirectory(contentRootNode, dev, "0");
	if (Debug::isOn() == true)
		contentRootNode->print();

	return contentRootNode;
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:16,代码来源:MediaPlayer.cpp

示例10: getContentNode

bool ContentManager::removeRecentDocument(const QString &doc_path)
{
    ContentNode node;
    getContentNode(node, doc_path);

    if (node.id() == CMS_INVALID_ID)
    {
        return false;
    }

    if (!ContentCategory::removeChildContent(*database_,
                                             node.id()))
    {
        return false;
    }
    return true;
}
开发者ID:HeryLong,项目名称:booxsdk,代码行数:17,代码来源:content_manager.cpp

示例11: getID

ContentNode *ContentNode::findContentNodeByID(const char *id)
{
	if (id == NULL)
		return NULL;

	string idStr = id;
	const char *nodeID = getID();
	if (idStr.compare(nodeID) == 0)
		return this;

	int nodeCnt = getNContentNodes();
	for (int n=0; n<nodeCnt; n++) {
		ContentNode *cnode = getContentNode(n);
		ContentNode *fnode = cnode->findContentNodeByID(id);
		if (fnode != NULL)
			return fnode;	
	}
		
	return NULL;
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:20,代码来源:ContentNode.cpp

示例12: UpdateItemList

void UpdateItemList(int dirNum)
{
	ListView_DeleteAllItems(ghItemListWindow);

	MediaServer *mserver = gMediaGate->getMediaServer();
	Directory *dir = mserver->getContentDirectory(dirNum);
	if (dir == NULL)
		return;

	LVITEM item = {0};
	item.mask = 0;
	item.mask = LVIF_TEXT;
    TCHAR buf[512] = { 0 } ;
	int itemCnt = dir->getNContentNodes();
	for (int n=0 ; n<itemCnt ; n++) {
		ContentNode *conNode = dir->getContentNode(n);
		if (conNode->isItemNode() == false)
			continue;
		
		ItemNode *itemNode = (ItemNode *)conNode;

        FTL::CFConversion conv;
		item.pszText = (LPTSTR)conv.MBCS_TO_TCHAR(itemNode->getTitle());
		item.iItem = n;
		item.iSubItem = 0;
		ListView_InsertItem(ghItemListWindow , &item);

		item.pszText = (LPTSTR)conv.MBCS_TO_TCHAR(itemNode->getCreator());
		item.iSubItem = 1;
		ListView_SetItem(ghItemListWindow , &item);

		item.pszText = (LPTSTR)conv.MBCS_TO_TCHAR(itemNode->getDate());
		item.iSubItem = 2;
		ListView_SetItem(ghItemListWindow , &item);

		_stprintf(buf, TEXT("%ld"), itemNode->getStorageUsed());
		item.pszText = buf;
		item.iSubItem = 3;
		ListView_SetItem(ghItemListWindow , &item);
	}
}
开发者ID:moon-sky,项目名称:fishjam-template-library,代码行数:41,代码来源:MediaGateMain.cpp

示例13: browseDirectChildren

int MediaPlayer::getContentDirectory(ContentNode *parentNode, Device *dev, const char *objectID)
{
	if (objectID == NULL)
		return 0;

	CyberXML::Node *resultNode = browseDirectChildren(dev, objectID, "*", 0, 0, "");
	if (resultNode == NULL)
		return 0;

	BrowseResult browseResult(resultNode);
	//cout << browseResult.getNContentNodes() << endl;
	int nResultNode = 0;
	int nContents = browseResult.getNContentNodes();
	for (int n=0; n<nContents; n++) {
		Node *xmlNode = browseResult.getContentNode(n);
		ContentNode *contentNode = NULL;
		if (ContainerNode::isContainerNode(xmlNode) == true) {
			contentNode = new ContainerNode();
		}
		if (ItemNode::isItemNode(xmlNode) == true)
			contentNode = new BrowseResultNode();
		if (contentNode == NULL)
			continue;
		contentNode->set(xmlNode);
		parentNode->addContentNode(contentNode);
		nResultNode++;
		// Add Child Nodes
		if (contentNode->isContainerNode() == true) {
			ContainerNode *containerNode = (ContainerNode*)contentNode;
			int childCnt = containerNode->getChildCount();
			if (0 < childCnt) {
				const char *objid = containerNode->getID();
				getContentDirectory(contentNode, dev, objid);
			}
		}
	}
	delete resultNode;

	return nResultNode;
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:40,代码来源:MediaPlayer.cpp

示例14: latestReading

QString ContentManager::latestReading()
{
    QString path;
    cms_ids all;
    if (!getRecentDocuments(all))
    {
        return path;
    }

    if (all.size() <= 0)
    {
        return path;
    }

    ContentNode node;
    if (!getContentNode(all.front(), node))
    {
        return path;
    }

    return node.nativeAbsolutePath();
}
开发者ID:peter-x,项目名称:booxsdk,代码行数:22,代码来源:content_manager.cpp

示例15: getNContentNodes

void DIDLLite::output(std::ostream& ps) 
{
	// Thanks for Brent Hills (10/26/04)
	//ps << SOAP::VERSION_HEADER;

	DIDLLiteNode didlNode;
	
	string name = didlNode.getName();
	string value = didlNode.getValue();
		
	ps << "<" << name;
	didlNode.outputAttributes(ps);
	ps << ">" << endl;

	int nNodes = getNContentNodes();
	for (int n=0; n<nNodes; n++) {
		ContentNode *contentNode = getContentNode(n);
		contentNode->output(ps, 1, false);
	}	

	ps << "</" << name << ">" << endl;
}
开发者ID:moon-sky,项目名称:fishjam-template-library,代码行数:22,代码来源:DIDLLite.cpp


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