File: gnSourceHeader.cpp

package info (click to toggle)
libgenome 1.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 2,148 kB
  • ctags: 1,215
  • sloc: cpp: 10,910; sh: 8,264; makefile: 82
file content (55 lines) | stat: -rw-r--r-- 1,417 bytes parent folder | download | duplicates (8)
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
/////////////////////////////////////////////////////////////////////////////
// File:            gnSourceHeader.cpp
// Purpose:         Source Header class
// Description:     Provides an interface for Headers 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/gnSourceHeader.h"


using namespace std;
namespace genome {


gnSourceHeader::gnSourceHeader(){
	m_source = NULL;
	m_start = 0;
	m_length = 0;
}
gnSourceHeader::gnSourceHeader( gnBaseSource* source, const string& name, const uint32 begin, const uint32 length ){
	m_source = source;
	m_name = string(name);
	m_start = begin;
	m_length = length;
}
gnSourceHeader::gnSourceHeader(const gnSourceHeader& s){
	m_source = s.m_source;
	m_start = s.m_start;
	m_length = s.m_length;
	m_name = string(s.m_name);
}
gnSourceHeader::~gnSourceHeader(){
};
string gnSourceHeader::GetHeader() 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