• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ parseFile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testParseFile

void testParseFile()
{
	packets results;
	//parseFile("c:\\Users\\David\\Documents\\packets.txt", -1, -1, results);
	//parseFile("c:\\Users\\David\\Documents\\packets.txt", -1, 30, results);
	parseFile("c:\\Users\\David\\Documents\\packets.txt", 2, 4, results);
}
开发者ID:omegadrh,项目名称:PacketParser,代码行数:7,代码来源:PacketParser.cpp


示例2: lock

void KernelSourceParser::WorkerThread::run()
{
    QString currentFile;
    QMutexLocker lock(&_parser->_filesMutex);
    _stopExecution = false;

    while (!_stopExecution && !Console::interrupted() &&
           _parser->_filesIndex < _parser->_fileNames.size())
    {
        currentFile = _parser->_fileNames[_parser->_filesIndex++];
        _parser->_currentFile = currentFile;

        if (_parser->_filesIndex <= 1)
            _parser->operationProgress();
        else
            _parser->checkOperationProgress();
        lock.unlock();

        parseFile(currentFile);

        lock.relock();
        _parser->_bytesRead += QFileInfo(_parser->_srcDir, currentFile).size();
        _parser->_durationLastFileFinished = _parser->_duration;
    }
}
开发者ID:wxdublin,项目名称:insight-vmi,代码行数:25,代码来源:kernelsourceparser.cpp


示例3: main

int main(int argc, char *argv[])
{
	char * fileName;

	fileName = NULL;

	if(argc < 2)
	{
		printf("Error: Please enter a file name.\n");
		return 1;
	}
	if(argv[1] == NULL)
	{
		printf("Error: No file name given.\n");
		return 1;
	}

	fileName = argv[1];

	printf("File = %s\n", fileName);
	parseFile(fileName);


	return 0;
}
开发者ID:RyanLafferty,项目名称:StateBasedParsing,代码行数:25,代码来源:Parser.c


示例4: parseFile

void QoreProgram::parseFileAndRun(const char* filename) {
   ExceptionSink xsink;

   parseFile(filename, &xsink);

   if (!xsink.isEvent()) {
      // get class name
      if (priv->exec_class) {
	 if (!priv->exec_class_name.empty())
	    runClass(priv->exec_class_name.c_str(), &xsink);
	 else {
	    char* c, *bn = q_basenameptr(filename);
	    if (!(c = strrchr(bn, '.')))
	       runClass(filename, &xsink);
	    else {
	       QoreString qcn; // for possible class name
	       qcn.concat(bn, c - bn);
	       runClass(qcn.getBuffer(), &xsink);
	    }
	 }
      }
      else
	 run(&xsink);
   }
}
开发者ID:temnoregg,项目名称:qore,代码行数:25,代码来源:QoreProgram.cpp


示例5: parseFile

void UserController::onInit(InitEvent &evt)
{
	robotName = "robot_000";
    
	//m_kinect = connectToService("SIGKINECT");
	//m_hmd = connectToService("SIGHMD");
	parseFile("command.txt");
    Mission_complete = false;
	//printf("Reslutat %s", rooms[2]);
	rooms.clear();
	objects.clear();
	m_message = 10 ;

	cycle = 0;
    m_state =20;
	srand(time(NULL));

	//初期位置の設定
	SimObj *my = this->getObj(this->myname());
	m_posx = my->x();
	m_posy = my->y();
	m_posz = my->z();
	m_range = 0.1;
	m_maxsize = 15;
}
开发者ID:menphim,项目名称:RoboCupatHomeSim,代码行数:25,代码来源:Human_agent.cpp


示例6: initDefaults

ntlWorld::ntlWorld(string filename, bool commandlineMode) 
{
#ifndef ELBEEM_PLUGIN

		initDefaults();
#	ifdef NOGUI
		commandlineMode = true; // remove warning...
#	endif // NOGUI

		// load config
		setPointers( getRenderGlobals() );
		parseFile( filename.c_str() );
#	ifndef NOGUI
		// setup opengl display, save first animation step for start time 
		// init after parsing file...
		if(!commandlineMode) {
			mpOpenGLRenderer = new ntlOpenGLRenderer( mpGlob );
		}
#	endif // NOGUI
		finishWorldInit();

#else // ELBEEM_PLUGIN
	errFatal("ntlWorld::init","Cfg file parsing not supported for API version! "<<filename<<" "<<commandlineMode, SIMWORLD_INITERROR);
#endif // ELBEEM_PLUGIN
}
开发者ID:Aligorith,项目名称:blender,代码行数:25,代码来源:ntl_world.cpp


