cgma
CubitInputFile Struct Reference

#include <CubitInputFile.hpp>

List of all members.

Public Types

enum  FileType { FILE_NORMAL = 1, FILE_FASTQ = 2, FILE_TEMPORARY = 3 }

Public Member Functions

 CubitInputFile (const CubitString &fileName, FileType type=FILE_NORMAL, int loop=1, const CubitString &default_path=CubitString())
 ~CubitInputFile ()

Public Attributes

CubitString filename
CubitFile filePointer
int lineNumber
CubitInputFile::FileType fileType
int loopCount
int breakPoint

Detailed Description

Definition at line 10 of file CubitInputFile.hpp.


Member Enumeration Documentation

Enumerator:
FILE_NORMAL 
FILE_FASTQ 
FILE_TEMPORARY 

Definition at line 12 of file CubitInputFile.hpp.


Constructor & Destructor Documentation

CubitInputFile::CubitInputFile ( const CubitString fileName,
CubitInputFile::FileType  type = FILE_NORMAL,
int  loop = 1,
const CubitString default_path = CubitString() 
) [inline]

Definition at line 36 of file CubitInputFile.hpp.

  : breakPoint(0)
{
  CubitString file_and_path;
  filePointer.open(fileName, "r");

  if (!filePointer && includePath.length()) {
    file_and_path = includePath;
    file_and_path += "/";
    file_and_path += fileName;
    filePointer.open(file_and_path, "r");
  }

  if (filePointer) {
    if (includePath.length())
      filename  = file_and_path;
    else
      filename  = fileName;
  }
  else {
    filename = "<Invalid File>";
    PRINT_WARNING("Could not open file: %s\n", fileName.c_str() );
  }
  lineNumber  = 1;
  fileType = type;
  loopCount = --loop;
}

Definition at line 67 of file CubitInputFile.hpp.

                                       {
  filePointer.close();
  if (fileType == FILE_TEMPORARY)
    CubitFileUtil::remove_file(filename); /* Delete file if temporary */
}

Member Data Documentation

Definition at line 24 of file CubitInputFile.hpp.

Definition at line 21 of file CubitInputFile.hpp.

Definition at line 23 of file CubitInputFile.hpp.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines