demo.cpp
/* Read source code from source file.
 */
Read source code from source file.
Read source code from source file .
string Support::ReadLine(const char *filename, int minline, int maxline){
    int lines,i=0;
    string temp;
    string contents = "";
    fstream file;
    file.open(filename,ios::in);
    if(file.fail())
    {
        return "Error 2: file do not exists!";
    }
    while(getline(file,temp))
    {
        i++;
        if((i >= minline - 1) && (i <= maxline+2 ) ){
            contents += temp + "\n";
        }
    }
    file.close();
    return contents;
}
string Support :: ReadLine ( const char * filename , int minline , int maxline ) { int lines , i = 0 ; string temp ; string contents = " " ; fstream file ; file . open ( filename , ios :: in ) ; if ( file . fail ( ) ) { return " " ; } while ( getline ( file , temp ) ) { i ++ ; if ( ( i >= minline - 1 ) && ( i <= maxline + 2 ) ) { contents += temp + " \n " ; } } file . close ( ) ; return contents ; }
Read source code from source file.
Read source code from source file .
//errs() << temp << "\n";