gnSourceHeader.cpp Source File

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

# gnSourceHeader.cpp

Go to the documentation of this file.

    00001 /////////////////////////////////////////////////////////////////////////////
    00002 // File:            gnSourceHeader.cpp
    00003 // Purpose:         Source Header class
    00004 // Description:     Provides an interface for Headers on disk.
    00005 // Changes:
    00006 // Version:         libGenome 0.5.1
    00007 // Author:          Aaron Darling
    00008 // Modified by:
    00009 // Copyright:       (c) Aaron Darling
    00010 // Licenses:        See COPYING file for details
    00011 /////////////////////////////////////////////////////////////////////////////
    00012
    00013
    00014 #include <string>
    00015 #include "gn/gnBaseSource.h"
    00016 #include "gn/gnSourceHeader.h"
    00017
    00018 gnSourceHeader::gnSourceHeader(){
    00019         m_source = NULL;
    00020         m_start = 0;
    00021         m_length = 0;
    00022 }
    00023 gnSourceHeader::gnSourceHeader( gnBaseSource* source, const string& name, const uint32 begin, const uint32 length ){
    00024         m_source = source;
    00025         m_name = string(name);
    00026         m_start = begin;
    00027         m_length = length;
    00028 }
    00029 gnSourceHeader::gnSourceHeader(const gnSourceHeader& s){
    00030         m_source = s.m_source;
    00031         m_start = s.m_start;
    00032         m_length = s.m_length;
    00033         m_name = string(s.m_name);
    00034 }
    00035 gnSourceHeader::~gnSourceHeader(){
    00036 };
    00037 string gnSourceHeader::GetHeader() const{
    00038         Array<char> array_buf( m_length );
    00039         char* buf = array_buf.data;
    00040         uint32 readBytes = m_length;
    00041         m_source->Read(m_start, buf, readBytes);
    00042         string rval(buf, readBytes);
    00043         return rval;
    00044 }