Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
//------------------------------------------------------------------------------
/// \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
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
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 );
	}
Exemplo n.º 5
0
char Scanner::Peek()
{
	return file_.peek();
}