示例7: _tmain

int _tmain(int argc, char* argv[])
{
	char *inFile = NULL;
	outFormat format = NOTSET;
	int rowStart = -1;
	int rowEnd = -1;
	packets parsedList;

#ifdef _DEBUG
	testparseQueryString();
	testParseFile();
#endif

	printf("Content-Type: text/xml\n\n");

	if (!checkArgs(argc, argv, &inFile, format, rowStart, rowEnd))
	{
		printUsage();
		return -1;
	}

	parseFile(inFile, rowStart, rowEnd, parsedList);

	outputInfo(parsedList, format);

	return 0;
}
开发者ID:omegadrh,项目名称:PacketParser,代码行数:27,代码来源:PacketParser.cpp


示例8: Vec3f

SceneParser::SceneParser(const char* filename) {

  // initialize some reasonable default values
  group = NULL;
  camera = NULL;
  background_color = Vec3f(0.5,0.5,0.5);
  ambient_light = Vec3f(0,0,0);
  num_lights = 0;
  lights = NULL;
  num_materials = 0;
  materials = NULL;
  current_material = NULL;

  // parse the file
  assert(filename != NULL);
  const char *ext = &filename[strlen(filename)-4];
  assert(!strcmp(ext,".txt"));
  file = fopen(filename,"r");
  assert (file != NULL);
  parseFile();
  fclose(file); 
  file = NULL;

  // if no lights are specified, set ambient light to white 
  // (do solid color ray casting)
  if (num_lights == 0) {
    printf ("WARNING:  No lights specified\n");
    ambient_light = Vec3f(1,1,1);
  }
}
开发者ID:alexunder,项目名称:X-toys,代码行数:30,代码来源:scene_parser.cpp


示例9: main

int main(int argc,char* argv[])
{
	// Use a try/catch block for parser exceptions
	try
	{
		// if we have at least one command-line argument
		if (argc > 1 )
		{
			cerr << "Parsing..." << endl;

			// for each file specified on the command line
			for(int i=1; i< argc;i++)
			{
				cerr << "   " << argv[i] << endl;
				parseFile(argv[i]);
			}
		}
		else
			cerr << "Usage: " << argv[0]
			<< " <file name(s)>" << endl;
	}
	catch(exception& e) {
		cerr << "exception: " << e.what() << endl;
	}
}
开发者ID:BackupTheBerlios,项目名称:ccl-plugin,代码行数:25,代码来源:Main.cpp


示例10:

MeshModel *Loader_3DS::load( const string &filename,const Transform &t,int hint ){

	conv_tform=t;
	conv=flip_tris=false;
	if( conv_tform!=Transform() ){
		conv=true;
		if( conv_tform.m.i.cross(conv_tform.m.j).dot(conv_tform.m.k)<0 ) flip_tris=true;
	}

	collapse=!!(hint&MeshLoader::HINT_COLLAPSE);
	animonly=!!(hint&MeshLoader::HINT_ANIMONLY);

	if( !in.open( filename.c_str(),ios_base::in|ios_base::binary ) ){
		return 0;
	}

	MeshModel *root=parseFile();
	in.close();

	materials_map.clear();
	name_map.clear();
	id_map.clear();

	return root;
}
开发者ID:littlewater,项目名称:blitz3d,代码行数:25,代码来源:loader_3ds.cpp


示例11: main

int main(){
	exception e;
	VTDGen *vg = NULL;
	VTDNav *vn = NULL;
	AutoPilot *ap = NULL;
	UCSChar *string = NULL; 
	int i;
    
	Try{
		ap = createAutoPilot2();
		selectXPath(ap,L"/a/b/text()");
		vg = createVTDGen();
		if (parseFile(vg,FALSE,"d:/ximpleware_2.2_c/vtd-xml/codeGuru/2/input.xml")){
			vn = getNav(vg);
			bind(ap,vn);
			while((i=evalXPath(ap))!=-1){
				string = toString(vn,i);
				wprintf(L"the text node value is %d ==> %s \n",i,string);
				free(string);
			}
			free(vn->XMLDoc);
		} else {
			free(vg->XMLDoc);
		}
	}Catch(e){// handle various types of exceptions here
	}
	freeAutoPilot(ap);
	freeVTDGen(vg);
	freeVTDNav(vn);
	return 0;
}
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:31,代码来源:xpath.c


