NCBI C++ ToolKit
aln_errors.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /*
2  * $Id: aln_errors.cpp 93579 2021-05-01 20:54:52Z stakhovv $
3  *
4  * ===========================================================================
5  *
6  * PUBLIC DOMAIN NOTICE
7  * National Center for Biotechnology Information
8  *
9  * This software/database is a "United States Government Work" under the
10  * terms of the United States Copyright Act. It was written as part of
11  * the author's official duties as a United States Government employee and
12  * thus cannot be copyrighted. This software/database is freely available
13  * to the public for use. The National Library of Medicine and the U.S.
14  * Government have not placed any restriction on its use or reproduction.
15  *
16  * Although all reasonable efforts have been taken to ensure the accuracy
17  * and reliability of the software and data, the NLM and the U.S.
18  * Government do not and cannot warrant the performance or results that
19  * may be obtained by using this software or data. The NLM and the U.S.
20  * Government disclaim all warranties, express or implied, including
21  * warranties of performance, merchantability or fitness for any particular
22  * purpose.
23  *
24  * Please cite the author in any work or product based on this material.
25  *
26  * ===========================================================================
27  *
28  * Authors: Colleen Bollin
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 #include <corelib/ncbistr.hpp>
37 #include "aln_errors.hpp"
38 
41 
42 thread_local unique_ptr<CAlnErrorReporter> theErrorReporter;
43 
44 // ----------------------------------------------------------------------------
46 // ----------------------------------------------------------------------------
47 {
48  ADD_ENUM_VALUE("Undefined", eReader_Undefined);
51 }
53 
54 
55 // ----------------------------------------------------------------------------
57 // ----------------------------------------------------------------------------
58 {
80 }
82 
83 
84 // ----------------------------------------------------------------------------
86 // ----------------------------------------------------------------------------
87 {
95 }
97 
98 // ----------------------------------------------------------------------------
99 string ErrorPrintf(const char *format, ...)
100 // ----------------------------------------------------------------------------
101 {
102  va_list args;
103  va_start(args, format);
104  return NStr::FormatVarargs(format, args);
105 }
106 
107 // ----------------------------------------------------------------------------
108 string BadCharCountPrintf(int expectedCount, int actualCount)
109 // ----------------------------------------------------------------------------
110 {
111  return
112  ("Number of characters on sequence line is different from expected. " +
113  ErrorPrintf("Expected number of characters is %d. Actual number of characters is %d.",
114  expectedCount, actualCount));
115 }
116 
string BadCharCountPrintf(int expectedCount, int actualCount)
Definition: aln_errors.cpp:108
END_ENUM_INFO string ErrorPrintf(const char *format,...)
Definition: aln_errors.cpp:99
thread_local unique_ptr< CAlnErrorReporter > theErrorReporter
Definition: aln_errors.cpp:40
ADD_ENUM_VALUE("Mods", eReader_Mods)
END_ENUM_INFO
Definition: aln_errors.cpp:58
The NCBI C++ standard methods for dealing with std::string.
#define BEGIN_NAMED_ENUM_INFO(EnumAlias, EnumName, IsInteger)
Definition: serialimpl.hpp:545
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
static string FormatVarargs(const char *format, va_list args)
Handle an arbitrary printf-style format string.
Definition: ncbistr.cpp:2846
static Format format
Definition: njn_ioutil.cpp:53
@ eAlnSubcode_UnexpectedCommandArgs
@ eAlnSubcode_BadDataChars
@ eAlnSubcode_FileTooShort
@ eAlnSubcode_Undefined
@ eAlnSubcode_UnsupportedFileFormat
@ eAlnSubcode_BadSequenceCount
@ eAlnSubcode_UnterminatedComment
@ eAlnSubcode_IllegalSequenceId
@ eAlnSubcode_UnterminatedBlock
@ eAlnSubcode_FileDoesNotExist
@ eAlnSubcode_UnexpectedCommand
@ eAlnSubcode_IllegalDataDescription
@ eAlnSubcode_InconsistentMolType
@ eAlnSubcode_InsufficientDeflineInfo
@ eAlnSubcode_UnterminatedCommand
@ eAlnSubcode_UnusedLine
@ eAlnSubcode_IllegalDataLine
@ eAlnSubcode_BadDataCount
@ eAlnSubcode_MissingDataLine
@ eAlnSubcode_UnexpectedSeqId
@ eAlnSubcode_IllegalDefinitionLine
@ eReader_Undefined
@ eReader_Alignment
@ eReader_Mods
@ eModSubcode_Unrecognized
@ eModSubcode_Duplicate
@ eModSubcode_Deprecated
@ eModSubcode_Undefined
@ eModSubcode_ProteinModOnNucseq
@ eModSubcode_ConflictingValues
@ eModSubcode_InvalidValue
Modified on Tue May 28 05:53:04 2024 by modify_doxy.py rev. 669887