CatapultServer  v0.5.0.1 (Elephant)
NamespaceNameValidator.cpp File Reference
Include dependency graph for NamespaceNameValidator.cpp:

Namespaces

 catapult
 
 catapult::validators
 

Typedefs

using catapult::validators::NameSet = std::unordered_set< std::string >
 

Functions

 catapult::validators::DECLARE_STATELESS_VALIDATOR (NamespaceName, Notification)(uint8_t maxNameSize
 

Variables

const NameSet & catapult::validators::reservedRootNamespaceNames
 
for(const auto &name :reservedRootNamespaceNames) reservedRootIds.emplace(model return catapult::validators::MAKE_STATELESS_VALIDATOR (NamespaceName,([maxNameSize, reservedRootIds](const auto &notification) { if(maxNameSize< notification.NameSize||!model::IsValidName(notification.NamePtr, notification.NameSize)) return Failure_Namespace_Invalid_Name;auto name=utils::RawString(reinterpret_cast< const char * >(notification.NamePtr), notification.NameSize);if(notification.NamespaceId !=model::GenerateNamespaceId(notification.ParentId, name)) return Failure_Namespace_Name_Id_Mismatch;auto namespaceId=Namespace_Base_Id==notification.ParentId ? notification.NamespaceId :notification.ParentId;if(reservedRootIds.cend() !=reservedRootIds.find(namespaceId)) return Failure_Namespace_Root_Name_Reserved;return ValidationResult::Success;}))