BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balxml::EncoderOptions Class Reference

#include <balxml_encoderoptions.h>

Public Types

enum  {
  ATTRIBUTE_ID_OBJECT_NAMESPACE = 0 , ATTRIBUTE_ID_SCHEMA_LOCATION = 1 , ATTRIBUTE_ID_TAG = 2 , ATTRIBUTE_ID_FORMATTING_MODE = 3 ,
  ATTRIBUTE_ID_INITIAL_INDENT_LEVEL = 4 , ATTRIBUTE_ID_SPACES_PER_LEVEL = 5 , ATTRIBUTE_ID_WRAP_COLUMN = 6 , ATTRIBUTE_ID_MAX_DECIMAL_TOTAL_DIGITS = 7 ,
  ATTRIBUTE_ID_MAX_DECIMAL_FRACTION_DIGITS = 8 , ATTRIBUTE_ID_SIGNIFICANT_DOUBLE_DIGITS = 9 , ATTRIBUTE_ID_ENCODING_STYLE = 10 , ATTRIBUTE_ID_ALLOW_CONTROL_CHARACTERS = 11 ,
  ATTRIBUTE_ID_OUTPUT_X_M_L_HEADER = 12 , ATTRIBUTE_ID_OUTPUT_X_S_I_ALIAS = 13 , ATTRIBUTE_ID_DATETIME_FRACTIONAL_SECOND_PRECISION = 14 , ATTRIBUTE_ID_USE_Z_ABBREVIATION_FOR_UTC = 15
}
 
enum  { NUM_ATTRIBUTES = 16 }
 
enum  {
  ATTRIBUTE_INDEX_OBJECT_NAMESPACE = 0 , ATTRIBUTE_INDEX_SCHEMA_LOCATION = 1 , ATTRIBUTE_INDEX_TAG = 2 , ATTRIBUTE_INDEX_FORMATTING_MODE = 3 ,
  ATTRIBUTE_INDEX_INITIAL_INDENT_LEVEL = 4 , ATTRIBUTE_INDEX_SPACES_PER_LEVEL = 5 , ATTRIBUTE_INDEX_WRAP_COLUMN = 6 , ATTRIBUTE_INDEX_MAX_DECIMAL_TOTAL_DIGITS = 7 ,
  ATTRIBUTE_INDEX_MAX_DECIMAL_FRACTION_DIGITS = 8 , ATTRIBUTE_INDEX_SIGNIFICANT_DOUBLE_DIGITS = 9 , ATTRIBUTE_INDEX_ENCODING_STYLE = 10 , ATTRIBUTE_INDEX_ALLOW_CONTROL_CHARACTERS = 11 ,
  ATTRIBUTE_INDEX_OUTPUT_X_M_L_HEADER = 12 , ATTRIBUTE_INDEX_OUTPUT_X_S_I_ALIAS = 13 , ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION = 14 , ATTRIBUTE_INDEX_USE_Z_ABBREVIATION_FOR_UTC = 15
}
 

Public Member Functions

 EncoderOptions (bslma::Allocator *basicAllocator=0)
 
 EncoderOptions (const EncoderOptions &original, bslma::Allocator *basicAllocator=0)
 
 ~EncoderOptions ()
 Destroy this object.
 
EncoderOptionsoperator= (const EncoderOptions &rhs)
 Assign to this object the value of the specified rhs object.
 
void reset ()
 
template<typename t_MANIPULATOR >
int manipulateAttributes (t_MANIPULATOR &manipulator)
 
template<typename t_MANIPULATOR >
int manipulateAttribute (t_MANIPULATOR &manipulator, int id)
 
template<typename t_MANIPULATOR >
int manipulateAttribute (t_MANIPULATOR &manipulator, const char *name, int nameLength)
 
void setObjectNamespace (const bsl::string_view &value)
 
void setSchemaLocation (const bsl::string_view &value)
 
void setTag (const bsl::string_view &value)
 Set the "Tag" attribute of this object to the specified value.
 
