| 841 | } |
| 842 | |
| 843 | bool String(Context& context, const Ch* str, SizeType length, bool) const { |
| 844 | if (!(type_ & (1 << kStringSchemaType))) { |
| 845 | DisallowedType(context, GetStringString()); |
| 846 | CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString()); |
| 847 | } |
| 848 | |
| 849 | if (minLength_ != 0 || maxLength_ != SizeType(~0)) { |
| 850 | SizeType count; |
| 851 | if (internal::CountStringCodePoint<EncodingType>(str, length, &count)) { |
| 852 | if (count < minLength_) { |
| 853 | context.error_handler.TooShort(str, length, minLength_); |
| 854 | CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinLengthString()); |
| 855 | } |
| 856 | if (count > maxLength_) { |
| 857 | context.error_handler.TooLong(str, length, maxLength_); |
| 858 | CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxLengthString()); |
| 859 | } |
| 860 | } |
| 861 | } |
| 862 | |
| 863 | if (pattern_ && !IsPatternMatch(pattern_, str, length)) { |
| 864 | context.error_handler.DoesNotMatch(str, length); |
| 865 | CEREAL_RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternString()); |
| 866 | } |
| 867 | |
| 868 | return CreateParallelValidator(context); |
| 869 | } |
| 870 | |
| 871 | bool StartObject(Context& context) const { |
| 872 | if (!(type_ & (1 << kObjectSchemaType))) { |
nothing calls this directly
no test coverage detected