本文整理汇总了C++中serializer::setParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ serializer::setParameter方法的具体用法?C++ serializer::setParameter怎么用?C++ serializer::setParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serializer
的用法示例。
在下文中一共展示了serializer::setParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void
SerializerImpl::setSerializationParameters(
serializer& aInternalSerializer,
ItemSequence* aSerializerOptions)
{
Item lItem;
Iterator_t ser_iter = aSerializerOptions->getIterator();
ser_iter->open();
while (ser_iter->next(lItem)) {
Item lNodeName;
lItem.getNodeName(lNodeName);
aInternalSerializer.setParameter(lNodeName.getLocalName().c_str(), lItem.getStringValue().c_str());
}
ser_iter->close();
}
示例2: switch
static void
convertSerializationMethod(
serializer& aInternalSerializer,
const char* aParameter,
Zorba_serialization_method_t aMethod)
{
switch (aMethod)
{
case ZORBA_SERIALIZATION_METHOD_XML:
aInternalSerializer.setParameter(aParameter, "xml"); break;
case ZORBA_SERIALIZATION_METHOD_HTML:
aInternalSerializer.setParameter(aParameter, "html"); break;
case ZORBA_SERIALIZATION_METHOD_XHTML:
aInternalSerializer.setParameter(aParameter, "xhtml"); break;
case ZORBA_SERIALIZATION_METHOD_TEXT:
aInternalSerializer.setParameter(aParameter, "text"); break;
case ZORBA_SERIALIZATION_METHOD_BINARY:
aInternalSerializer.setParameter(aParameter, "binary"); break;
case ZORBA_SERIALIZATION_METHOD_JSON:
aInternalSerializer.setParameter(aParameter, "json"); break;
case ZORBA_SERIALIZATION_METHOD_JSON_XML_HYBRID:
aInternalSerializer.setParameter(aParameter, "json-xml-hybrid"); break;
}
}
示例3: convertSerializationMethod
void
SerializerImpl::setSerializationParameters(
serializer& aInternalSerializer,
const Zorba_SerializerOptions_t& aSerializerOptions)
{
convertSerializationMethod(aInternalSerializer, "method",
aSerializerOptions.ser_method);
switch (aSerializerOptions.byte_order_mark)
{
case ZORBA_BYTE_ORDER_MARK_YES:
aInternalSerializer.setParameter("byte-order-mark", "yes"); break;
case ZORBA_BYTE_ORDER_MARK_NO:
aInternalSerializer.setParameter("byte-order-mark", "no"); break;
}
switch (aSerializerOptions.include_content_type)
{
case ZORBA_INCLUDE_CONTENT_TYPE_YES:
aInternalSerializer.setParameter("include-content-type", "yes"); break;
case ZORBA_INCLUDE_CONTENT_TYPE_NO:
aInternalSerializer.setParameter("include-content-type", "no"); break;
}
switch (aSerializerOptions.indent)
{
case ZORBA_INDENT_YES:
aInternalSerializer.setParameter("indent", "yes"); break;
case ZORBA_INDENT_NO:
aInternalSerializer.setParameter("indent", "no"); break;
}
switch (aSerializerOptions.omit_xml_declaration)
{
case ZORBA_OMIT_XML_DECLARATION_YES:
aInternalSerializer.setParameter("omit-xml-declaration", "yes"); break;
case ZORBA_OMIT_XML_DECLARATION_NO:
aInternalSerializer.setParameter("omit-xml-declaration", "no"); break;
}
switch (aSerializerOptions.standalone)
{
case ZORBA_STANDALONE_YES:
aInternalSerializer.setParameter("standalone", "yes"); break;
case ZORBA_STANDALONE_NO:
aInternalSerializer.setParameter("standalone", "no"); break;
case ZORBA_STANDALONE_OMIT:
aInternalSerializer.setParameter("standalone", "omit"); break;
}
switch (aSerializerOptions.undeclare_prefixes)
{
case ZORBA_UNDECLARE_PREFIXES_YES:
aInternalSerializer.setParameter("undeclare-prefixes", "yes"); break;
case ZORBA_UNDECLARE_PREFIXES_NO:
aInternalSerializer.setParameter("undeclare-prefixes", "no"); break;
}
if (aSerializerOptions.encoding)
aInternalSerializer.setParameter("encoding", aSerializerOptions.encoding);
if (aSerializerOptions.media_type)
aInternalSerializer.setParameter("media-type", aSerializerOptions.media_type);
if (aSerializerOptions.doctype_system)
aInternalSerializer.setParameter("doctype-system", aSerializerOptions.doctype_system);
if (aSerializerOptions.doctype_public)
aInternalSerializer.setParameter("doctype-public", aSerializerOptions.doctype_public);
if (aSerializerOptions.cdata_section_elements)
aInternalSerializer.setParameter("cdata-section-elements", aSerializerOptions.cdata_section_elements);
if (aSerializerOptions.item_separator)
aInternalSerializer.setParameter("item-separator", aSerializerOptions.item_separator);
if (aSerializerOptions.version)
aInternalSerializer.setParameter("version", aSerializerOptions.version);
switch (aSerializerOptions.jsoniq_multiple_items)
{
case JSONIQ_MULTIPLE_ITEMS_NO:
aInternalSerializer.setParameter("jsoniq-multiple-items", "no");
break;
case JSONIQ_MULTIPLE_ITEMS_YES:
aInternalSerializer.setParameter("jsoniq-multiple-items", "yes");
break;
}
convertSerializationMethod(aInternalSerializer,
"jsoniq-xdm-node-output-method",
aSerializerOptions.jsoniq_xdm_method);
}