void setFormattingMode (int value)
 
void setInitialIndentLevel (int value)
 
void setSpacesPerLevel (int value)
 
void setWrapColumn (int value)
 
void setMaxDecimalTotalDigits (const bdlb::NullableValue< int > &value)
 
void setMaxDecimalFractionDigits (const bdlb::NullableValue< int > &value)
 
void setSignificantDoubleDigits (const bdlb::NullableValue< int > &value)
 
void setEncodingStyle (EncodingStyle::Value value)
 
void setAllowControlCharacters (bool value)
 
void setOutputXMLHeader (bool value)
 
void setOutputXSIAlias (bool value)
 
void setDatetimeFractionalSecondPrecision (int value)
 
void setUseZAbbreviationForUtc (bool value)
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 
template<typename t_ACCESSOR >
int accessAttributes (t_ACCESSOR &accessor) const
 
template<typename t_ACCESSOR >
int accessAttribute (t_ACCESSOR &accessor, int id) const
 
template<typename t_ACCESSOR >
int accessAttribute (t_ACCESSOR &accessor, const char *name, int nameLength) const
 
const bsl::stringobjectNamespace () const
 
const bsl::stringschemaLocation () const
 
const bsl::stringtag () const
 
int formattingMode () const
 Return the value of the "FormattingMode" attribute of this object.
 
int initialIndentLevel () const
 
int spacesPerLevel () const
 Return the value of the "SpacesPerLevel" attribute of this object.
 
int wrapColumn () const
 Return the value of the "WrapColumn" attribute of this object.
 
const bdlb::NullableValue< int > & maxDecimalTotalDigits () const
 
const bdlb::NullableValue< int > & maxDecimalFractionDigits () const
 
const bdlb::NullableValue< int > & significantDoubleDigits () const
 
EncodingStyle::Value encodingStyle () const
 Return the value of the "EncodingStyle" attribute of this object.
 
bool allowControlCharacters () const
 
bool outputXMLHeader () const
 Return the value of the "OutputXMLHeader" attribute of this object.
 
bool outputXSIAlias () const
 Return the value of the "OutputXSIAlias" attribute of this object.
 
int datetimeFractionalSecondPrecision () const
 
bool useZAbbreviationForUtc () const
 

Static Public Member Functions

static const bdlat_AttributeInfolookupAttributeInfo (int id)
 
static const bdlat_AttributeInfolookupAttributeInfo (const char *name, int nameLength)
 

Static Public Attributes

static const char CLASS_NAME []
 
static const int DEFAULT_INITIALIZER_FORMATTING_MODE
 
static const int DEFAULT_INITIALIZER_INITIAL_INDENT_LEVEL
 
static const int DEFAULT_INITIALIZER_SPACES_PER_LEVEL
 
static const int DEFAULT_INITIALIZER_WRAP_COLUMN
 
static const EncodingStyle::Value DEFAULT_INITIALIZER_ENCODING_STYLE
 
static const bool DEFAULT_INITIALIZER_ALLOW_CONTROL_CHARACTERS
 
static const bool DEFAULT_INITIALIZER_OUTPUT_X_M_L_HEADER
 
static const bool DEFAULT_INITIALIZER_OUTPUT_X_S_I_ALIAS
 
static const int DEFAULT_INITIALIZER_DATETIME_FRACTIONAL_SECOND_PRECISION
 
static const bool DEFAULT_INITIALIZER_USE_Z_ABBREVIATION_FOR_UTC
 
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY []
 

Detailed Description

Options for performing XML encodings. Encoding style is either COMPACT or PRETTY. If encoding style is COMPACT, no whitespace will be added between elements. If encoding style is PRETTY, then the InitialIndentLevel, SpacesPerLevel, and WrapColumn parameters are used to specify the formatting of the output. Note that InitialIndentLevel, SpacesPerLevel, and WrapColumn are ignored when EncodingStyle is COMPACT (this is the default). The generated C++ code for this schema element is created by using bas_codegen.pl, run by balxml/code_from_xsd.pl, with no hand-editing.

