NCBI C++ ToolKit
columnar_vcf_ex.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_LOADERS__COLUMNAR_VCF_EX__HPP
2 #define GUI_WIDGETS_LOADERS__COLUMNAR_VCF_EX__HPP
3 
4 /* $Id: columnar_vcf_ex.hpp 46559 2021-07-12 14:39:04Z asztalos $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrea Asztalos
30  *
31  * File Description: Exception class for processing VCF file
32  *
33  */
34 
35 #include <corelib/ncbiexpt.hpp>
36 #include <serial/serialbase.hpp>
37 #include <gui/gui_export.h>
38 
39 
41 
42 
44 public:
45  // Error codes for parsing the VCF file
46  //
47  enum EErrCode {
51  eConversionFailed
52 
53  };
54 
55  // Convertion of error code to user domain message
56  //
57  virtual const char* GetErrCodeString(void) const override {
58  switch (GetErrCode()) {
59  case eParseTabExpected: return "eParseTabExpected";
60  case eMismatchChromosome: return "eMismatchChromosome";
61  case eParsePosFailed: return "eParsePosFailed";
62  case eConversionFailed: return "eConversionFailed";
63 
64  default: return CException::GetErrCodeString();
65  }
66  }
67 
69 };
70 
71 // Errors related to serialization and deserialization of the VCF data
73 {
74 public:
75  enum EErrCode {
79 
80  };
81 
82  // Convertion of error code to user domain message
83  //
84  virtual const char* GetErrCodeString(void) const override {
85  switch (GetErrCode()) {
86  case eSerializationFailed: return "eSerializationFailed";
87  case eDeserializationFailed: return "eDeserializationFailed";
88  case eFileCorrupted: return "eFileCorrupted";
89 
90  default: return CException::GetErrCodeString();
91  }
92  }
93 
95 };
96 
97 
99 
100 
101 #endif // GUI_WIDGETS_LOADERS__COLUMNAR_VCF_EX__HPP
102 
virtual const char * GetErrCodeString(void) const override
NCBI_EXCEPTION_DEFAULT(CColumnarVCFException, CException)
NCBI_EXCEPTION_DEFAULT(CVCFDataException, CException)
virtual const char * GetErrCodeString(void) const override
TErrCode GetErrCode(void) const
Get error code.
Definition: ncbiexpt.cpp:453
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
Definition: ncbiexpt.cpp:444
#define EXCEPTION_VIRTUAL_BASE
Do not use virtual base classes in exception declaration at all, because in this case derived class s...
Definition: ncbiexpt.hpp:1388
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_LOADERS_EXPORT
Definition: gui_export.h:525
Defines to provide correct exporting from DLLs in Windows.
Defines NCBI C++ exception handling.
Modified on Sat Dec 02 09:24:17 2023 by modify_doxy.py rev. 669887