Main Page | File List

xcplusplus.h

Go to the documentation of this file.
00001 /**
00002  *\file         xcplusplus.h
00003  *
00004  *\brief        extensions to c++ library.
00005  *
00006  *\author       Xianming Chen
00007  *
00008  *\date          2 Aug 2004
00009  */
00010 
00011 
00012 #ifndef _XCPLUSPLUS_H
00013 #define _XCPLUSPLUS_H
00014 
00015 #include <fstream>
00016 #include <iostream>
00017 
00018 // skip the entire current line.
00019 inline void skip_line(istream& is)
00020 {
00021   char next;
00022   while( is >> noskipws >> next && next != '\n' );
00023 }
00024 
00025 //if all lines starting with 'comment_tag'.
00026 inline bool skip_comment_lines(istream& is, char comment_tag)
00027 {
00028   char next;
00029   while( is >> skipws >> next ) 
00030   {
00031     is.putback(next);
00032     if(next == comment_tag) skip_line(is);
00033     else
00034       return true;
00035   }
00036   return false;
00037 }
00038 
00039 
00040 
00041 
00042 const double pi = 3.1416;
00043   
00044 
00045 #endif

Generated on Mon Aug 2 16:51:15 2004 by doxygen 1.3.6