1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
/////////////////////////////////////////////////////////////////////////////
// File: gnSourceQualifier.cpp
// Purpose: Source Qualifier class
// Description: Provides an interface for Qualifier on disk.
// Changes:
// Version: libGenome 0.5.1
// Author: Aaron Darling
// Modified by:
// Copyright: (c) Aaron Darling
// Licenses: See COPYING file for details
/////////////////////////////////////////////////////////////////////////////
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string>
#include "libGenome/gnBaseSource.h"
#include "libGenome/gnSourceQualifier.h"
using namespace std;
namespace genome {
gnSourceQualifier::gnSourceQualifier(){
m_source = NULL;
m_name = "";
m_start = 0;
m_length = 0;
}
gnSourceQualifier::gnSourceQualifier( gnBaseSource* source, string& name, uint32 begin, uint32 length ){
m_source = source;
m_name = name;
m_start = begin;
m_length = length;
}
gnSourceQualifier::gnSourceQualifier(const gnSourceQualifier& s){
m_source = s.m_source;
m_start = s.m_start;
m_length = s.m_length;
m_name = string(s.m_name);
}
gnSourceQualifier::~gnSourceQualifier(){
};
string gnSourceQualifier::GetValue() const{
Array<char> array_buf( m_length );
char* buf = array_buf.data;
gnSeqI readBytes = m_length;
m_source->Read(m_start, buf, readBytes);
string rval(buf, readBytes);
return rval;
}
} // end namespace genome
|