示例12: ossimRpcModel

//*****************************************************************************
//  CONSTRUCTOR: ossimNitfRpcModel
//  
//  Constructs given filename for NITF file
//  
//*****************************************************************************
ossimNitfRpcModel::ossimNitfRpcModel(const ossimFilename& nitfFile)
   :
   ossimRpcModel(),
   theDecimation(1.0)
{
   if (traceExec())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): entering..."
         << std::endl;
   }
   if(!parseFile(nitfFile))
   {
      if (traceExec())
      {
         ossimNotify(ossimNotifyLevel_DEBUG)
            << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): Unable to parse file " << nitfFile
            << std::endl;
      }
      ++theErrorStatus;
   }

   if (traceExec())
   {
      ossimNotify(ossimNotifyLevel_DEBUG)
         << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): returning..."
         << std::endl;
   }
}
开发者ID:LucHermitte,项目名称:ossim,代码行数:35,代码来源:ossimNitfRpcModel.cpp


示例13: parseFile

bool parseFile(Game& game, const char* filename)
{
  //bool value;
  FILE* in = fopen(filename, "r");
  //int size;
  if(!in)
    return false;

  parseFile(in);

  sexp_t* st = NULL;

  while((st = parse()))
  {
    if( !parseSexp(game, st) )
    {
      while(parse()); //empty the file, keep Lex happy.
      fclose(in);
      return false;
    }
    destroy_sexp(st);
  }

  fclose(in);

  return true;
}
开发者ID:siggame,项目名称:chess,代码行数:27,代码来源:parseGamelog.cpp


示例14: parseFile

void HippoGridManager::loadFromFile()
{
	mDefaultGridsVersion = 0;
	// load user grid info
	parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"), false);
	// merge default grid info, if newer. Force load, if list of grids is empty.
	parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty());
	// merge grid info from web site, if newer. Force load, if list of grids is empty.
	if (gSavedSettings.getBOOL("CheckForGridUpdates"))
		parseUrl("http://imprudenceviewer.org/app/grids/", !mGridInfo.empty());

	std::string last_grid = gSavedSettings.getString("LastSelectedGrid");
	if (last_grid.empty()) last_grid = gSavedSettings.getString("DefaultGrid");
	setDefaultGrid(last_grid);
	setCurrentGrid(last_grid);
}
开发者ID:ArminW,项目名称:imprudence,代码行数:16,代码来源:hippoGridManager.cpp


示例15: parseFile

ProjectSPtr ProjectParserMixin::parseProject(const ProjectParseContextSPtr& context)
{
    TokenizerPtr& tokenizer = context->tokenizer;

    context->mProject = boost::make_shared<Project>();

    FileSPtr file = parseFile(context);
    if (!file)
        return ProjectSPtr();

    if (!context->mProject->mainFile())
        context->mProject << file;

    CommentSPtr pStatementComment = lastComment(context);
    while (tokenizer->current())
    {
        if (tokenizer->check(Token::TYPE_IDENTIFIER))
        {
            parseProjectStatement(context, pStatementComment);
        }
        else
        {
            tokenizer->shift();
        }
        pStatementComment = lastComment(context);
    }

    if (context->mMessageCollector->severity() > Message::SEVERITY_WARNING)
        return ProjectSPtr();

    return context->mProject;
}
开发者ID:ggeorgiev,项目名称:compil,代码行数:32,代码来源:project_parser-mixin.cpp


示例16: main

