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


C++ doc函数代码示例

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


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

示例1: module

void CSwordModuleInfo::buildIndex() {
	wchar_t wcharBuffer[BT_MAX_LUCENE_FIELD_LENGTH + 1];

	//we don't want the linked entries indexed again
	module()->setSkipConsecutiveLinks(true);

	m_cancelIndexing = false;

	//Without this we don't get strongs, lemmas, etc
	backend()->setFilterOptions ( CBTConfig::getFilterOptionDefaults() );
	//make sure we reset all important filter options which influcence the plain filters.
	backend()->setOption( CSwordModuleInfo::strongNumbers,  false );
	backend()->setOption( CSwordModuleInfo::morphTags,  false );
	backend()->setOption( CSwordModuleInfo::morphSegmentation,  false );
	backend()->setOption( CSwordModuleInfo::footnotes,  false );
	backend()->setOption( CSwordModuleInfo::headings,  false );
	backend()->setOption( CSwordModuleInfo::scriptureReferences,  false );
	backend()->setOption( CSwordModuleInfo::redLetterWords,  false );

	// do not use any stop words
	const TCHAR* stop_words[]  = { NULL };
	lucene::analysis::standard::StandardAnalyzer an( (const TCHAR**)stop_words );
	QString index = getModuleStandardIndexLocation();

	QDir dir("/");
	dir.mkpath( getGlobalBaseIndexLocation() );
	dir.mkpath( getModuleBaseIndexLocation() );
	dir.mkpath( getModuleStandardIndexLocation() );

	if (lucene::index::IndexReader::indexExists(index.toAscii().constData())) {
		if (lucene::index::IndexReader::isLocked(index.toAscii().constData()) ) {
			lucene::index::IndexReader::unlock(index.toAscii().constData());
		}
	}

	boost::scoped_ptr<lucene::index::IndexWriter> writer( new lucene::index::IndexWriter(index.toAscii().constData(), &an, true) ); //always create a new index
	writer->setMaxFieldLength(BT_MAX_LUCENE_FIELD_LENGTH);
	writer->setUseCompoundFile(true); //merge segments into a single file
	writer->setMinMergeDocs(1000);

	*m_module = sword::TOP;
	unsigned long verseLowIndex = m_module->Index();
	*m_module = sword::BOTTOM;
	unsigned long verseHighIndex = m_module->Index();

	//verseLowIndex is not 0 in all cases (i.e. NT-only modules)
	unsigned long verseIndex = verseLowIndex + 1;
	unsigned long verseSpan = verseHighIndex - verseLowIndex;

	//Index() is not implemented properly for lexicons, so we use a
	//workaround.
	if (type() == CSwordModuleInfo::Lexicon){
		verseIndex = 0;
		verseLowIndex = 0;
		verseSpan = ((CSwordLexiconModuleInfo*)this)->entries()->size();
	}

	emit indexingProgress(0);

	sword::SWKey* key = m_module->getKey();
	//VerseKey for bibles
	sword::VerseKey* vk = dynamic_cast<sword::VerseKey*>(key);

	if (vk) {
		// we have to be sure to insert the english key into the index, otherwise we'd be in trouble if the language changes
		vk->setLocale("en_US");
		//If we have a verse based module, we want to include the pre-chapter etc. headings in the search
		vk->Headings(1);
	}

	//holds UTF-8 data and is faster than QString.
	QByteArray textBuffer;

	// we start with the first module entry, key is automatically updated
	// because key is a pointer to the modules key
	m_module->setSkipConsecutiveLinks(true);
	for (*m_module = sword::TOP; !(m_module->Error()) && !m_cancelIndexing; (*m_module)++) {

		//If it is a sword-heading, store in buffer and index later in Verse X:1
		if (vk) {
			if (vk->Verse() == 0) {
				textBuffer.append( m_module->StripText() );
				continue;
			}
		}

		boost::scoped_ptr<lucene::document::Document> doc(new lucene::document::Document());

		//index the key
		lucene_utf8towcs(wcharBuffer, key->getText(), BT_MAX_LUCENE_FIELD_LENGTH);
		//doc->add(*lucene::document::Field::UnIndexed((const TCHAR*)_T("key"), (const TCHAR*)wcharBuffer));
		doc->add(*(new lucene::document::Field((const TCHAR*)_T("key"), (const TCHAR*)wcharBuffer, lucene::document::Field::STORE_YES | lucene::document::Field::INDEX_NO)));
		// index the main text
		//at this point we have to make sure we disabled the strongs and the other options
		//so the plain filters won't include the numbers somehow.
		lucene_utf8towcs(wcharBuffer, (const char*) textBuffer.append(m_module->StripText()), BT_MAX_LUCENE_FIELD_LENGTH);
		//doc->add(*lucene::document::Field::UnStored((const TCHAR*)_T("content"), (const TCHAR*)wcharBuffer));
		doc->add(*(new lucene::document::Field((const TCHAR*)_T("content"), (const TCHAR*)wcharBuffer, lucene::document::Field::STORE_NO | lucene::document::Field::INDEX_TOKENIZED)));
		textBuffer.resize(0); //clean up

//.........这里部分代码省略.........
开发者ID:bibletime,项目名称:historic-bibletime-svn,代码行数:101,代码来源:cswordmoduleinfo.cpp

示例2: doc

void EmoteDB::load()
{
    if (mLoaded)
        return;

    mLastEmote = 0;

    EmoteSprite *unknownSprite = new EmoteSprite;
    unknownSprite->sprite = AnimatedSprite::load("error.xml");
    unknownSprite->name = "unknown";
    mUnknown.sprites.push_back(unknownSprite);

    logger->log("Initializing emote database...");

    XML::Document doc("emotes.xml");
    xmlNodePtr rootNode = doc.rootNode();

    if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "emotes"))
    {
        logger->log("Emote Database: Error while loading emotes.xml!");
        return;
    }

    //iterate <emote>s
    for_each_xml_child_node(emoteNode, rootNode)
    {
        if (!xmlStrEqual(emoteNode->name, BAD_CAST "emote"))
            continue;

        int id = XML::getProperty(emoteNode, "id", -1);
        if (id == -1)
        {
            logger->log("Emote Database: Emote with missing ID in emotes.xml!");
            continue;
        }

        EmoteInfo *currentInfo = new EmoteInfo;

        for_each_xml_child_node(spriteNode, emoteNode)
        {
            if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite"))
            {
                EmoteSprite *currentSprite = new EmoteSprite;
                std::string file = "graphics/sprites/" + (std::string)
                            (const char*) spriteNode->xmlChildrenNode->content;
                currentSprite->sprite = AnimatedSprite::load(file,
                                XML::getProperty(spriteNode, "variant", 0));
                currentInfo->sprites.push_back(currentSprite);
            }
            else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx"))
            {
                std::string particlefx = (const char*) spriteNode->xmlChildrenNode->content;
                currentInfo->particles.push_back(particlefx);
            }
        }
        mEmoteInfos[id] = currentInfo;
        if (id > mLastEmote)
            mLastEmote = id;
    }

    mLoaded = true;
}
开发者ID:kai62656,项目名称:manabot,代码行数:62,代码来源:emotedb.cpp

