Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# gnFileSource Class Reference

gnFileSource is a standard interface to all file based sources of genetic information. More...

`#include <gnFileSource.h>`

Inheritance diagram for gnFileSource::

List of all members.

## Public Methods
| gnFileSource ()
| gnFileSource (const gnFileSource &gnfs)
virtual | ~gnFileSource ()
virtual gnFileSource* | Clone () const=0
virtual void | Open (string openString)
| Opens the source given in "openString" for reading. More...
virtual void | Open ()
| Opens this source for reading. More...
virtual void | Close ()
| Closes the file or connection this source is reading from. More...
virtual string | GetOpenString () const
| Get the location of the source that is being used. More...
virtual const gnFilter* | GetFilter () const
| Get the filter currently being used to filter unwanted characters out of read sequences. More...
virtual void | SetFilter (gnFilter *filter)
| Set the filter that will be used to filter unwanted characters out of the sequence data. More...
virtual boolean | Read (const uint64 pos, char *buf, uint32 &bufLen)
| Gets raw input from this source. More...
virtual gnFileContig* | GetFileContig (const uint32 contigI) const=0
| Returns a pointer to the file contig corresponding to contigI or null if none exists. More...
## Protected Attributes
string | m_openString
ifstream | m_ifstream
const gnFilter* | m_pFilter
gnNewlineType | m_newlineType
uint32 | m_newlineSize
## Private Methods
virtual boolean | ParseStream (istream &fin)=0

## Detailed Description

gnFileSource is a standard interface to all file based sources of genetic information.

All file source classes are derived from this class.

Definition at line 28 of file gnFileSource.h.

## Constructor & Destructor Documentation

gnFileSource::gnFileSource ( | )`[inline]`

| Definition at line 31 of file gnFileSource.h.

gnFileSource::gnFileSource ( | const gnFileSource & gnfs )

| Definition at line 19 of file gnFileSource.cpp.

gnFileSource::~gnFileSource ( | )`[inline, virtual]`

| Definition at line 33 of file gnFileSource.h.

## Member Function Documentation

gnFileSource * gnFileSource::Clone ( | ) const`[pure virtual]`

| Reimplemented from gnBaseSource. Reimplemented in gnABISource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource.

void gnFileSource::Close ( | )`[virtual]`

  | Closes the file or connection this source is reading from. Exceptions:
  IOStreamError | if an error occurs closing the file.
Reimplemented from gnBaseSource. Definition at line 57 of file gnFileSource.cpp.

gnFileContig * gnFileSource::GetFileContig ( | const uint32 contigI ) const`[pure virtual]`

| Returns a pointer to the file contig corresponding to contigI or null if none exists. Reimplemented in gnABISource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource.

const gnFilter * gnFileSource::GetFilter ( | ) const`[inline, virtual]`

| Get the filter currently being used to filter unwanted characters out of read sequences. Returns: A pointer to the gnFilter currently in use. Reimplemented from gnBaseSource. Definition at line 67 of file gnFileSource.h.

string gnFileSource::GetOpenString ( | ) const`[inline, virtual]`

| Get the location of the source that is being used. Returns: The location string describing this source, usually a file name. Reimplemented from gnBaseSource. Definition at line 61 of file gnFileSource.h.

void gnFileSource::Open ( | )`[virtual]`

  | Opens this source for reading. Exceptions:
  Will | throw a FileNotOpened exception if the file was not found or was not accessible.
Reimplemented from gnBaseSource. Definition at line 49 of file gnFileSource.cpp. Referenced by main().

void gnFileSource::Open ( | string openString )`[virtual]`

  | Opens the source given in "openString" for reading. Parameters:
  openString | The name of the source (file, network URL, or database) to open.
  Exceptions:
  Will | throw a FileNotOpened exception if the file was not found or was not accessible. Will propagate a FileUnreadable exception if the file format was invalid.
Reimplemented from gnBaseSource. Definition at line 30 of file gnFileSource.cpp.

boolean gnFileSource::ParseStream ( | istream & fin )`[private, pure virtual]`

| Reimplemented in gnABISource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. Referenced by Open().

boolean gnFileSource::Read ( | const uint64 pos,
| char * buf,
| uint32 & bufLen )`[virtual]`

  | Gets raw input from this source. Read will attempt to read "bufLen" bytes starting at "pos" directly from the source. It stores the data in "buf", and returns the actual number of bytes read in bufLen. Read will return false if a serious error occurs. Parameters:
  pos | The position in the file to start reading.
  buf | The character array to store data into.
  len | The number of bytes to read.
Returns: True if the operation was successful. Reimplemented from gnBaseSource. Definition at line 64 of file gnFileSource.cpp. Referenced by gnRAWSource::SeqRead().

void gnFileSource::SetFilter ( | gnFilter * filter )`[inline, virtual]`

  | Set the filter that will be used to filter unwanted characters out of the sequence data. Parameters:
  filter | The filter to remove unwanted characters from the sequence.
  Exceptions:
  NullPointer | is thrown if the specified filter pointer is null.
Reimplemented from gnBaseSource. Definition at line 73 of file gnFileSource.h.

## Member Data Documentation

ifstream gnFileSource::m_ifstream`[protected]`

| Definition at line 52 of file gnFileSource.h.

uint32 gnFileSource::m_newlineSize`[protected]`

| Definition at line 55 of file gnFileSource.h.

gnNewlineType gnFileSource::m_newlineType`[protected]`

| Definition at line 54 of file gnFileSource.h.

string gnFileSource::m_openString`[protected]`

| Definition at line 51 of file gnFileSource.h.

const gnFilter * gnFileSource::m_pFilter`[protected]`

| Definition at line 53 of file gnFileSource.h.

The documentation for this class was generated from the following files:

- gnFileSource.h
- gnFileSource.cpp