See balxml_encoderoptions

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ATTRIBUTE_ID_OBJECT_NAMESPACE 
ATTRIBUTE_ID_SCHEMA_LOCATION 
ATTRIBUTE_ID_TAG 
ATTRIBUTE_ID_FORMATTING_MODE 
ATTRIBUTE_ID_INITIAL_INDENT_LEVEL 
ATTRIBUTE_ID_SPACES_PER_LEVEL 
ATTRIBUTE_ID_WRAP_COLUMN 
ATTRIBUTE_ID_MAX_DECIMAL_TOTAL_DIGITS 
ATTRIBUTE_ID_MAX_DECIMAL_FRACTION_DIGITS 
ATTRIBUTE_ID_SIGNIFICANT_DOUBLE_DIGITS 
ATTRIBUTE_ID_ENCODING_STYLE 
ATTRIBUTE_ID_ALLOW_CONTROL_CHARACTERS 
ATTRIBUTE_ID_OUTPUT_X_M_L_HEADER 
ATTRIBUTE_ID_OUTPUT_X_S_I_ALIAS 
ATTRIBUTE_ID_DATETIME_FRACTIONAL_SECOND_PRECISION 
ATTRIBUTE_ID_USE_Z_ABBREVIATION_FOR_UTC 

◆ anonymous enum

anonymous enum
Enumerator
NUM_ATTRIBUTES 

◆ anonymous enum

anonymous enum
Enumerator
ATTRIBUTE_INDEX_OBJECT_NAMESPACE 
ATTRIBUTE_INDEX_SCHEMA_LOCATION 
ATTRIBUTE_INDEX_TAG 
ATTRIBUTE_INDEX_FORMATTING_MODE 
ATTRIBUTE_INDEX_INITIAL_INDENT_LEVEL 
ATTRIBUTE_INDEX_SPACES_PER_LEVEL 
ATTRIBUTE_INDEX_WRAP_COLUMN 
ATTRIBUTE_INDEX_MAX_DECIMAL_TOTAL_DIGITS 
ATTRIBUTE_INDEX_MAX_DECIMAL_FRACTION_DIGITS 
ATTRIBUTE_INDEX_SIGNIFICANT_DOUBLE_DIGITS 
ATTRIBUTE_INDEX_ENCODING_STYLE 
ATTRIBUTE_INDEX_ALLOW_CONTROL_CHARACTERS 
ATTRIBUTE_INDEX_OUTPUT_X_M_L_HEADER 
ATTRIBUTE_INDEX_OUTPUT_X_S_I_ALIAS 
ATTRIBUTE_INDEX_DATETIME_FRACTIONAL_SECOND_PRECISION 
ATTRIBUTE_INDEX_USE_Z_ABBREVIATION_FOR_UTC 

Constructor & Destructor Documentation

◆ EncoderOptions() [1/2]

balxml::EncoderOptions::EncoderOptions ( bslma::Allocator basicAllocator = 0)
explicit

Create an object of type EncoderOptions having the default value. Use the optionally specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ EncoderOptions() [2/2]

balxml::EncoderOptions::EncoderOptions ( const EncoderOptions original,
bslma::Allocator basicAllocator = 0 
)

Create an object of type EncoderOptions having the value of the specified original object. Use the optionally specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~EncoderOptions()

balxml::EncoderOptions::~EncoderOptions ( )

Member Function Documentation

◆ accessAttribute() [1/2]

template<typename t_ACCESSOR >
int balxml::EncoderOptions::accessAttribute ( t_ACCESSOR &  accessor,
const char *  name,
int  nameLength 
) const

Invoke the specified accessor on the (non-modifiable) attribute of this object indicated by the specified name of the specified nameLength, supplying accessor with the corresponding attribute information structure. Return the value returned from the invocation of accessor if name identifies an attribute of this class, and -1 otherwise.