int main(){
	exception e;
	VTDGen *vg = NULL;
	VTDNav *vn = NULL;
	AutoPilot *ap1 = NULL;
	FILE *f = NULL;
	UCSChar *string = NULL;
	int i;
	Try{			
		vg = createVTDGen();		
		if (parseFile(vg,TRUE,"d:/ximpleware_2.2_c/vtd-xml/codeGuru/13/old_cd.xml")==FALSE){
			free(vg->XMLDoc);
			freeVTDGen(vg);
			return 0;
		}	
		ap1 = createAutoPilot2();
		selectXPath(ap1,L"/CATALOG/CD[PRICE=10.2]/*/text()");
		vn = getNav(vg);
		bind(ap1,vn);
		while((i=evalXPath(ap1))!=-1){
			overWrite(vn,i,"",0,0);		
		}
		f= fopen("d:/ximpleware_2.2_c/vtd-xml/codeGuru/13/new_cd.xml","wb");
		fwrite(vn->XMLDoc+vn->docOffset,1,vn->docLen,f);
		fclose(f);
		free(vn->XMLDoc);
	}Catch(e){// handle various types of exceptions here
	}
	freeAutoPilot(ap1);
	freeVTDGen(vg);
	freeVTDNav(vn);
	return 0;
}
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:33,代码来源:erase.c


示例17: main

int main(){
	exception e;
	VTDGen *vg = NULL;
	VTDNav *vn = NULL;
	UCSChar *string = NULL;
	Try{
		vg = createVTDGen();
		if (parseFile(vg,TRUE,"d:/ximpleware_2.2_c/vtd-xml/codeGuru/1/input.xml")){
			vn = getNav(vg);
			if (toElementNS(vn,FIRST_CHILD,L"someURL",L"b")){
				int i = getText(vn);
				if (i!=-1){
					string = toString(vn,i);
					wprintf(L"the text node value is %d ==> %s \n",i,string);
					free(string);
				}
			}
			free(vn->XMLDoc);
		} else {
			free(vg->XMLDoc);
		}
	}Catch(e){// handle various types of exceptions here
	}
	freeVTDGen(vg);
	freeVTDNav(vn);
	return 0;
}
开发者ID:IgorBabalich,项目名称:vtd-xml,代码行数:27,代码来源:hello_world.c


示例18: CGICoreModule__WHILE__Process

void CGICoreModule__WHILE__Process(Properties *x, const char *data){
   if (!x    ) return;
   if (!data ) return;

   while (x->getAsInt("NAME"))
      parseFile(data);
};
开发者ID:nmmmnu,项目名称:ccc,代码行数:7,代码来源:module.for.cpp


示例19: parseFile

void ConfigFile::setOption(const std::string &_option, const std::string &_val) {
    if (!m_fileIsParsed) {
        parseFile("vk_layer_settings.txt");
    }

    m_valueMap[_option] = _val;
}
开发者ID:AdamRLukaitis,项目名称:VulkanSamples,代码行数:7,代码来源:vk_layer_config.cpp


示例20: exploreDirectories

/*
	exploreDirectories travels through directories given a char* inputname.
		Recursive calls are initiated on file pointers until Files are reached.
		The base case handles files by calling parseFile.

	@param inputname : input directory name
*/
int exploreDirectories(char* inputname)
{

	/* enum value will keep record of current type */
	enum{File, Directory} type 		= Directory;
	
	void *fileptr					= opendir(inputname);
	struct dirent *entry;

	if(fileptr == NULL){
		type 		= File;
		fileptr 	= fopen(inputname, "r+");
		
		if(fileptr == NULL){
			perror(fileptr);
			return 0;
		}
	}

	/* Current recursive iteration is a directory */
	if(type == Directory){

		DIR *directory 	= (DIR *)fileptr;
		for(;;){
			entry 	= readdir(directory);

			/* Empty directory */
			if(entry == NULL){
				break;
			}

			/* Protection against recursing backwards */
			if(!strcmp(entry->d_name,".") || !strcmp(entry->d_name,"..")){
				continue;
			}

			/* Save filepath as string */
			char* next 	= (char *)malloc(strlen(inputname) + strlen(entry->d_name) + 2);
			strcpy(next, inputname);
			strcat(next, "/");
			strcat(next, entry->d_name);

			/* Recursive call */
			//printf("Current directory:\t%s\n",next);
			exploreDirectories(next);
			free(next);
		}
		closedir(directory);

	}
	/* Current recursive iteration is a file (Base case) */
	else{
		//printf(">>Exploring file:\t%s \n", inputname);
		FILE *file = (FILE *)fileptr;
		parseFile(file, inputname);
		fclose(file);
	}

	return 0;
}
开发者ID:rshnn,项目名称:indexer,代码行数:67,代码来源:indexer.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ parseFloat函数代码示例发布时间:2022-05-30
下一篇:
C++ parseExpression函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap