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

Go to the SVN repository for this file.

1 /* $Id: validerror_desc.hpp 101110 2023-10-31 15:41:45Z 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  * Author: Jonathan Kans, Clifford Clausen, Aaron Ucko......
27  *
28  * File Description:
29  * Privae classes and definition for the validator
30  * .......
31  *
32  */
33 
34 #ifndef VALIDATOR___VALIDERROR_DESC__HPP
35 #define VALIDATOR___VALIDERROR_DESC__HPP
36 
37 #include <corelib/ncbistd.hpp>
39 
40 #include <objmgr/scope.hpp>
42 
46 
49 
50 class CSeq_entry;
51 class CSeqdesc;
52 class CMolInfo;
53 class CUser_object;
54 
55 BEGIN_SCOPE(validator)
56 
57 // ============================= Validate SeqDesc ============================
58 
60 {
61 public:
63  ~CValidError_desc() override;
64 
65  void ValidateSeqDesc(const CSeqdesc& desc, const CSeq_entry& ctx);
66 
67  bool IsValidStructuredComment(const CSeqdesc& desc);
68  bool ValidateStructuredCommentInternal(const CSeqdesc& desc, bool report = true);
69  bool ValidateDblink(const CUser_object& usr, const CSeqdesc& desc, bool report = true);
70 
72 private:
73 
74  void ValidateComment(const string& comment, const CSeqdesc& desc);
75  void ValidateTitle(const string& title, const CSeqdesc& desc, const CSeq_entry& ctx);
76  bool x_ValidateStructuredCommentPrefix(const string& prefix, const CSeqdesc& desc, bool report);
77  bool x_ValidateStructuredCommentSuffix(const string& prefix, const CUser_field& suffix, const CSeqdesc& desc, bool report);
78  bool x_ValidateStructuredCommentUsingRule(const CComment_rule& rule, const CSeqdesc& desc, bool report);
79  bool ValidateStructuredComment(const CUser_object& usr, const CSeqdesc& desc, const CComment_rule& rule, bool report);
80  bool x_ValidateStructuredComment(const CUser_object& usr, const CSeqdesc& desc, bool report = true);
81  bool ValidateStructuredCommentGeneric(const CUser_object& usr, const CSeqdesc& desc, bool report);
82  void x_ReportStructuredCommentErrors(const CSeqdesc& desc, const CComment_rule::TErrorList& errors);
83  void ValidateUser(const CUser_object& usr, const CSeqdesc& desc);
84  void ValidateMolInfo(const CMolInfo& minfo, const CSeqdesc& desc);
85 
87 };
88 
89 
90 END_SCOPE(validator)
93 
94 #endif /* VALIDATOR___VALIDERROR_DESC__HPP */
User-defined methods of the data storage class.
vector< TError > TErrorList
Definition: Seq_entry.hpp:56
CConstRef< CSeq_entry > m_Ctx
void ResetModifCounters()
Include a standard set of the NCBI C++ Toolkit most basic headers.
CS_CONTEXT * ctx
Definition: t0006.c:12
#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
#define NCBI_VALIDATOR_EXPORT
Definition: ncbi_export.h:913
Modified on Fri Sep 20 14:57:27 2024 by modify_doxy.py rev. 669887