◆ accessAttribute() [2/2]

template<typename t_ACCESSOR >
int balxml::EncoderOptions::accessAttribute ( t_ACCESSOR &  accessor,
int  id 
) const

Invoke the specified accessor on the (non-modifiable) attribute of this object indicated by the specified id, supplying accessor with the corresponding attribute information structure. Return the value returned from the invocation of accessor if id identifies an attribute of this class, and -1 otherwise.

◆ accessAttributes()

template<typename t_ACCESSOR >
int balxml::EncoderOptions::accessAttributes ( t_ACCESSOR &  accessor) const

Invoke the specified accessor sequentially on each (non-modifiable) attribute of this object, supplying accessor with the corresponding attribute information structure until such invocation returns a non-zero value. Return the value from the last invocation of accessor (i.e., the invocation that terminated the sequence).

◆ allowControlCharacters()

bool balxml::EncoderOptions::allowControlCharacters ( ) const
inline

Return the value of the "AllowControlCharacters" attribute of this object.

◆ datetimeFractionalSecondPrecision()

int balxml::EncoderOptions::datetimeFractionalSecondPrecision ( ) const
inline

Return the value of the "DatetimeFractionalSecondPrecision" attribute of this object.

◆ encodingStyle()

EncodingStyle::Value balxml::EncoderOptions::encodingStyle ( ) const
inline

◆ formattingMode()

int balxml::EncoderOptions::formattingMode ( ) const
inline

◆ initialIndentLevel()

int balxml::EncoderOptions::initialIndentLevel ( ) const
inline

Return the value of the "InitialIndentLevel" attribute of this object.

◆ lookupAttributeInfo() [1/2]

static const bdlat_AttributeInfo * balxml::EncoderOptions::lookupAttributeInfo ( const char *  name,
int  nameLength 
)
static

Return attribute information for the attribute indicated by the specified name of the specified nameLength if the attribute exists, and 0 otherwise.

◆ lookupAttributeInfo() [2/2]

static const bdlat_AttributeInfo * balxml::EncoderOptions::lookupAttributeInfo ( int  id)
static

Return attribute information for the attribute indicated by the specified id if the attribute exists, and 0 otherwise.

◆ manipulateAttribute() [1/2]

template<typename t_MANIPULATOR >
int balxml::EncoderOptions::manipulateAttribute ( t_MANIPULATOR &  manipulator,
const char *  name,
int  nameLength 
)

Invoke the specified manipulator on the address of the (modifiable) attribute indicated by the specified name of the specified nameLength, supplying manipulator with the corresponding attribute information structure. Return the value returned from the invocation of manipulator if name identifies an attribute of this class, and -1 otherwise.

◆ manipulateAttribute() [2/2]

template<typename t_MANIPULATOR >
int balxml::EncoderOptions::manipulateAttribute ( t_MANIPULATOR &  manipulator,
int  id 
)

Invoke the specified manipulator on the address of the (modifiable) attribute indicated by the specified id, supplying manipulator with the corresponding attribute information structure. Return the value returned from the invocation of manipulator if id identifies an attribute of this class, and -1 otherwise.

◆ manipulateAttributes()

template<typename t_MANIPULATOR >
int balxml::EncoderOptions::manipulateAttributes ( t_MANIPULATOR &  manipulator)

Invoke the specified manipulator sequentially on the address of each (modifiable) attribute of this object, supplying manipulator with the corresponding attribute information structure until such invocation returns a non-zero value. Return the value from the last invocation of manipulator (i.e., the invocation that terminated the sequence).

◆ maxDecimalFractionDigits()

const bdlb::NullableValue< int > & balxml::EncoderOptions::maxDecimalFractionDigits ( ) const
inline

Return a reference offering non-modifiable access to the "MaxDecimalFractionDigits" attribute of this object.

◆ maxDecimalTotalDigits()

