gnStringHeader.h Source File

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

# gnStringHeader.h

Go to the documentation of this file.

    00001 /////////////////////////////////////////////////////////////////////////////
    00002 // File:            gnStringHeader.h
    00003 // Purpose:         abstract Header class
    00004 // Description:     Provides an interface for Headers in memory.
    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 #ifndef _gnStringHeader_h_
    00013 #define _gnStringHeader_h_
    00014
    00015 #include "gn/gnDefs.h"
    00016
    00017 #include <string>
    00018 #include "gn/gnClone.h"
    00019 #include "gn/gnLocation.h"
    00020 #include "gn/gnBaseHeader.h"
    00021
    00022 /**
    00023  * gnStringHeader stores sequence related header information in memory.
    00024  * Use gnStringHeader for a general purpose headers.
    00025  * @see gnBaseHeader
    00026  */
    00027 class GNDLLEXPORT gnStringHeader : public gnBaseHeader
    00028 {
    00029 public:
    00030         /**
    00031          * Empty constructor.
    00032          */
    00033         gnStringHeader();
    00034         /**
    00035          * Create a gnStringHeader.
    00036          * @param name The header name.
    00037          * @param header The header.
    00038          */
    00039         gnStringHeader(const string& name, const string& header);
    00040         /**
    00041          * Copy constructor.
    00042          * @param s The gnStringHeader to copy.
    00043          */
    00044         gnStringHeader(const gnStringHeader& s);
    00045         /**
    00046          * Destructor, frees memory.
    00047          */
    00048         ~gnStringHeader() {};
    00049
    00050         gnStringHeader* Clone() const;
    00051
    00052         string GetHeader() const;
    00053         string GetHeaderName() const;
    00054
    00055         /**
    00056          * Set the header stored in this class.
    00057          * @param header The header as a string.
    00058          */
    00059         void SetHeader(const string& header);
    00060         /**
    00061          * Set the header's name stored in this class.
    00062          * @param name The header name as a string.
    00063          */
    00064         void SetHeaderName(const string& name);
    00065
    00066         uint32 GetLength() const;
    00067 private:
    00068         string m_name;
    00069         string m_header;
    00070 }; //class gnStringHeader
    00071
    00072 inline
    00073 gnStringHeader::gnStringHeader(){
    00074         m_header = string();
    00075 }
    00076 inline
    00077 gnStringHeader::gnStringHeader(const string& name, const string& header){
    00078         m_name = name;
    00079         m_header = header;
    00080 }
    00081 inline
    00082 gnStringHeader::gnStringHeader(const gnStringHeader& s){
    00083         m_header = string(s.m_header);
    00084 }
    00085 inline
    00086 gnStringHeader* gnStringHeader::Clone() const{
    00087         return new gnStringHeader(*this);
    00088 }
    00089 inline
    00090 string gnStringHeader::GetHeader() const{
    00091         return m_header;
    00092 }
    00093 inline
    00094 string gnStringHeader::GetHeaderName() const{
    00095         return m_name;
    00096 }
    00097 inline
    00098 void gnStringHeader::SetHeader(const string& header){
    00099         m_header = header;
    00100 }
    00101 inline
    00102 void gnStringHeader::SetHeaderName(const string& name){
    00103         m_name = name;
    00104 }
    00105 inline
    00106 uint32 gnStringHeader::GetLength() const{
    00107         return m_header.length();
    00108 }
    00109
    00110 #endif
    00111         // _gnStringHeader_h_