gnStringQualifier.h Source File

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

# gnStringQualifier.h

Go to the documentation of this file.

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