SamValidationError Class Reference

The SamValidationError class describes a validation error that occured, containing the error type, severity, and textual error message. More...

#include <SamValidation.h>

Collaboration diagram for SamValidationError:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Severity { WARNING, ERROR }
 

Severity of the error.

More...
enum  Type {
  INVALID_QNAME, INVALID_REF_ID, INVALID_RNAME, INVALID_POS,
  INVALID_MAPQ, INVALID_CIGAR, INVALID_MRNM, INVALID_QUAL,
  INVALID_TAG
}
 

Type of the error.

More...

Public Member Functions

 SamValidationError (Type type, Severity severity, std::string Message)
 Constructor that sets the type, severity, and message for the validation error.
Type getType () const
 Return the type enum of this validation error object.
Severity getSeverity () const
 Return the severity enum of this validation error object.
const char * getMessage () const
 Return the error message of this validation error object.
const char * getTypeString () const
 Return the string representing this object's type of validation error.
const char * getSeverityString () const
 Return the string representing this object's severity of validation error.
void getErrorString (std::string &errorString) const
 Get the error string representing this object's error.
void printError () const
 Print a formatted output of the error to cerr.

Static Public Member Functions

static const char * getTypeString (Type type)
 Get the string representing the specified type of validation error.

Detailed Description

The SamValidationError class describes a validation error that occured, containing the error type, severity, and textual error message.

Definition at line 34 of file SamValidation.h.


Member Enumeration Documentation

Severity of the error.

Enumerator:
WARNING 

Warning is used if it is just an invalid value.

ERROR 

Error is used if parsing could not succeed.

Definition at line 38 of file SamValidation.h.

00039         {
00040             WARNING, ///< Warning is used if it is just an invalid value.
00041             ERROR    ///< Error is used if parsing could not succeed.
00042         };

Type of the error.

TODO: NOT ALL INVALID TYPES HAVE BEEN ADDED SINCE NOT ALL VALIDATION IS COMPLETE YET

Enumerator:
INVALID_QNAME 

Invalid read/query name.

INVALID_REF_ID 

Invalid reference id.

INVALID_RNAME 

Invalid reference name.

INVALID_POS 

Invalid position.

INVALID_MAPQ 

Invalid mapping quality.

INVALID_CIGAR 

Invalid CIGAR.

INVALID_MRNM 

Invalid mate/next fragment reference name.

INVALID_QUAL 

Invalid base quality.

INVALID_TAG 

Invalid tag.

Definition at line 47 of file SamValidation.h.

00048         {
00049             INVALID_QNAME, ///< Invalid read/query name
00050             INVALID_REF_ID, ///< Invalid reference id
00051             INVALID_RNAME, ///< Invalid reference name
00052             INVALID_POS, ///< Invalid position
00053             INVALID_MAPQ, ///< Invalid mapping quality
00054             INVALID_CIGAR, ///< Invalid CIGAR
00055             INVALID_MRNM, ///< Invalid mate/next fragment reference name
00056             INVALID_QUAL, ///< Invalid base quality
00057             INVALID_TAG ///< Invalid tag
00058         };


Constructor & Destructor Documentation

SamValidationError::SamValidationError ( Type  type,
Severity  severity,
std::string  Message 
)

Constructor that sets the type, severity, and message for the validation error.

Definition at line 45 of file SamValidation.cpp.

References SamValidationError().

Referenced by SamValidationError().

00047 {
00048     myType = type;
00049     mySeverity = severity;
00050     myMessage = message;
00051 }


Member Function Documentation

const char * SamValidationError::getSeverityString (  )  const

Return the string representing this object's severity of validation error.

Definition at line 78 of file SamValidation.cpp.

Referenced by getErrorString().

00079 {
00080     return(enumSeverityString[mySeverity]);
00081 }


The documentation for this class was generated from the following files:
Generated on Mon Feb 11 13:45:29 2013 for libStatGen Software by  doxygen 1.6.3