1 /* $Id: Comment_rule.hpp 491404 2016-02-04 17:37:54Z bollin $
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 */
27
28 /// @file Comment_rule.hpp
29 /// User-defined methods of the data storage class.
30 ///
31 /// This file was originally generated by application DATATOOL
32 /// using the following specifications:
33 /// 'valid.asn'.
34 ///
35 /// New methods or data members can be added to it if needed.
36 /// See also: Comment_rule_.hpp
37
38
39 #ifndef OBJECTS_VALID_COMMENT_RULE_HPP
40 #define OBJECTS_VALID_COMMENT_RULE_HPP
41
42
43 // generated includes
44 #include <objects/valid/Comment_rule_.hpp>
45 #include <objects/valid/Field_rule.hpp>
46 #include <objects/general/User_object.hpp>
47
48 // generated classes
49
50 BEGIN_NCBI_SCOPE
51
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53
54 /////////////////////////////////////////////////////////////////////////////
55 class NCBI_VALID_EXPORT CComment_rule : public CComment_rule_Base
56 {
57 typedef CComment_rule_Base Tparent;
58 public:
59 // constructor
60 CComment_rule(void);
61 // destructor
62 ~CComment_rule(void);
63
64 CConstRef<CField_rule> FindFieldRuleRef (const string& field_name) const;
65 static void NormalizePrefix(string& prefix);
66 static bool IsStructuredComment (const CUser_object& user);
67 static string GetStructuredCommentPrefix (const CUser_object& user, bool normalize = true);
68 static string MakePrefixFromRoot(const string& root);
69 static string MakeSuffixFromRoot(const string& root);
70 static string KeywordForPrefix(const string& prefix);
71 static string PrefixForKeyword(const string& keyword);
72 static vector<string> GetKeywordList();
73
74
75 typedef pair<CField_rule::TSeverity, string> TError;
76 typedef vector<TError> TErrorList;
77 TErrorList IsValid(const CUser_object& user) const;
78 void CheckFieldValue(CConstRef<CField_rule> field_rule, const string& value, TErrorList& errors) const;
79 void CheckFieldValue(CConstRef< CField_rule> rule, const CUser_field& field, TErrorList& errors) const;
80 static void CheckGeneralFieldValue(const string& value, TErrorList& errors);
81 static void CheckGeneralFieldName(const string& label, TErrorList& errors);
82 static void CheckGeneralField(const CUser_field& field, TErrorList& errors);
83 static TErrorList CheckGeneralStructuredComment(const CUser_object& user);
84 bool ReorderFields(CUser_object& user) const;
85
86 private:
87 // Prohibit copy constructor and assignment operator
88 CComment_rule(const CComment_rule& value);
89 CComment_rule& operator=(const CComment_rule& value);
90
91 };
92
93 /////////////////// CComment_rule inline methods
94
95 // constructor
96 inline
CComment_rule(void)97 CComment_rule::CComment_rule(void)
98 {
99 }
100
101
102 /////////////////// end of CComment_rule inline methods
103
104
105 END_objects_SCOPE // namespace ncbi::objects::
106
107 END_NCBI_SCOPE
108
109
110 #endif // OBJECTS_VALID_COMMENT_RULE_HPP
111 /* Original file checksum: lines: 86, chars: 2465, CRC32: 988ff800 */
112