const bdlb::NullableValue< int > & balxml::EncoderOptions::maxDecimalTotalDigits ( ) const
inline

Return a reference offering non-modifiable access to the "MaxDecimalTotalDigits" attribute of this object.

◆ objectNamespace()

const bsl::string & balxml::EncoderOptions::objectNamespace ( ) const
inline

Return a reference offering non-modifiable access to the "ObjectNamespace" attribute of this object.

◆ operator=()

EncoderOptions & balxml::EncoderOptions::operator= ( const EncoderOptions rhs)

◆ outputXMLHeader()

bool balxml::EncoderOptions::outputXMLHeader ( ) const
inline

◆ outputXSIAlias()

bool balxml::EncoderOptions::outputXSIAlias ( ) const
inline

◆ print()

bsl::ostream & balxml::EncoderOptions::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Format this object to the specified output stream at the optionally specified indentation level and return a reference to the modifiable stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. Each line is indented by the absolute value of level * spacesPerLevel. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, suppress line breaks and format the entire output on one line. If stream is initially invalid, this operation has no effect. Note that a trailing newline is provided in multiline mode only.

◆ reset()

void balxml::EncoderOptions::reset ( )

Reset this object to the default value (i.e., its value upon default construction).

◆ schemaLocation()

const bsl::string & balxml::EncoderOptions::schemaLocation ( ) const
inline

Return a reference offering non-modifiable access to the "SchemaLocation" attribute of this object.

◆ setAllowControlCharacters()

void balxml::EncoderOptions::setAllowControlCharacters ( bool  value)
inline

Set the "AllowControlCharacters" attribute of this object to the specified value.

◆ setDatetimeFractionalSecondPrecision()

void balxml::EncoderOptions::setDatetimeFractionalSecondPrecision ( int  value)
inline

Set the "DatetimeFractionalSecondPrecision" attribute of this object to the specified value.

◆ setEncodingStyle()

void balxml::EncoderOptions::setEncodingStyle ( EncodingStyle::Value  value)
inline

Set the "EncodingStyle" attribute of this object to the specified value.

◆ setFormattingMode()

void balxml::EncoderOptions::setFormattingMode ( int  value)
inline

Set the "FormattingMode" attribute of this object to the specified value.

◆ setInitialIndentLevel()

void balxml::EncoderOptions::setInitialIndentLevel ( int  value)
inline

Set the "InitialIndentLevel" attribute of this object to the specified value.

◆ setMaxDecimalFractionDigits()

void balxml::EncoderOptions::setMaxDecimalFractionDigits ( const bdlb::NullableValue< int > &  value)
inline

Set the "MaxDecimalFractionDigits" attribute of this object to the specified value.

◆ setMaxDecimalTotalDigits()

void balxml::EncoderOptions::setMaxDecimalTotalDigits ( const bdlb::NullableValue< int > &  value)
inline

Set the "MaxDecimalTotalDigits" attribute of this object to the specified value.

◆ setObjectNamespace()

void balxml::EncoderOptions::setObjectNamespace ( const bsl::string_view value)
inline

Set the "ObjectNamespace" attribute of this object to the specified value.

◆ setOutputXMLHeader()

void balxml::EncoderOptions::setOutputXMLHeader ( bool  value)
inline

Set the "OutputXMLHeader" attribute of this object to the specified value.

◆ setOutputXSIAlias()

void balxml::EncoderOptions::setOutputXSIAlias ( bool  value)
inline

Set the "OutputXSIAlias" attribute of this object to the specified value.

◆ setSchemaLocation()

void balxml::EncoderOptions::setSchemaLocation ( const bsl::string_view value)
inline

Set the "SchemaLocation" attribute of this object to the specified value.

◆ setSignificantDoubleDigits()

void balxml::EncoderOptions::setSignificantDoubleDigits ( const bdlb::NullableValue< int > &  value)
inline

Set the "SignificantDoubleDigits" attribute of this object to the specified value.

◆ setSpacesPerLevel()

