NCBI C++ ToolKit
|
Search Toolkit Book for CComment_rule
#include <objects/valid/Comment_rule.hpp>
Public Types | |
typedef pair< CField_rule::TSeverity, string > | TError |
typedef vector< TError > | TErrorList |
![]() | |
enum class | E_memberIndex { e__allMandatory = 0 , e_prefix , e_updated , e_fields , e_require_order , e_allow_unlisted , e_dependent_rules , e_forbidden_phrases } |
typedef string | TPrefix |
typedef bool | TUpdated |
typedef CField_set | TFields |
typedef bool | TRequire_order |
typedef bool | TAllow_unlisted |
typedef CDependent_field_set | TDependent_rules |
typedef CPhrase_list | TForbidden_phrases |
typedef Tparent::CMemberIndex< E_memberIndex, 8 > | TmemberIndex |
![]() | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Public Member Functions | |
CComment_rule (void) | |
~CComment_rule (void) | |
CConstRef< CField_rule > | FindFieldRuleRef (const string &field_name) const |
TErrorList | IsValid (const CUser_object &user) const |
void | CheckFieldValue (CConstRef< CField_rule > field_rule, const string &value, TErrorList &errors) const |
void | CheckFieldValue (CConstRef< CField_rule > rule, const CUser_field &field, TErrorList &errors) const |
bool | ReorderFields (CUser_object &user) const |
![]() | |
CComment_rule_Base (void) | |
virtual | ~CComment_rule_Base (void) |
DECLARE_INTERNAL_TYPE_INFO () | |
bool | IsSetPrefix (void) const |
Check if a value has been assigned to Prefix data member. More... | |
bool | CanGetPrefix (void) const |
Check if it is safe to call GetPrefix method. More... | |
void | ResetPrefix (void) |
Reset Prefix data member. More... | |
const TPrefix & | GetPrefix (void) const |
Get the Prefix member data. More... | |
void | SetPrefix (const TPrefix &value) |
Assign a value to Prefix data member. More... | |
void | SetPrefix (TPrefix &&value) |
TPrefix & | SetPrefix (void) |
Assign a value to Prefix data member. More... | |
bool | IsSetUpdated (void) const |
Check if a value has been assigned to Updated data member. More... | |
bool | CanGetUpdated (void) const |
Check if it is safe to call GetUpdated method. More... | |
void | ResetUpdated (void) |
Reset Updated data member. More... | |
void | SetDefaultUpdated (void) |
Assign default value to Updated data member. More... | |
TUpdated | GetUpdated (void) const |
Get the Updated member data. More... | |
void | SetUpdated (TUpdated value) |
Assign a value to Updated data member. More... | |
TUpdated & | SetUpdated (void) |
Assign a value to Updated data member. More... | |
bool | IsSetFields (void) const |
Check if a value has been assigned to Fields data member. More... | |
bool | CanGetFields (void) const |
Check if it is safe to call GetFields method. More... | |
void | ResetFields (void) |
Reset Fields data member. More... | |
const TFields & | GetFields (void) const |
Get the Fields member data. More... | |
void | SetFields (TFields &value) |
Assign a value to Fields data member. More... | |
TFields & | SetFields (void) |
Assign a value to Fields data member. More... | |
bool | IsSetRequire_order (void) const |
Check if a value has been assigned to Require_order data member. More... | |
bool | CanGetRequire_order (void) const |
Check if it is safe to call GetRequire_order method. More... | |
void | ResetRequire_order (void) |
Reset Require_order data member. More... | |
void | SetDefaultRequire_order (void) |
Assign default value to Require_order data member. More... | |
TRequire_order | GetRequire_order (void) const |
Get the Require_order member data. More... | |
void | SetRequire_order (TRequire_order value) |
Assign a value to Require_order data member. More... | |
TRequire_order & | SetRequire_order (void) |
Assign a value to Require_order data member. More... | |
bool | IsSetAllow_unlisted (void) const |
Check if a value has been assigned to Allow_unlisted data member. More... | |
bool | CanGetAllow_unlisted (void) const |
Check if it is safe to call GetAllow_unlisted method. More... | |
void | ResetAllow_unlisted (void) |
Reset Allow_unlisted data member. More... | |
void | SetDefaultAllow_unlisted (void) |
Assign default value to Allow_unlisted data member. More... | |
TAllow_unlisted | GetAllow_unlisted (void) const |
Get the Allow_unlisted member data. More... | |
void | SetAllow_unlisted (TAllow_unlisted value) |
Assign a value to Allow_unlisted data member. More... | |
TAllow_unlisted & | SetAllow_unlisted (void) |
Assign a value to Allow_unlisted data member. More... | |
bool | IsSetDependent_rules (void) const |
Check if a value has been assigned to Dependent_rules data member. More... | |
bool | CanGetDependent_rules (void) const |
Check if it is safe to call GetDependent_rules method. More... | |
void | ResetDependent_rules (void) |
Reset Dependent_rules data member. More... | |
const TDependent_rules & | GetDependent_rules (void) const |
Get the Dependent_rules member data. More... | |
void | SetDependent_rules (TDependent_rules &value) |
Assign a value to Dependent_rules data member. More... | |
TDependent_rules & | SetDependent_rules (void) |
Assign a value to Dependent_rules data member. More... | |
bool | IsSetForbidden_phrases (void) const |
Check if a value has been assigned to Forbidden_phrases data member. More... | |
bool | CanGetForbidden_phrases (void) const |
Check if it is safe to call GetForbidden_phrases method. More... | |
void | ResetForbidden_phrases (void) |
Reset Forbidden_phrases data member. More... | |
const TForbidden_phrases & | GetForbidden_phrases (void) const |
Get the Forbidden_phrases member data. More... | |
void | SetForbidden_phrases (TForbidden_phrases &value) |
Assign a value to Forbidden_phrases data member. More... | |
TForbidden_phrases & | SetForbidden_phrases (void) |
Assign a value to Forbidden_phrases data member. More... | |
virtual void | Reset (void) |
Reset the whole object. More... | |
![]() | |
CSerialObject (void) | |
virtual | ~CSerialObject (void) |
virtual const CTypeInfo * | GetThisTypeInfo (void) const =0 |
virtual void | Assign (const CSerialObject &source, ESerialRecursionMode how=eRecursive) |
Set object to copy of another one. More... | |
virtual bool | Equals (const CSerialObject &object, ESerialRecursionMode how=eRecursive) const |
Check if both objects contain the same values. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
void | ThrowUnassigned (TMemberIndex index) const |
void | ThrowUnassigned (TMemberIndex index, const char *file_name, int file_line) const |
bool | HasNamespaceName (void) const |
Check if object data type has namespace name. More... | |
const string & | GetNamespaceName (void) const |
Get namespace name. More... | |
bool | HasNamespacePrefix (void) const |
Check if data type has namespace prefix. More... | |
const string & | GetNamespacePrefix (void) const |
Get namespace prefix. More... | |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
![]() | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Private Types | |
typedef CComment_rule_Base | Tparent |
Private Member Functions | |
CComment_rule (const CComment_rule &value) | |
CComment_rule & | operator= (const CComment_rule &value) |
Additional Inherited Members | |
![]() | |
static const char * | ms_UnassignedStr = "<*unassigned*>" |
static const char | ms_UnassignedByte = char(0xcd) |
![]() | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Definition at line 55 of file Comment_rule.hpp.
typedef pair<CField_rule::TSeverity, string> CComment_rule::TError |
Definition at line 75 of file Comment_rule.hpp.
typedef vector<TError> CComment_rule::TErrorList |
Definition at line 76 of file Comment_rule.hpp.
|
private |
Definition at line 57 of file Comment_rule.hpp.
|
inline |
Definition at line 97 of file Comment_rule.hpp.
CComment_rule::~CComment_rule | ( | void | ) |
Definition at line 59 of file Comment_rule.cpp.
|
private |
void CComment_rule::CheckFieldValue | ( | CConstRef< CField_rule > | field_rule, |
const string & | value, | ||
TErrorList & | errors | ||
) | const |
Definition at line 247 of file Comment_rule.cpp.
References CheckGeneralFieldValue(), NStr::EqualNocase(), eSeverity_level_error, NStr::FindNoCase(), Get(), CComment_rule_Base::GetForbidden_phrases(), CComment_rule_Base::GetPrefix(), CComment_rule_Base::IsSetForbidden_phrases(), ITERATE, and rapidjson::value.
Referenced by CheckFieldValue(), and IsValid().
void CComment_rule::CheckFieldValue | ( | CConstRef< CField_rule > | rule, |
const CUser_field & | field, | ||
TErrorList & | errors | ||
) | const |
Definition at line 274 of file Comment_rule.cpp.
References CheckFieldValue(), CUser_field_Base::GetData(), CUser_field_Base::C_Data::GetInt(), CUser_field_Base::C_Data::GetStr(), NStr::IntToString(), CUser_field_Base::C_Data::IsInt(), CUser_field_Base::C_Data::IsStr(), and rapidjson::value.
|
static |
Definition at line 224 of file Comment_rule.cpp.
References CheckGeneralFieldName(), CheckGeneralFieldValue(), CUser_field_Base::GetData(), CObject_id_Base::GetId(), CUser_field_Base::C_Data::GetInt(), CUser_field_Base::GetLabel(), CObject_id_Base::GetStr(), CUser_field_Base::C_Data::GetStr(), NStr::IntToString(), CUser_field_Base::C_Data::IsInt(), CUser_field_Base::IsSetLabel(), CObject_id_Base::IsStr(), CUser_field_Base::C_Data::IsStr(), label, and rapidjson::value.
Referenced by CheckGeneralStructuredComment(), and IsValid().
|
static |
Definition at line 203 of file Comment_rule.cpp.
References eSeverity_level_error, eSeverity_level_reject, NStr::Find(), NStr::IsBlank(), and label.
Referenced by CheckGeneralField().
|
static |
Definition at line 216 of file Comment_rule.cpp.
References eSeverity_level_reject, NStr::Find(), and rapidjson::value.
Referenced by CheckFieldValue(), and CheckGeneralField().
|
static |
Definition at line 543 of file Comment_rule.cpp.
References CheckGeneralField(), CUser_object_Base::GetData(), CUser_object_Base::IsSetData(), and ITERATE.
Referenced by CValidError_desc::ValidateStructuredCommentGeneric().
CConstRef< CField_rule > CComment_rule::FindFieldRuleRef | ( | const string & | field_name | ) | const |
Definition at line 191 of file Comment_rule.cpp.
References NStr::Equal(), Get(), CComment_rule_Base::GetFields(), and ITERATE.
Referenced by IsAppropriateRule(), and IsValid().
|
static |
Definition at line 178 of file Comment_rule.cpp.
References first(), i, k_NumStructuredCommentKeywords, and s_StructuredCommentKeywords.
Referenced by BOOST_AUTO_TEST_CASE(), and CNewCleanup_imp::x_FixStructuredCommentKeywords().
|
static |
Definition at line 98 of file Comment_rule.cpp.
References NStr::Equal(), CUser_object_Base::GetData(), CUser_object_Base::IsSetData(), IsStructuredComment(), ITERATE, kStructuredCommentPrefix, kStructuredCommentSuffix, and NormalizePrefix().
Referenced by CValidError_bioseq::CheckForMultipleStructuredComments(), GetBioseqDiffs(), CApplyStructCommentTreeItemData::GetFunction(), CComment_set::GetKeywords(), CApplyStructCommentTreeItemData::GetMacroDescription(), CStructCommDBName::GetVals(), CStructuredCommentField::IsStructuredCommentForThisField(), CStructuredCommentField::IsValid(), CStructuredCommentField::ReorderFields(), s_GetKeywordForStructuredComment(), s_IsReportableStructuredComment(), CSubmissionWizard::x_ApplyUserDescriptorToRecord(), CNewCleanup_imp::x_FixStructuredCommentKeywords(), CKeywordsItem::x_GatherInfo(), CStructCommFieldValuePair::x_InsertFieldAtCorrectPosition(), CValidError_desc::x_ValidateStructuredComment(), and CValidError_desc::x_ValidateStructuredCommentPrefix().
|
static |
Definition at line 86 of file Comment_rule.cpp.
References NStr::EqualNocase(), CObject_id_Base::GetStr(), CUser_object_Base::GetType(), CUser_object_Base::IsSetType(), CObject_id_Base::IsStr(), and kStructuredComment.
Referenced by CChangeStructuredCommentKeyword::ApplyToCSeq_entry_user(), CValidError_bioseq::CheckForMultipleStructuredComments(), CStructCommFieldValuePair::ClearVal(), CStructCommDBName::ClearVal(), CStructCommFieldName::ClearVal(), CStructCommFieldValuePair::GetApplyObjects(), CStructCommentFieldPanel::GetStructCommentFields(), GetStructuredCommentPrefix(), CStructCommFieldValuePair::GetVals(), CStructCommFieldName::GetVals(), CStructCommFieldValuePair::IsEmpty(), CStructuredCommentField::IsStructuredCommentForThisField(), CMacroFunction_ParseToStructComm::TheFunction(), CMacroFunction_SetStructCommDb::TheFunction(), CNewCleanup_imp::x_FixStructuredCommentKeywords(), CKeywordsItem::x_GatherInfo(), and CMacroBioData_StructCommentIter::x_StepToNextStructComment().
CComment_rule::TErrorList CComment_rule::IsValid | ( | const CUser_object & | user | ) | const |
Definition at line 286 of file Comment_rule.cpp.
References CheckFieldValue(), CheckGeneralField(), NStr::Equal(), eSeverity_level_error, FindFieldRuleRef(), Get(), CField_set_Base::Get(), CComment_rule_Base::GetAllow_unlisted(), CUser_field_Base::GetData(), CUser_object_Base::GetData(), CComment_rule_Base::GetDependent_rules(), CUser_object::GetFieldRef(), CComment_rule_Base::GetFields(), CUser_field_Base::C_Data::GetInt(), CConstRef< C, Locker >::GetPointer(), CComment_rule_Base::GetRequire_order(), CUser_field_Base::C_Data::GetStr(), NStr::IntToString(), NStr::IsBlank(), CUser_field_Base::C_Data::IsInt(), CComment_rule_Base::IsSetDependent_rules(), CUser_field_Base::C_Data::IsStr(), ITERATE, kEmptyStr, label, and rapidjson::value.
Referenced by FindAppropriateRule(), CComment_set::GetKeywords(), CStructuredCommentField::IsValid(), CValidError_desc::ValidateStructuredComment(), CNewCleanup_imp::x_FixStructuredCommentKeywords(), and CKeywordsItem::x_GatherInfo().
Definition at line 150 of file Comment_rule.cpp.
References NStr::Equal(), SStaticPair< FirstType, SecondType >::first, i, k_NumStructuredCommentKeywords, NormalizePrefix(), s_StructuredCommentKeywords, and SStaticPair< FirstType, SecondType >::second.
Referenced by BOOST_AUTO_TEST_CASE(), CComment_set::GetKeywords(), s_GetKeywordForStructuredComment(), and CNewCleanup_imp::x_FixStructuredCommentKeywords().
Definition at line 120 of file Comment_rule.cpp.
References NormalizePrefix().
Referenced by CComment_set::GetFieldNames(), CComment_set::GetKeywords(), CStructuredCommentField::MakeUserObject(), CCleanup::s_CleanupStructuredComment(), CApplyStructCommentTreeItemData::SetData(), CEditingActionDescStructCommDbName::SetValue(), CMacroFunction_ParseToStructComm::TheFunction(), and CMacroFunction_SetStructCommDb::x_MakeNewStructuredComment().
Definition at line 129 of file Comment_rule.cpp.
References NormalizePrefix().
Referenced by CStructuredCommentField::MakeUserObject(), CCleanup::s_CleanupStructuredComment(), CApplyStructCommentTreeItemData::SetData(), CEditingActionDescStructCommDbName::SetValue(), CMacroFunction_ParseToStructComm::TheFunction(), and CMacroFunction_SetStructCommDb::x_MakeNewStructuredComment().
|
static |
Definition at line 64 of file Comment_rule.cpp.
References NStr::EndsWith(), NStr::eNocase, NStr::IsBlank(), and NStr::StartsWith().
Referenced by CStructuredCommentField::CStructuredCommentField(), CComment_set::FindCommentRuleEx(), GetStructuredCommentPrefix(), CEditingActionDescStructCommDbName::GetValue(), CStructuredCommentField::IsStructuredCommentForThisField(), KeywordForPrefix(), MakePrefixFromRoot(), MakeSuffixFromRoot(), CStructuredCommentField::MakeUserObject(), CCleanup::s_CleanupStructuredComment(), CApplyStructCommentTreeItemData::SetData(), and CValidError_desc::x_ValidateStructuredCommentSuffix().
|
private |
Definition at line 165 of file Comment_rule.cpp.
References NStr::Equal(), SStaticPair< FirstType, SecondType >::first, i, k_NumStructuredCommentKeywords, s_StructuredCommentKeywords, and SStaticPair< FirstType, SecondType >::second.
Referenced by BOOST_AUTO_TEST_CASE().
bool CComment_rule::ReorderFields | ( | CUser_object & | user | ) | const |
Definition at line 468 of file Comment_rule.cpp.
References CSerialObject::Assign(), NStr::Equal(), Get(), CField_set_Base::Get(), CComment_rule_Base::GetFields(), CUser_object_Base::IsSetData(), CComment_rule_Base::IsSetFields(), kStructuredCommentPrefix, kStructuredCommentSuffix, label, and CUser_object_Base::SetData().
Referenced by BOOST_AUTO_TEST_CASE(), CStructuredCommentField::ReorderFields(), and CCleanup::s_CleanupStructuredComment().