示例3: read_rotation_information

/*! \brief This function reads the input file containing the details of the transformation being used.*/
int read_rotation_information(struct parameter_struct *parameters){
	string filename(parameters->rotation_info_file);
	PetscErrorCode ierr;
	
	//open rotation file as xml document.
	TiXmlDocument doc(filename);
	bool loadOkay = doc.LoadFile();
	if ( !loadOkay ) 
	{
		PetscPrintf(PETSC_COMM_WORLD,"Could not load rotation info file '%s'. Error='%s'. Exiting.\n", parameters->rotation_info_file, doc.ErrorDesc() );
		return 1;
	}
	TiXmlHandle docHandle(&doc);
	
	//find ROTATION_OP tag.
	
	parameters->number_rotation_sectors = 1;
	
	TiXmlElement* parent_element = docHandle.FirstChild("ROTATION_OPS").Element(); 	
	if ( parent_element) 
	  {
	    if (parent_element->Attribute("number") == NULL ) 
	      { 
		PetscPrintf(PETSC_COMM_WORLD,"You must specify the number of rotation operators.\n");
		return 1;
	      }
	    parameters->number_rotation_ops = atoi(parent_element->Attribute("number"));
	    
	    ierr = PetscMalloc(parameters->number_rotation_ops *sizeof(struct rotation_information), &parameters->rotation_info); CHKERRQ(ierr);
	    
	    for ( int rot_idx = 0 ; rot_idx < parameters->number_rotation_ops ; rot_idx ++ ) 
	      {
			TiXmlElement* element = docHandle.FirstChild("ROTATION_OPS").Child("ROTATION_OP", rot_idx).Element(); //tags surrounding the mapping. Has attribute "number" which contains the 
														  //number of times the rotation op can be applied before getting back to the start.
			TiXmlElement* element2;
			if ( element) 
			{	
				if (element->Attribute("number") == NULL ) { 
					PetscPrintf(PETSC_COMM_WORLD,"You must specify a number attribute to the rotation operation.\n");
					return 1;
				}

				parameters->rotation_info[rot_idx].num_sectors = atoi(element->Attribute("number"));
				parameters->rotation_info[rot_idx].num_relevant_sectors = parameters->rotation_info[rot_idx].num_sectors;
				parameters->number_rotation_sectors *= parameters->rotation_info[rot_idx].num_sectors;
				
				ierr = PetscMalloc( parameters->rotation_info[rot_idx].num_sectors * sizeof(PetscScalar),&parameters->rotation_info[rot_idx].phases);CHKERRQ(ierr);
				
				//allocate space for the mapping masks.
				ierr = PetscMalloc( parameters->rotation_info[rot_idx].num_sectors * sizeof(uPetscInt*),&parameters->rotation_info[rot_idx].mapping_masks);CHKERRQ(ierr);
				for ( int i = 0 ; i < parameters->rotation_info[rot_idx].num_sectors ; i++ ) {
					ierr = PetscMalloc(parameters->number_particles * sizeof(uPetscInt), &parameters->rotation_info[rot_idx].mapping_masks[i]);CHKERRQ(ierr);
				}
				
				//applying 0 rotations will give the same stage so add masks that do not move any particles.
				for ( int i = 0 ; i < parameters->number_particles ; i++ ) {
					parameters->rotation_info[rot_idx].mapping_masks[0][i] = ((uPetscInt)1) << i;
				}
				
				//read in the mappings to position 1 which is a single rotation with the op.
				for ( int i = 0 ; i < parameters->number_particles ; i++ ) {
					element2 = docHandle.FirstChild("ROTATION_OPS").Child("ROTATION_OP", rot_idx).Child("MAPPING",i).Element();
					if ( element2 ) {
						parameters->rotation_info[rot_idx].mapping_masks[1][atoi(element2->Attribute("to"))-1] = ((uPetscInt)1) << (atoi(element2->Attribute("from"))-1);
					} else {
						PetscPrintf(PETSC_COMM_WORLD,"Mapping %d does not exist.\n",i);
						return 1;
					}
				}
				
				//Now iterate this rotation to fill in the masks for the other possible mutiples of the rotation.
				for ( int i = 2 ; i < parameters->rotation_info[rot_idx].num_sectors ; i++ ) {
					for ( int j = 0 ; j < parameters->number_particles ; j++ ) {
						parameters->rotation_info[rot_idx].mapping_masks[i][j] = parameters->rotation_info[rot_idx].mapping_masks[1][log2_uPetscInt(parameters->rotation_info[rot_idx].mapping_masks[i-1][j])];
					}
				}
												
				//print out the mapping for each number of rotations that can be applied. For debugging purposes. 
				/*for (int i = 0 ; i < parameters->rotation_info.num_sectors ; i++ ) {
					PetscPrintf(PETSC_COMM_WORLD,"Applying %d rotations:\n",i);
					for ( int j = 0 ; j < parameters->number_particles ; j++ ) {
						PetscPrintf(PETSC_COMM_WORLD,"Site %d moved to site %d.\n",j,(int)log2_uPetscInt(parameters->rotation_info.mapping_masks[i][j]));
					}
				}*/
				
				parameters->rotation_info[rot_idx].sector_modulo = 1;
				parameters->rotation_info[rot_idx].sector_divisor = 1;
				for ( int j = 0 ; j <= rot_idx ; j++ )
				{
					parameters->rotation_info[rot_idx].sector_modulo *= parameters->rotation_info[j].num_sectors;
					if ( j <  rot_idx) parameters->rotation_info[rot_idx].sector_divisor *= parameters->rotation_info[j].num_sectors;
				}
				
				
			} else {
				PetscPrintf(PETSC_COMM_WORLD,"No ROTATION_OP %d tag in rotation info file.\n",rot_idx);
				return 1;
			}
	      }
//.........这里部分代码省略.........
开发者ID:nmoran,项目名称:DoQO,代码行数:101,代码来源:rotation.C

示例4: next

 Data next() {
     Document doc(_cursor->next());
     return make_pair(_sorter->extractKey(doc), doc);
 }
开发者ID:ChrisKozak,项目名称:mongo,代码行数:4,代码来源:document_source_sort.cpp

示例5: load_db_init

int		load_db_init(t_db_info *db_info, t_cfg *cfg)
{
  std::string	gamepath(std::string(cfg->GamePath) + std::string(cfg->Game));
  TiXmlDocument doc(gamepath.c_str());
  const char	*buf;
  int		int_buf;
  int		i;
  char		err_msg[BUF_SIZE];
  
  if (doc.LoadFile() == false)
    {
      char	*err = "Failed to load game database file: ";
      strcpy(err_msg, err);
      strcat(err_msg, gamepath.c_str());
      //send_error_trap(err_msg, 1);
      return (put_error(err_msg));
    }
  puts("\n<load_db_init>");
  TiXmlElement* elm_root = doc.FirstChildElement("root");
  if (elm_root)
    {
      TiXmlElement* elm_head = elm_root->FirstChildElement("head");
      if (elm_head)
	{
	  TiXmlElement* elm_version = elm_head->FirstChildElement("version");
	  if (elm_version)
	    {
	      if ((buf = elm_version->Attribute("db_name")) == NULL)
		return(put_error("DB is imcomplete: db_name"));
	      strcpy(db_info->game, (char*)buf);
	      printf("Game: [%s]\n", db_info->game);
	      
	      if ((buf = elm_version->Attribute("db_verion")) == NULL)
		return(put_error("DB is imcomplete: db_verion"));
	      strcpy(db_info->version, (char*)buf);
	      printf("version: [%s]\n", db_info->version);
	    }
	  else
	    return(put_error("DB as not members name <version> in <head>"));
	}
      else
	return(put_error("DB as not members name <head> in <root>"));

      TiXmlElement* elm_races = elm_root->FirstChildElement("races");
      if (elm_races)
	{
	  TiXmlElement* elm_race = elm_races->FirstChildElement("race");
	  if (elm_race)
	    {
	      if ((buf = elm_race->Attribute("name")) == NULL)
		return(put_error("DB is imcomplete: race name"));
	      strcpy(db_info->races[0], (char*)buf);
	      printf("race[0]: [%s]\n", db_info->races[0]);
	    }
	  else
	    return(put_error("DB as not members name <race> in <races>"));
	  for (i = 1; elm_race = elm_race->NextSiblingElement("race"); i++)
	    {
	      if ((buf = elm_race->Attribute("name")) == NULL)
		return(put_error("DB is imcomplete: race name"));
	      strcpy(db_info->races[i], (char*)buf);
	      printf("race[%i]: [%s]\n", i, db_info->races[i]);
	    }
	  db_info->races[i][0] = 0;
	}	  
      else
	return(put_error("DB as not members name <races> in <head>"));

      TiXmlElement* elm_maps = elm_root->FirstChildElement("maps");
      if (elm_maps)
	{
	   TiXmlElement* elm_map = elm_maps->FirstChildElement("map");
	  if (elm_map)
	    {
	      if ((buf = elm_map->Attribute("name")) == NULL)
		return(put_error("DB is imcomplete: map name"));
	      strcpy(db_info->map_def[0].name, (char*)buf);
	      printf("map[0]: [%s]", db_info->map_def[0].name);

	      if ((elm_map->QueryIntAttribute((const char*)"max_players", &int_buf))
		  != TIXML_SUCCESS)
		return(put_error("DB is imcomplete: map max_players"));
	      db_info->map_def[0].max_players = int_buf;
	      printf(" max_players: [%i]\n", db_info->map_def[0].max_players);
	      
	    }
	  else
	    return(put_error("DB as not members name <map> in <maps>"));
	  for (i = 1; elm_map = elm_map->NextSiblingElement("map"); i++)
	    {
	      if ((buf = elm_map->Attribute("name")) == NULL)
		return(put_error("DB is imcomplete: map name"));
	      strcpy(db_info->map_def[i].name, (char*)buf);
	      printf("map[%i]: [%s]", i, db_info->map_def[i].name);
	   
	      if ((elm_map->QueryIntAttribute((const char*)"max_players", &int_buf))
		  != TIXML_SUCCESS)
		return(put_error("DB is imcomplete: map max_players"));
	      db_info->map_def[i].max_players = int_buf;
	      printf(" max_players: [%i]\n", db_info->map_def[i].max_players);
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:freewar-svn,代码行数:101,代码来源:load_db_init.cpp

示例6: doc

	RenderContext* RenderContext::LoadXML(const char* xmlFileNamePtr, const char* indentifier)
	{
		TiXmlDocument doc((ContentManager::theContentPath + xmlFileNamePtr).c_str());

		if(!doc.LoadFile())
		{
			InternalOutput::GetReference().Error(
				"Failed to load %s, does the file exist?\n", xmlFileNamePtr);
			return 0;
		}

		TiXmlHandle hDoc(&doc);
		TiXmlElement* elementPtr;
		TiXmlHandle hRoot(0);

		elementPtr = hDoc.FirstChildElement().Element();
		if( !elementPtr )
		{
			InternalOutput::GetReference().Error(
				"Failed to load %s, is the file empty?\n", xmlFileNamePtr);
			return 0;
		}

		std::string rootName = elementPtr->Value();

		if( strcmp(rootName.c_str(), "GDRenderContext") != 0 )
		{
			InternalOutput::GetReference().Error(
				"Failed to load %s, missing a GDRenderContext element\n", 
				xmlFileNamePtr);
			return 0;
		}

		TiXmlElement* pMaterialElement = elementPtr->FirstChildElement("Material");

		std::string materialString;
		std::string shaderEffectString;
		std::string techniqueString;
		std::string vertexFormatString;
		std::string castShadowString;
		std::string renderStyleString;

		if( pMaterialElement != 0 )
		{
			if(pMaterialElement->GetText() != 0)
				materialString = pMaterialElement->GetText();
		}

		// Error check for old Effect based shader usage
		TiXmlElement* pEffectElement = elementPtr->FirstChildElement("Effect");
		if(nullptr == pEffectElement )
		{
			InternalOutput::GetReference().Error(
				"Failed to load %s, missing Effect element", xmlFileNamePtr);
			return 0;
		}
		shaderEffectString = pEffectElement->GetText();

		TiXmlElement* pTechniqueElement = elementPtr->FirstChildElement("Technique");

		if( pTechniqueElement != 0 )
		{
			if( pTechniqueElement->GetText() != 0 )
				techniqueString = pTechniqueElement->GetText();
		}

		if( techniqueString.length() == 0 )
			techniqueString = "Basic";

		TiXmlElement* pVertexFormatElement = elementPtr->FirstChildElement("VertexFormat");

		if( pVertexFormatElement == 0 )
		{
			InternalOutput::GetReference().Error(
				"Failed to load %s, missing a VertexFormat element\n", xmlFileNamePtr);
			return 0;
		}

		vertexFormatString = pVertexFormatElement->GetText();

		bool isDeferredPointLightContext = false;
		TiXmlElement* pPointLightTechnique = elementPtr->FirstChildElement("PointLightTechnique");
		if( pPointLightTechnique != 0 )
		{
			if( pPointLightTechnique->GetText() != 0 )
			{
				std::string technique = pPointLightTechnique->GetText();
				if( technique.length() != 0 )
					isDeferredPointLightContext = true;
			}

		}	
		bool isDeferredDirLightContext = false;
		TiXmlElement* pDirLightTechnique = elementPtr->FirstChildElement("DirLightTechnique");
		if( pDirLightTechnique != 0 )
		{
			if( pDirLightTechnique->GetText() != 0 )
			{
				std::string technique = pDirLightTechnique->GetText();
				if( technique.length() != 0 )
//.........这里部分代码省略.........
开发者ID:Burnsidious,项目名称:FSGDEngine,代码行数:101,代码来源:RenderContext.cpp

示例7: loadDetailsFromXML

static bool loadDetailsFromXML(const QString &filename, FileDetails *details)
{
    QDomDocument doc("mydocument");
    QFile file(filename);
    if (!file.open(QIODevice::ReadOnly))
        return false;

    if (!doc.setContent(&file))
    {
        file.close();
        return false;
    }
    file.close();

    QString docType = doc.doctype().name();

    if (docType == "MYTHARCHIVEITEM")
    {
        QDomNodeList itemNodeList = doc.elementsByTagName("item");
        QString type, dbVersion;

        if (itemNodeList.count() < 1)
        {
            LOG(VB_GENERAL, LOG_ERR,
                "Couldn't find an 'item' element in XML file");
            return false;
        }

        QDomNode n = itemNodeList.item(0);
        QDomElement e = n.toElement();
        type = e.attribute("type");
        dbVersion = e.attribute("databaseversion");
        if (type == "recording")
        {
            QDomNodeList nodeList = e.elementsByTagName("recorded");
            if (nodeList.count() < 1)
            {
                LOG(VB_GENERAL, LOG_ERR,
                    "Couldn't find a 'recorded' element in XML file");
                return false;
            }

            n = nodeList.item(0);
            e = n.toElement();
            n = e.firstChild();
            while (!n.isNull())
            {
                e = n.toElement();
                if (!e.isNull())
                {
                    if (e.tagName() == "title")
                        details->title = e.text();

                    if (e.tagName() == "subtitle")
                        details->subtitle = e.text();

                    if (e.tagName() == "starttime")
                        details->startTime = MythDate::fromString(e.text());

                    if (e.tagName() == "description")
                        details->description = e.text();
                }
                n = n.nextSibling();
            }

            // get channel info
            n = itemNodeList.item(0);
            e = n.toElement();
            nodeList = e.elementsByTagName("channel");
            if (nodeList.count() < 1)
            {
                LOG(VB_GENERAL, LOG_ERR,
                    "Couldn't find a 'channel' element in XML file");
                details->chanID = "";
                details->chanNo = "";
                details->chanName = "";
                details->callsign =  "";
                return false;
            }

            n = nodeList.item(0);
            e = n.toElement();
            details->chanID = e.attribute("chanid");
            details->chanNo = e.attribute("channum");
            details->chanName = e.attribute("name");
            details->callsign =  e.attribute("callsign");
            return true;
        }
        else if (type == "video")
        {
            QDomNodeList nodeList = e.elementsByTagName("videometadata");
            if (nodeList.count() < 1)
            {
                LOG(VB_GENERAL, LOG_ERR,
                    "Couldn't find a 'videometadata' element in XML file");
                return false;
            }

            n = nodeList.item(0);
            e = n.toElement();
//.........这里部分代码省略.........
开发者ID:Beirdo,项目名称:mythtv-stabilize,代码行数:101,代码来源:importnative.cpp

示例8: file

void AProProject::parseFile()
{
    if(fileName.isEmpty())
    {
        QMessageBox::warning(0,"Erreur","Le projet spécifié n'existe pas !");
        return;
    }
    QFile file(fileName);
    if (!file.open(QIODevice::ReadOnly))
    {
        QMessageBox::warning(0,"Erreur","Le projet spécifié n'existe pas !");
        return;
    }
    QDomDocument doc("projet");
    if (!doc.setContent(&file))
        return;

    file.close();

    QDomElement root = doc.documentElement();
    if (root.tagName()!="aproject")
        return;

    version = root.attribute("version","");
    if (version != APROJECT_CURRENT_VERSION)
        return;

    QDomNode n = root.firstChild();
    while(!n.isNull())
    {
        QDomElement e = n.toElement();
        if (!e.isNull())
        {
            if (e.tagName()=="config")
            {
                name = e.attribute("name","");
            }
            else if (e.tagName()=="files")
            {
                if (e.attribute("type","") == "src")
                {
                    QDomNode n2 = e.firstChild();
                    while (!n2.isNull())
                    {
                        QDomElement e2 = n2.toElement();
                        if (!e2.isNull())
                        {
                            QString src = e2.attribute("src","");
                            Sources.append(src);
                        }
                        n2 = n2.nextSibling();
                    }
                }

                if (e.attribute("type","") == "header")
                {
                    QDomNode n2 = e.firstChild();
                    while (!n2.isNull())
                    {
                        QDomElement e2 = n2.toElement();
                        if (!e2.isNull())
                        {
                            QString h = e2.attribute("src","");
                            Headers.append(h);
                        }
                        n2 = n2.nextSibling();
                    }
                }
            }
        }
        n = n.nextSibling();
    }
}
开发者ID:luk2010,项目名称:apronavigator,代码行数:73,代码来源:AProProject.cpp

示例9: disconnect

void QgsLayerStylingWidget::setLayer( QgsMapLayer *layer )
{
  if ( layer == mCurrentLayer )
    return;

  if ( mCurrentLayer )
  {
    disconnect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) );
  }

  if ( !layer || !layer->isSpatial() )
  {
    mLayerCombo->setLayer( nullptr );
    mStackedWidget->setCurrentIndex( mNotSupportedPage );
    mLastStyleXml.clear();
    mCurrentLayer = nullptr;
    return;
  }

  bool sameLayerType = false;
  if ( mCurrentLayer )
  {
    sameLayerType =  mCurrentLayer->type() == layer->type();
  }

  mCurrentLayer = layer;

  mUndoWidget->setUndoStack( layer->undoStackStyles() );

  connect( mCurrentLayer, SIGNAL( styleChanged() ), this, SLOT( updateCurrentWidgetLayer() ) );

  int lastPage = mOptionsListWidget->currentIndex().row();
  mOptionsListWidget->blockSignals( true );
  mOptionsListWidget->clear();
  mUserPages.clear();
  if ( layer->type() == QgsMapLayer::VectorLayer )
  {
    QListWidgetItem* symbolItem = new QListWidgetItem( QgsApplication::getThemeIcon( "propertyicons/symbology.svg" ), QString() );
    symbolItem->setData( Qt::UserRole, Symbology );
    symbolItem->setToolTip( tr( "Symbology" ) );
    mOptionsListWidget->addItem( symbolItem );
    QListWidgetItem* labelItem = new QListWidgetItem( QgsApplication::getThemeIcon( "labelingSingle.svg" ), QString() );
    labelItem->setData( Qt::UserRole, VectorLabeling );
    labelItem->setToolTip( tr( "Labels" ) );
    mOptionsListWidget->addItem( labelItem );
  }
  else if ( layer->type() == QgsMapLayer::RasterLayer )
  {
    QListWidgetItem* symbolItem = new QListWidgetItem( QgsApplication::getThemeIcon( "propertyicons/symbology.svg" ), QString() );
    symbolItem->setData( Qt::UserRole, Symbology );
    symbolItem->setToolTip( tr( "Symbology" ) );
    mOptionsListWidget->addItem( symbolItem );
    QListWidgetItem* transparencyItem = new QListWidgetItem( QgsApplication::getThemeIcon( "propertyicons/transparency.png" ), QString() );
    transparencyItem->setToolTip( tr( "Transparency" ) );
    transparencyItem->setData( Qt::UserRole, RasterTransparency );
    mOptionsListWidget->addItem( transparencyItem );

    if ( static_cast<QgsRasterLayer*>( layer )->dataProvider()->capabilities() & QgsRasterDataProvider::Size )
    {
      QListWidgetItem* histogramItem = new QListWidgetItem( QgsApplication::getThemeIcon( "propertyicons/histogram.png" ), QString() );
      histogramItem->setData( Qt::UserRole, RasterHistogram );
      mOptionsListWidget->addItem( histogramItem );
      histogramItem->setToolTip( tr( "Histogram" ) );
    }
  }

  Q_FOREACH ( QgsMapLayerConfigWidgetFactory* factory, mPageFactories )
  {
    if ( factory->supportsStyleDock() && factory->supportsLayer( layer ) )
    {
      QListWidgetItem* item =  new QListWidgetItem( factory->icon(), QString() );
      item->setToolTip( factory->title() );
      mOptionsListWidget->addItem( item );
      int row = mOptionsListWidget->row( item );
      mUserPages[row] = factory;
    }
  }
  QListWidgetItem* historyItem = new QListWidgetItem( QgsApplication::getThemeIcon( "mActionHistory.svg" ), QString() );
  historyItem->setData( Qt::UserRole, History );
  historyItem->setToolTip( tr( "History" ) );
  mOptionsListWidget->addItem( historyItem );
  mOptionsListWidget->blockSignals( false );

  if ( sameLayerType )
  {
    mOptionsListWidget->setCurrentRow( lastPage );
  }
  else
  {
    mOptionsListWidget->setCurrentRow( 0 );
  }

  mStackedWidget->setCurrentIndex( 1 );

  QString errorMsg;
  QDomDocument doc( "style" );
  mLastStyleXml = doc.createElement( "style" );
  doc.appendChild( mLastStyleXml );
  mCurrentLayer->writeStyle( mLastStyleXml, doc, errorMsg );
}
开发者ID:fritsvanveen,项目名称:QGIS,代码行数:100,代码来源:qgslayerstylingwidget.cpp

示例10: doc

//---------------------------------------------------------------------------
void TLevWrt::Load_Level(const char *fn)
{
// этот кусок кода пожаловал сюда прямиком из myRiseOfAtlantis :)
// -> с некоторыми изменениями, конечно :)
	const char *pfile = "file", *pobject = "object", *plock = "lock",
                   *pbackground = "background", *psunp = "sun p";
	const char *elementName, *type, *path, *xp, *yp;
	float xpos, ypos;

	TiXmlDocument doc(fn);
	doc.LoadFile();
	TiXmlElement* root = doc.FirstChildElement("level");
	TiXmlElement* element = root->FirstChildElement();

	while (element != NULL)
{
	elementName = element->Value();
	if (stricmp(elementName, pfile) == 0)//file
	{
		TiXmlAttribute* fattr = element->FirstAttribute();//first attribute
		if (fattr)
		{
			type = fattr->Value();
			TiXmlAttribute* sattr = fattr->Next();//second attribute
			path = sattr->Value();
			xp = NULL;
			yp = NULL;
                if (stricmp(type, pbackground) == 0)
                {
                  ObjType0->Text = type;
                  FilePath0->Text = path;
                } else
                if (stricmp(type, plock) == 0)
                {
                  ObjType7->Text = type;
                  FilePath7->Text = path;
                } else
                if (strstr(type, psunp) != NULL)
                {
                   String s = path;
                   char *c = s.c_str();
                   Make_Objects(c);
                } else
                for (int i = 0; i <= 7; i++)
                {
                String comp_name = compObjType + IntToStr(i);
                TComponent* comp = FindComponent(comp_name);
                TComboBox* box = dynamic_cast<TComboBox*>(comp);
                if (box->Text == "")
                {
                 box->Text = type;
                 String comp_name2 = compFilePath + IntToStr(i);
                 TComponent* comp2 = FindComponent(comp_name2);
                 TEdit* edit = dynamic_cast<TEdit*>(comp2);
                 edit->Text = path;
                break;
                }
                }
		element = element->NextSiblingElement();
		}
	} else
	if (stricmp(elementName, pobject) == 0)//object
	{
		TiXmlAttribute* fattr = element->FirstAttribute();//first attribute
		if (fattr)
		{
			type = fattr->Value();
			TiXmlAttribute* sattr = fattr->Next();//second attribute
			xp = sattr->Value();
			TiXmlAttribute* tattr = sattr->Next();//third attribute
			yp = tattr->Value();
			if (xp != NULL)
			{
			xpos = atof(xp);
			}
			if (yp != NULL)
			{
			ypos = atof(yp);
			}
                        for (int i = 1; i <= 121; i++)
                        {
                         String comp_name = compPanel + IntToStr(i);
                         TComponent* comp = FindComponent(comp_name);
                         TPanel* panel = dynamic_cast<TPanel*>(comp);
                         if ((panel->Left == xpos) && (panel->Top == ypos))
                         {
                          if (stricmp(type, plock) == 0)
                          {
                           panel->Color = clBlack;
                           panel->Font->Color = clWhite;
                          } else
                          if (stricmp(type, pbackground) == 0)
                          {
                           break;
                          } else {
                          panel->Caption = type;
                          panel->Color = clWhite;
                          }
                         }
//.........这里部分代码省略.........
开发者ID:yurembo,项目名称:XMLLevelWriter,代码行数:101,代码来源:main.cpp

示例11: getView

PView *GMSH_TriangulatePlugin::execute(PView *v)
{
  int iView = (int)TriangulateOptions_Number[0].def;

  PView *v1 = getView(iView, v);
  if(!v1) return v;
  PViewData *data1 = v1->getData();

  if(data1->hasMultipleMeshes()){
    Msg::Error("Triangulate plugin cannot be applied to multi-mesh views");
    return v1;
  }

  // create list of points with associated data
  std::vector<MVertex*> points;
  int numSteps = data1->getNumTimeSteps();
  for(int ent = 0; ent < data1->getNumEntities(0); ent++){
    for(int ele = 0; ele < data1->getNumElements(0, ent); ele++){
      if(data1->skipElement(0, ent, ele)) continue;
      if(data1->getNumNodes(0, ent, ele) != 1) continue;
      int numComp = data1->getNumComponents(0, ent, ele);
      double x, y, z;
      data1->getNode(0, ent, ele, 0, x, y, z);
      PointData *p = new PointData(x, y, z, numComp * numSteps);
      for(int step = 0; step < numSteps; step++)
        for(int comp = 0; comp < numComp; comp++)
          data1->getValue(step, ent, ele, 0, comp, p->v[3 + numComp * step + comp]);
      points.push_back(p);
    }
  }

  if(points.size() < 3){
    Msg::Error("Need at least 3 points to triangulate");
    for(unsigned int i = 0; i < points.size(); i++)
      delete points[i];
    return v1;
  }

  // project points onto plane
  discreteFace *s = new discreteFace
    (GModel::current(), GModel::current()->getNumFaces() + 1);
  s->computeMeanPlane(points);
  double plan[3][3];
  s->getMeanPlaneData(plan);
  for(unsigned int i = 0; i < points.size(); i++) project(points[i], plan);
  delete s;

  // get lc
  SBoundingBox3d bbox;
  for(unsigned int i = 0; i < points.size(); i++) bbox += points[i]->point();
  double lc = norm(SVector3(bbox.max(), bbox.min()));

  // build a point record structure for the divide and conquer algorithm
  DocRecord doc(points.size());
  for(unsigned int i = 0; i < points.size(); i++){
    double XX = CTX::instance()->mesh.randFactor * lc * (double)rand() / (double)RAND_MAX;
    double YY = CTX::instance()->mesh.randFactor * lc * (double)rand() / (double)RAND_MAX;
    doc.points[i].where.h = points[i]->x() + XX;
    doc.points[i].where.v = points[i]->y() + YY;
    doc.points[i].adjacent = NULL;
    doc.points[i].data = (void*)points[i];
  }

  // triangulate
  doc.MakeMeshWithPoints();

  // create output (using unperturbed data)
  PView *v2 = new PView();
  PViewDataList *data2 = getDataList(v2);
  for(int i = 0; i < doc.numTriangles; i++){
    PointData *p[3];
    p[0] = (PointData*)doc.points[doc.triangles[i].a].data;
    p[1] = (PointData*)doc.points[doc.triangles[i].b].data;
    p[2] = (PointData*)doc.points[doc.triangles[i].c].data;
    int numComp = 0;
    std::vector<double> *vec = 0;
    if((int)p[0]->v.size() == 3 + 9 * numSteps &&
       (int)p[1]->v.size() == 3 + 9 * numSteps &&
       (int)p[2]->v.size() == 3 + 9 * numSteps){
      numComp = 9; data2->NbTT++; vec = &data2->TT;
    }
    else if((int)p[0]->v.size() == 3 + 3 * numSteps &&
            (int)p[1]->v.size() == 3 + 3 * numSteps &&
            (int)p[2]->v.size() == 3 + 3 * numSteps){
      numComp = 3; data2->NbVT++; vec = &data2->VT;
    }
    else{
      numComp = 1; data2->NbST++; vec = &data2->ST;
    }
    for(int nod = 0; nod < 3; nod++) vec->push_back(p[nod]->v[0]);
    for(int nod = 0; nod < 3; nod++) vec->push_back(p[nod]->v[1]);
    for(int nod = 0; nod < 3; nod++) vec->push_back(p[nod]->v[2]);
    for(int step = 0; step < numSteps; step++)
      for(int nod = 0; nod < 3; nod++)
        for(int comp = 0; comp < numComp; comp++)
          vec->push_back(p[nod]->v[3 + numComp * step + comp]);
  }

  for(unsigned int i = 0; i < points.size(); i++)
    delete points[i];
//.........这里部分代码省略.........
开发者ID:cycheung,项目名称:gmsh,代码行数:101,代码来源:Triangulate.cpp

示例12: config

bool StringReplacerProc::init(KConfig* c, const QString& configGroup){
    //kDebug() << "StringReplacerProc::init: Running";
    QString wordsFilename =
        KGlobal::dirs()->saveLocation( "data" ,QLatin1String( "kttsd/stringreplacer/" ), false );
    if ( wordsFilename.isEmpty() ) return false;
    wordsFilename += configGroup;
    KConfigGroup config( c, configGroup );
    wordsFilename = config.readEntry( "WordListFile", wordsFilename );

    // Open existing word list.
    QFile file( wordsFilename );
    if ( !file.open( QIODevice::ReadOnly ) )
    {
        //kDebug() << "StringReplacerProc::init: couldn't open file " << wordsFilename;
        return false;
    }
    QDomDocument doc( QLatin1String( "" ) );
    if ( !doc.setContent( &file ) ) {
        //kDebug() << "StringReplacerProc::init: couldn't get xml from file " << wordsFilename;
        file.close();
        return false;
    }
    file.close();

    // Clear list.
    m_matchList.clear();
    m_substList.clear();

    // Name setting.
    // QDomNodeList nameList = doc.elementsByTagName( "name" );
    // QDomNode nameNode = nameList.item( 0 );
    // m_widget->nameLineEdit->setText( nameNode.toElement().text() );

    // Language Codes setting.  List may be single element of comma-separated values,
    // or multiple elements.
    m_languageCodeList.clear();
    QDomNodeList languageList = doc.elementsByTagName( QLatin1String( "language-code" ) );
    for ( int ndx=0; ndx < languageList.count(); ++ndx )
    {
        QDomNode languageNode = languageList.item( ndx );
        m_languageCodeList += languageNode.toElement().text().split( QLatin1Char(','), QString::SkipEmptyParts);
    }

    // AppId.  Apply this filter only if DCOP appId of application that queued
    // the text contains this string.  List may be single element of comma-separated values,
    // or multiple elements.
    m_appIdList.clear();
    QDomNodeList appIdList = doc.elementsByTagName( QLatin1String( "appid" ) );
    for ( int ndx=0; ndx < appIdList.count(); ++ndx )
    {
        QDomNode appIdNode = appIdList.item( ndx );
        m_appIdList += appIdNode.toElement().text().split( QLatin1Char( ',' ), QString::SkipEmptyParts);
    }

    // Word list.
    QDomNodeList wordList = doc.elementsByTagName(QLatin1String( "word" ) );
    const int wordListCount = wordList.count();
    for (int wordIndex = 0; wordIndex < wordListCount; ++wordIndex)
    {
        QDomNode wordNode = wordList.item(wordIndex);
        QDomNodeList propList = wordNode.childNodes();
        QString wordType;
        QString matchCase = QLatin1String( "No" ); // Default for old (v<=3.5.3) config files with no <case/>.
        QString match;
        QString subst;
        const int propListCount = propList.count();
        for (int propIndex = 0; propIndex < propListCount; ++propIndex)
        {
            QDomNode propNode = propList.item(propIndex);
            QDomElement prop = propNode.toElement();
            if (prop.tagName() == QLatin1String( "type" )) wordType = prop.text();
            if (prop.tagName() == QLatin1String( "case" )) matchCase = prop.text();
            if (prop.tagName() == QLatin1String( "match" ))
            {
                match = prop.text();
                cdataUnescape( &match );
            }
            if (prop.tagName() == QLatin1String( "subst" ))
            {
                subst = prop.text();
                cdataUnescape( &subst );
            }
        }
        // Build Regular Expression for each word's match string.
        QRegExp rx;
        rx.setCaseSensitivity(matchCase == QLatin1String( "Yes" )?Qt::CaseInsensitive:Qt::CaseSensitive);
        if ( wordType == QLatin1String( "Word" ) )
        {
                // TODO: Does \b honor strange non-Latin1 encodings?
            rx.setPattern( QLatin1String( "\\b" ) + match + QLatin1String( "\\b" ) );
        }
        else
        {
            rx.setPattern( match );
        }
            // Add Regular Expression to list (if valid).
        if ( rx.isValid() )
        {
            m_matchList.append( rx );
            m_substList.append( subst );
//.........这里部分代码省略.........
开发者ID:fluxer,项目名称:kde-extraapps,代码行数:101,代码来源:stringreplacerproc.cpp

示例13: factors

/*! Reads the entire interface from a file, looking for keywords 
	inside the file. Loads the size of the dof space, all eg's
	(which define the size of the eg space), any normalization
	factors (optional) and the origin of the eg space (optional).

	The size of the dof space must be loaded before any eg's, 
	origin, etc can be loaded; is must also match the number of
	dof's in this robot.
*/
int
EigenGraspInterface::readFromFile(QString filename)
{
    //open xml file at "filename"
    	bool ok;
    	QString fileType = filename.section('.',-1,-1);
	QString xmlFilename;
	if (fileType == "xml"){
		//the file itself is XML
		xmlFilename = filename;
	} else {
	    	QTWARNING("Could not open " + xmlFilename);
		DBGA("Old non-xml file format is no longer supported");
		return 0;
	}

    	//load the graspit specific information in XML format or fail
	TiXmlDocument doc(xmlFilename);
	if(doc.LoadFile()==false){
		DBGA("Failed to open EG file: " << filename.latin1());
		QTWARNING("Could not open " + xmlFilename);
		return 0;
	}
    //get the dimensions
	int numDims = 0;
	QString valueStr;
	clear();
	TiXmlElement* root = doc.RootElement();
    	if(root == NULL){
		DBGA("The "<<filename.toStdString()<<" file must contain a root tag named EigenGrasps.");
		return 0;
	} else{
		valueStr = root->Attribute("dimensions");
		numDims = valueStr.toDouble(&ok); if (!ok) {DBGA("ERROR: Dimension should contain a number.");return 0;}
		if (numDims <= 0) {
		    	DBGA("invalid number of dimensions in EigenGrasps tag in file: "<<filename.toStdString());
			return 0;
		}
	}

    //get the list of EG's 
	std::list<const TiXmlElement*> elementList = findAllXmlElements(root, "EG");
	int numEG = countXmlElements(root, "EG");
	if (numEG < 1) {
		DBGA("Number of Eigengrasps specified: " << numEG);
		return 0;
	}
	std::list<const TiXmlElement*>::iterator p = elementList.begin();
	while(p!=elementList.end()){
		EigenGrasp *newGrasp = new EigenGrasp(numDims);
	    	if (!newGrasp->readFromXml(*p++)) return 0;
		newGrasp->normalize();
		mGrasps.push_back(newGrasp);
	}


    //get the orgin and process (if none setsimpleorgin)
	elementList = findAllXmlElements(root, "ORIGIN");
	int numORG = countXmlElements(root, "ORIGIN");
	if (!numORG) {
	    	DBGA("No EG origin found; using automatic origin");
		mOrigin = new EigenGrasp(numDims);
		setSimpleOrigin();
	}
	else if(numORG==1)
	{
		mOrigin = new EigenGrasp(numDims);
		if (!mOrigin->readFromXml(*(elementList.begin()))){ return 0;}
		checkOrigin();
	}
	else
	{
	    	DBGA("Multiple Origins specified in Eigen Grasp file.");
		return 0;
	}

    //get the norm and process (if none set to all 1's)
	elementList = findAllXmlElements(root, "NORM");
	int numNORM = countXmlElements(root, "NORM");
	if (!numNORM) {
		DBGA("No normalization data found; using factors of 1.0");
		mNorm = new EigenGrasp(numDims);
		mNorm->setOnes();
	}
	else if(numNORM==1)
	{
		mNorm = new EigenGrasp(numDims);
		if (!mNorm->readFromXml(*(elementList.begin()))){ return 0;}
		DBGA("EG Normalization data loaded from file");
	}
	else
//.........这里部分代码省略.........
开发者ID:GraspControl,项目名称:graspit,代码行数:101,代码来源:eigenGrasp.cpp

示例14: doc

 void TinyXMLParser::parseXMLFile(XMLHandler& handler, const String& filename, const String& schemaName, const String& resourceGroup)
 {
   TinyXMLDocument doc(handler, filename, schemaName, resourceGroup);
 }
开发者ID:Silentfood,项目名称:oonline,代码行数:4,代码来源:CEGUITinyXMLParser.cpp

示例15: MyException

//Get max and min chage but also check what type of a,b,c,x,y,z score/ions are present
void TandemReader::getMaxMinCharge(const std::string &fn, bool isDecoy){
  
  int nTot = 0, charge = 0;
  
  namespace xml = xsd::cxx::xml;
 
  ifstream ifs;
  ifs.exceptions(ifstream::badbit|ifstream::failbit);
    
  ifs.open(fn.c_str());
  if (!ifs)
  {
    ostringstream temp;
    temp << "Error : can not open file " << fn << std::endl;
    throw MyException(temp.str());
  }
  parser p;
  
  try
  {
    xml_schema::dom::auto_ptr< xercesc::DOMDocument> 
    doc (p.start (ifs, fn.c_str(),true, schemaDefinition,schema_major, schema_minor, scheme_namespace,true));
    assert(doc.get());
    
    for (doc = p.next(); doc.get() != 0; doc = p.next ())
    {  
      //Check that the tag name is group and that its not the inputput parameters
      if(XMLString::equals(groupStr,doc->getDocumentElement()->getTagName()) 
	&& XMLString::equals(groupModelStr,doc->getDocumentElement()->getAttribute(groupTypeStr)))  
      {
	      tandem_ns::group groupObj(*doc->getDocumentElement()); //Parse to the codesynthesis object model
	        
	      if(groupObj.z().present()) //We are sure we are not in parameters group so z(the charge) has to be present.
	      {
	        stringstream chargeStream (stringstream::in | stringstream::out);
	        chargeStream << groupObj.z();
	        chargeStream >> charge;
	        if (minCharge > charge) minCharge = charge;
	        if (maxCharge < charge) maxCharge = charge;
	        nTot++;
	      }
	      else
	      {
	        ostringstream temp;
	        temp << "Missing charge(attribute z in group element) for one or more groups in: " << fn << endl;
	        throw MyException(temp.str());
	      }
	      if(firstPSM)
	      {
	        //Check what type of scores/ions are present
	        BOOST_FOREACH (const tandem_ns::protein &protObj, groupObj.protein()) { //Protein
	          tandem_ns::protein::peptide_type peptideObj=protObj.peptide(); //Peptide
	          BOOST_FOREACH(const tandem_ns::domain &domainObj, peptideObj.domain()) { //Domain
	            //x,y,z
	            if (domainObj.x_score().present() && domainObj.x_ions().present()) {
            		x_score=true;
	            }
	            if (domainObj.y_score().present() && domainObj.y_ions().present()) {
            		y_score=true;
	            }
	            if (domainObj.z_score().present() && domainObj.z_ions().present()) {
		            z_score=true;
	            }
	            //a,b,c
	            if (domainObj.a_score().present() && domainObj.a_ions().present()) {
            		a_score=true;
	            }
	            if (domainObj.b_score().present() && domainObj.b_ions().present()) {
            		b_score=true;
	            }
	            if (domainObj.c_score().present() && domainObj.c_ions().present()) {
            		c_score=true;
	            }
	          } //End of for domain
	        } //End of for prot
	        firstPSM=false;
	      }
      }
开发者ID:Dapid,项目名称:percolator,代码行数:79,代码来源:TandemReader.cpp


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