|
gnSourceHeader.cppGo 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.1.0 00007 // Author: Aaron Darling 00008 // Last Edited: April 15, 2001, 11:13:00pm 00009 // Modified by: 00010 // Copyright: (c) Aaron Darling 00011 // Licenses: Proprietary 00013 00014 00015 #include <string> 00016 #include "gn/gnBaseSource.h" 00017 #include "gn/gnSourceHeader.h" 00018 00019 gnSourceHeader::gnSourceHeader(){ 00020 m_source = NULL; 00021 m_start = 0; 00022 m_length = 0; 00023 } 00024 gnSourceHeader::gnSourceHeader( gnBaseSource* source, const string& name, const uint32 begin, const uint32 length ){ 00025 m_source = source; 00026 m_name = string(name); 00027 m_start = begin; 00028 m_length = length; 00029 } 00030 gnSourceHeader::gnSourceHeader(const gnSourceHeader& s){ 00031 m_source = s.m_source; 00032 m_start = s.m_start; 00033 m_length = s.m_length; 00034 m_name = string(s.m_name); 00035 } 00036 gnSourceHeader::~gnSourceHeader(){ 00037 }; 00038 string gnSourceHeader::GetHeader() const{ 00039 char* buf = new char[m_length]; 00040 uint32 readBytes = m_length; 00041 m_source->Read(m_start, buf, readBytes); 00042 string rval(buf, readBytes); 00043 return rval; 00044 } Generated at Fri Nov 30 15:36:52 2001 for libGenome by 1.2.8.1 written by Dimitri van Heesch, © 1997-2001 |