void balxml::EncoderOptions::setSpacesPerLevel ( int  value)
inline

Set the "SpacesPerLevel" attribute of this object to the specified value.

◆ setTag()

void balxml::EncoderOptions::setTag ( const bsl::string_view value)
inline

◆ setUseZAbbreviationForUtc()

void balxml::EncoderOptions::setUseZAbbreviationForUtc ( bool  value)
inline

Set the "UseZAbbreviationForUtc" attribute of this object to the specified value.

◆ setWrapColumn()

void balxml::EncoderOptions::setWrapColumn ( int  value)
inline

Set the "WrapColumn" attribute of this object to the specified value.

◆ significantDoubleDigits()

const bdlb::NullableValue< int > & balxml::EncoderOptions::significantDoubleDigits ( ) const
inline

Return a reference offering non-modifiable access to the "SignificantDoubleDigits" attribute of this object.

◆ spacesPerLevel()

int balxml::EncoderOptions::spacesPerLevel ( ) const
inline

◆ tag()

const bsl::string & balxml::EncoderOptions::tag ( ) const
inline

Return a reference offering non-modifiable access to the "Tag" attribute of this object.

◆ useZAbbreviationForUtc()

bool balxml::EncoderOptions::useZAbbreviationForUtc ( ) const
inline

Return the value of the "UseZAbbreviationForUtc" attribute of this object.

◆ wrapColumn()

int balxml::EncoderOptions::wrapColumn ( ) const
inline

Member Data Documentation

◆ ATTRIBUTE_INFO_ARRAY

const bdlat_AttributeInfo balxml::EncoderOptions::ATTRIBUTE_INFO_ARRAY[]
static

◆ CLASS_NAME

const char balxml::EncoderOptions::CLASS_NAME[]
static

◆ DEFAULT_INITIALIZER_ALLOW_CONTROL_CHARACTERS

const bool balxml::EncoderOptions::DEFAULT_INITIALIZER_ALLOW_CONTROL_CHARACTERS
static

◆ DEFAULT_INITIALIZER_DATETIME_FRACTIONAL_SECOND_PRECISION

const int balxml::EncoderOptions::DEFAULT_INITIALIZER_DATETIME_FRACTIONAL_SECOND_PRECISION
static

◆ DEFAULT_INITIALIZER_ENCODING_STYLE

const EncodingStyle::Value balxml::EncoderOptions::DEFAULT_INITIALIZER_ENCODING_STYLE
static

◆ DEFAULT_INITIALIZER_FORMATTING_MODE

const int balxml::EncoderOptions::DEFAULT_INITIALIZER_FORMATTING_MODE
static

◆ DEFAULT_INITIALIZER_INITIAL_INDENT_LEVEL

const int balxml::EncoderOptions::DEFAULT_INITIALIZER_INITIAL_INDENT_LEVEL
static

◆ DEFAULT_INITIALIZER_OUTPUT_X_M_L_HEADER

const bool balxml::EncoderOptions::DEFAULT_INITIALIZER_OUTPUT_X_M_L_HEADER
static

◆ DEFAULT_INITIALIZER_OUTPUT_X_S_I_ALIAS

const bool balxml::EncoderOptions::DEFAULT_INITIALIZER_OUTPUT_X_S_I_ALIAS
static

◆ DEFAULT_INITIALIZER_SPACES_PER_LEVEL

const int balxml::EncoderOptions::DEFAULT_INITIALIZER_SPACES_PER_LEVEL
static

◆ DEFAULT_INITIALIZER_USE_Z_ABBREVIATION_FOR_UTC

const bool balxml::EncoderOptions::DEFAULT_INITIALIZER_USE_Z_ABBREVIATION_FOR_UTC
static

◆ DEFAULT_INITIALIZER_WRAP_COLUMN

const int balxml::EncoderOptions::DEFAULT_INITIALIZER_WRAP_COLUMN
static

The documentation for this class was generated from the following file: