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

Go to the SVN repository for this file.

1 /* $Id: flatparse_report.hpp 99284 2023-03-06 16:28:57Z stakhovv $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * File Name: flatparse_report.hpp
27  *
28  * Author: Frank Ludwig
29  *
30  * File Description:
31  *
32  */
33 
34 #ifndef FLATFILE__FLATPARSE_REPORT__HPP
35 #define FLATFILE__FLATPARSE_REPORT__HPP
36 
37 #include "ftaerr.hpp"
39 
41 
42 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
45 {
46  // Signature convention:
47  // Return value indicates whether the reported problem leaves the qualifier
48  // usable or not.
49  // ==true: problem not serious, use qualifier
50  // ==false: problem serious, don't use qualifier
51  // Args are generally in order featKey, featLocation, qualKey, qualVal but the
52  // ones that don't apply may be missing.
53  // Any specific arguments come after that.
54 public:
55  static void ContainsEmbeddedQualifier(
56  const string& featKey,
57  const string& featLocation,
58  const string& qualKey,
59  const string& firstEmbedded,
60  bool inNote = false);
61 
62  static void NoTextAfterEqualSign(
63  const string& featKey,
64  const string& featLocation,
65  const string& qualKey);
66 
67  static void QualShouldHaveValue(
68  const string& featKey,
69  const string& featLocation,
70  const string& qualKey);
71 
72  static void QualShouldNotHaveValue(
73  const string& featKey,
74  const string& featLocation,
75  const string& qualKey);
76 
77  static void UnbalancedQuotes(
78  const string& qualKey);
79 
80  static void UnexpectedData(
81  const string& featKey,
82  const string& featLocation);
83 
84  static void UnknownQualifierKey(
85  const string& featKey,
86  const string& featLocation,
87  const string& qualKey);
88 
89 private:
90  using ErrCode = pair<int, int>;
92 
93  static const char* sMessageTemplateFor(
94  int major,
95  int minor);
97 };
98 
99 
101 
102 #endif // FLATFILE__FLATPARSE_REPORT__HPP
static void NoTextAfterEqualSign(const string &featKey, const string &featLocation, const string &qualKey)
static void UnbalancedQuotes(const string &qualKey)
static void QualShouldHaveValue(const string &featKey, const string &featLocation, const string &qualKey)
static void UnexpectedData(const string &featKey, const string &featLocation)
static const char * sMessageTemplateFor(int major, int minor)
static ErrMessageLookup mMessageTemplates
pair< int, int > ErrCode
static void UnknownQualifierKey(const string &featKey, const string &featLocation, const string &qualKey)
static void ContainsEmbeddedQualifier(const string &featKey, const string &featLocation, const string &qualKey, const string &firstEmbedded, bool inNote=false)
static void QualShouldNotHaveValue(const string &featKey, const string &featLocation, const string &qualKey)
Definition: map.hpp:338
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Modified on Fri May 24 14:56:22 2024 by modify_doxy.py rev. 669887