Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes

balxml::EncoderOptions Class Reference

#include <balxml_encoderoptions.h>

List of all members.

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 ()
EncoderOptionsoperator= (const EncoderOptions &rhs)
void reset ()
template<class MANIPULATOR >
int manipulateAttributes (MANIPULATOR &manipulator)
template<class MANIPULATOR >
int manipulateAttribute (MANIPULATOR &manipulator, int id)
template<class MANIPULATOR >
int manipulateAttribute (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)
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<class ACCESSOR >
int accessAttributes (ACCESSOR &accessor) const
template<class ACCESSOR >
int accessAttribute (ACCESSOR &accessor, int id) const
template<class ACCESSOR >
int accessAttribute (ACCESSOR &accessor, const char *name, int nameLength) const
const bsl::stringobjectNamespace () const
const bsl::stringschemaLocation () const
const bsl::stringtag () const
int formattingMode () const
int initialIndentLevel () const
int spacesPerLevel () const
int wrapColumn () const
const bdlb::NullableValue< int > & maxDecimalTotalDigits () const
const bdlb::NullableValue< int > & maxDecimalFractionDigits () const
const bdlb::NullableValue< int > & significantDoubleDigits () const
EncodingStyle::Value encodingStyle () const
bool allowControlCharacters () const
bool outputXMLHeader () const
bool outputXSIAlias () const
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). This struct is generated using bas_codegen.pl called by balxml/code_from_xsd.pl

See Component balxml_encoderoptions


Member Enumeration Documentation

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
Enumerator:
NUM_ATTRIBUTES 
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

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.

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.

balxml::EncoderOptions::~EncoderOptions (  ) 

Destroy this object.


Member Function Documentation

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.

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.

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

Assign to this object the value of the specified rhs object.

void balxml::EncoderOptions::reset (  ) 

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

template<class MANIPULATOR >
int balxml::EncoderOptions::manipulateAttributes ( 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).

template<class MANIPULATOR >
int balxml::EncoderOptions::manipulateAttribute ( 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.

template<class MANIPULATOR >
int balxml::EncoderOptions::manipulateAttribute ( 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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

template<class ACCESSOR >
int balxml::EncoderOptions::accessAttributes ( 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).

template<class ACCESSOR >
int balxml::EncoderOptions::accessAttribute ( 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.

template<class ACCESSOR >
int balxml::EncoderOptions::accessAttribute ( 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.

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

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

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

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

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

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

int balxml::EncoderOptions::formattingMode (  )  const

Return a reference to the non-modifiable "FormattingMode" attribute of this object.

int balxml::EncoderOptions::initialIndentLevel (  )  const

Return a reference to the non-modifiable "InitialIndentLevel" attribute of this object.

int balxml::EncoderOptions::spacesPerLevel (  )  const

Return a reference to the non-modifiable "SpacesPerLevel" attribute of this object.

int balxml::EncoderOptions::wrapColumn (  )  const

Return a reference to the non-modifiable "WrapColumn" attribute of this object.

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

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

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

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

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

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

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

Return a reference to the non-modifiable "EncodingStyle" attribute of this object.

bool balxml::EncoderOptions::allowControlCharacters (  )  const

Return a reference to the non-modifiable "AllowControlCharacters" attribute of this object.

bool balxml::EncoderOptions::outputXMLHeader (  )  const

Return a reference to the non-modifiable "OutputXMLHeader" attribute of this object.

bool balxml::EncoderOptions::outputXSIAlias (  )  const

Return a reference to the non-modifiable "OutputXSIAlias" attribute of this object.

int balxml::EncoderOptions::datetimeFractionalSecondPrecision (  )  const

Return a reference to the non-modifiable "DatetimeFractionalSecondPrecision" attribute of this object.

bool balxml::EncoderOptions::useZAbbreviationForUtc (  )  const

Return a reference to the non-modifiable "UseZAbbreviationForUtc" attribute of this object.


Member Data Documentation

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

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