8#ifndef INCLUDED_BALJSN_DECODEROPTIONS
9#define INCLUDED_BALJSN_DECODEROPTIONS
128#include <balscm_version.h>
140#include <bsl_iosfwd.h>
141#include <bsl_limits.h>
145namespace baljsn {
class DecoderOptions; }
163 bool d_skipUnknownElements;
166 bool d_validateInputIsUtf8;
170 bool d_allowConsecutiveSeparators;
175 bool d_allowFormFeedAsWhitespace;
180 bool d_allowUnescapedControlCharacters;
183 bool d_allowMissingRequiredAttributes;
186 template <
typename t_HASH_ALGORITHM>
187 void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm)
const;
259#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
260 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
275#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
276 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
293 template <
typename t_MANIPULATOR>
302 template <
typename t_MANIPULATOR>
311 template <
typename t_MANIPULATOR>
357 bsl::ostream&
print(bsl::ostream& stream,
359 int spacesPerLevel = 4)
const;
367 template <
typename t_ACCESSOR>
375 template <
typename t_ACCESSOR>
384 template <
typename t_ACCESSOR>
387 int nameLength)
const;
424 return lhs.isEqualTo(rhs);
431 return !(lhs == rhs);
439 return rhs.print(stream, 0, -1);
445 template <
typename t_HASH_ALGORITHM>
449 object.hashAppendImpl(hashAlg);
470template <
typename t_HASH_ALGORITHM>
471void DecoderOptions::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm)
const
484bool DecoderOptions::isEqualTo(
const DecoderOptions& rhs)
const
486 return this->
maxDepth() == rhs.maxDepth() &&
497template <
typename t_MANIPULATOR>
540template <
typename t_MANIPULATOR>
543 enum { NOT_FOUND = -1 };
572template <
typename t_MANIPULATOR>
574 t_MANIPULATOR& manipulator,
578 enum { NOT_FOUND = -1 };
582 if (0 == attributeInfo) {
600 d_skipUnknownElements = value;
606 d_validateInputIsUtf8 = value;
612 d_allowConsecutiveSeparators = value;
618 d_allowFormFeedAsWhitespace = value;
624 d_allowUnescapedControlCharacters = value;
630 d_allowMissingRequiredAttributes = value;
634template <
typename t_ACCESSOR>
677template <
typename t_ACCESSOR>
680 enum { NOT_FOUND = -1 };
709template <
typename t_ACCESSOR>
711 t_ACCESSOR& accessor,
713 int nameLength)
const
715 enum { NOT_FOUND = -1 };
719 if (0 == attributeInfo) {
735 return d_skipUnknownElements;
741 return d_validateInputIsUtf8;
747 return d_allowConsecutiveSeparators;
753 return d_allowFormFeedAsWhitespace;
759 return d_allowUnescapedControlCharacters;
765 return d_allowMissingRequiredAttributes;
Definition baljsn_decoderoptions.h:155
void setMaxDepth(int value)
Set the "MaxDepth" attribute of this object to the specified value.
Definition baljsn_decoderoptions.h:590
DecoderOptions(const DecoderOptions &original)
void setAllowUnescapedControlCharacters(bool value)
Definition baljsn_decoderoptions.h:622
static const bool DEFAULT_INITIALIZER_ALLOW_FORM_FEED_AS_WHITESPACE
Definition baljsn_decoderoptions.h:228
bool validateInputIsUtf8() const
Definition baljsn_decoderoptions.h:739
static const char CLASS_NAME[]
Definition baljsn_decoderoptions.h:218
friend void hashAppend(t_HASH_ALGORITHM &hashAlg, const DecoderOptions &object)
Definition baljsn_decoderoptions.h:446
bool allowUnescapedControlCharacters() const
Definition baljsn_decoderoptions.h:757
bool allowMissingRequiredAttributes() const
Definition baljsn_decoderoptions.h:763
friend bool operator==(const DecoderOptions &lhs, const DecoderOptions &rhs)
Definition baljsn_decoderoptions.h:421
@ ATTRIBUTE_INDEX_ALLOW_CONSECUTIVE_SEPARATORS
Definition baljsn_decoderoptions.h:211
@ ATTRIBUTE_INDEX_MAX_DEPTH
Definition baljsn_decoderoptions.h:208
@ ATTRIBUTE_INDEX_VALIDATE_INPUT_IS_UTF8
Definition baljsn_decoderoptions.h:210
@ ATTRIBUTE_INDEX_ALLOW_MISSING_REQUIRED_ATTRIBUTES
Definition baljsn_decoderoptions.h:214
@ ATTRIBUTE_INDEX_ALLOW_FORM_FEED_AS_WHITESPACE
Definition baljsn_decoderoptions.h:212
@ ATTRIBUTE_INDEX_ALLOW_UNESCAPED_CONTROL_CHARACTERS
Definition baljsn_decoderoptions.h:213
@ ATTRIBUTE_INDEX_SKIP_UNKNOWN_ELEMENTS
Definition baljsn_decoderoptions.h:209
@ NUM_ATTRIBUTES
Definition baljsn_decoderoptions.h:204
void setValidateInputIsUtf8(bool value)
Definition baljsn_decoderoptions.h:604
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
void setAllowConsecutiveSeparators(bool value)
Definition baljsn_decoderoptions.h:610
int manipulateAttribute(t_MANIPULATOR &manipulator, int id)
Definition baljsn_decoderoptions.h:541
friend bsl::ostream & operator<<(bsl::ostream &stream, const DecoderOptions &rhs)
Definition baljsn_decoderoptions.h:436
@ ATTRIBUTE_ID_ALLOW_CONSECUTIVE_SEPARATORS
Definition baljsn_decoderoptions.h:197
@ ATTRIBUTE_ID_VALIDATE_INPUT_IS_UTF8
Definition baljsn_decoderoptions.h:196
@ ATTRIBUTE_ID_ALLOW_MISSING_REQUIRED_ATTRIBUTES
Definition baljsn_decoderoptions.h:200
@ ATTRIBUTE_ID_ALLOW_UNESCAPED_CONTROL_CHARACTERS
Definition baljsn_decoderoptions.h:199
@ ATTRIBUTE_ID_ALLOW_FORM_FEED_AS_WHITESPACE
Definition baljsn_decoderoptions.h:198
@ ATTRIBUTE_ID_MAX_DEPTH
Definition baljsn_decoderoptions.h:194
@ ATTRIBUTE_ID_SKIP_UNKNOWN_ELEMENTS
Definition baljsn_decoderoptions.h:195
~DecoderOptions()
Destroy this object.
static const bool DEFAULT_INITIALIZER_ALLOW_MISSING_REQUIRED_ATTRIBUTES
Definition baljsn_decoderoptions.h:232
void setAllowFormFeedAsWhitespace(bool value)
Definition baljsn_decoderoptions.h:616
static const bool DEFAULT_INITIALIZER_VALIDATE_INPUT_IS_UTF8
Definition baljsn_decoderoptions.h:224
static const bool DEFAULT_INITIALIZER_ALLOW_UNESCAPED_CONTROL_CHARACTERS
Definition baljsn_decoderoptions.h:230
int manipulateAttributes(t_MANIPULATOR &manipulator)
Definition baljsn_decoderoptions.h:498
bool skipUnknownElements() const
Definition baljsn_decoderoptions.h:733
static const int DEFAULT_INITIALIZER_MAX_DEPTH
Definition baljsn_decoderoptions.h:220
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
bool allowConsecutiveSeparators() const
Definition baljsn_decoderoptions.h:745
friend bool operator!=(const DecoderOptions &lhs, const DecoderOptions &rhs)
Returns !(lhs == rhs)
Definition baljsn_decoderoptions.h:428
void setAllowMissingRequiredAttributes(bool value)
Definition baljsn_decoderoptions.h:628
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition baljsn_decoderoptions.h:234
static const bool DEFAULT_INITIALIZER_SKIP_UNKNOWN_ELEMENTS
Definition baljsn_decoderoptions.h:222
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
int accessAttribute(t_ACCESSOR &accessor, int id) const
Definition baljsn_decoderoptions.h:678
void setSkipUnknownElements(bool value)
Definition baljsn_decoderoptions.h:598
bool allowFormFeedAsWhitespace() const
Definition baljsn_decoderoptions.h:751
DecoderOptions()
Create an object of type DecoderOptions having the default value.
static const bool DEFAULT_INITIALIZER_ALLOW_CONSECUTIVE_SEPARATORS
Definition baljsn_decoderoptions.h:226
int maxDepth() const
Return the value of the "MaxDepth" attribute of this object.
Definition baljsn_decoderoptions.h:727
DecoderOptions & operator=(const DecoderOptions &rhs)
Assign to this object the value of the specified rhs object.
int accessAttributes(t_ACCESSOR &accessor) const
Definition baljsn_decoderoptions.h:635
#define BDLAT_DECL_SEQUENCE_WITH_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:294
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition baljsn_convertfromjsonoptions.h:112
bsl::enable_if<(bsl::is_integral< TYPE >::value||bsl::is_pointer< TYPE >::value||bsl::is_enum< TYPE >::value)&&!bsl::is_same< TYPE, bool >::value >::type hashAppend(HASH_ALGORITHM &hashAlg, TYPE input)
Definition bslh_hash.h:643
Definition bdlat_attributeinfo.h:139
int d_id
Definition bdlat_attributeinfo.h:142