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


C++ fstream::peek方法代码示例

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


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

示例1: parseShotTypeList

std::set<wxString> parseShotTypeList(std::fstream &mfilestream)
{
    char c;
    std::set<wxString> types;
    std::string shottypename;
    c = getnextnonwhite(mfilestream);
    if(c!='{') throw parseerror::missing_opening_bracket;
    while(whitespace(mfilestream.peek()))
    {
        c=mfilestream.get();
    }
    if(mfilestream.peek() == '}')
    {
        mfilestream.get();
        return types;
    }
    while(c!='}')
    {
        shottypename = extractQuotedPrefix(mfilestream);
        types.insert(shottypename);
        c = getnextnonwhite(mfilestream);
        if(c!=',' && c!='}') throw parseerror::missing_comma;
    }
    return types;
}
开发者ID:CorinnaL,项目名称:tdeditor,代码行数:25,代码来源:Parser.cpp

示例2: while

//------------------------------------------------------------------------------
/// \brief reads comments
//------------------------------------------------------------------------------
void ProcessorMNW2::impl::ReadComments (std::fstream& a_is,
                                        std::fstream& a_os)
{
  char c = (char)a_is.peek();
  while (c == '#')
  {
    std::string line;
    std::getline(a_is, line);
    // write all the comments back to the file except for #GMS_HDF5_01
    if ("#GMS_HDF5_01" != line)
    {
      a_os << line << "\n";
    }
    c = (char)a_is.peek();
  }
} // ProcessorMNW2::impl::ReadComments
开发者ID:Aquaveo,项目名称:MFLib,代码行数:19,代码来源:ProcessorMNW2.cpp

示例3: extractNumber

std::string extractNumber(std::fstream &mfilestream)
{
    char c;
    std::string entry;
    do
    {
        mfilestream.get(c);
        entry+=c;
        c = mfilestream.peek();
    }
    while (c!=','&&c!='}'&&c!=')');
    return entry;
}
开发者ID:CorinnaL,项目名称:tdeditor,代码行数:13,代码来源:Parser.cpp

示例4: parseVC

void parseVC( std::fstream &file, std::string array_name, unsigned long int **array, char *chars,
		const unsigned int s, const unsigned long int P, const char skip=1 ) {
	std::string line;
	unsigned long int uli;
	std::cout << "Will read " << array_name << std::endl;
	if( skip )
		file.getline( chars, 500 ); //go past EOL
	if( file.peek() != '%' ) {
		std::cout << "Not at header line!" << std::endl;
		file >> line;
		std::cout << line << std::endl;
		file >> line;
		std::cout << line << std::endl;
		exit( 1 );
	}
开发者ID:ryancoleman,项目名称:lotsofcoresbook1code,代码行数:15,代码来源:McShared.cpp

示例5: Peek

char Scanner::Peek()
{
	return file_.peek();
}
开发者ID:OkabeRintarou,项目名称:syl,代码行数:4,代码来源:FAO.cpp


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