<commit_before>/**
 * @author: <NAME>
 * See COPYING for copyright and distribution information.
 */

#ifndef NDN_BINARYXMLENCODER_HPP
#define NDN_BINARYXMLENCODER_HPP

#include <vector>
#include "../common.hpp"
#include "../util/dynamic-uchar-vector.hpp"
#include "../c/encoding/binary-xml-encoder.h"

namespace ndn {
  
/**
 * A BinaryXmlEncoder extends a C ndn_BinaryXmlEncoder struct and wraps related functions.
 */
class BinaryXmlEncoder : public ndn_BinaryXmlEncoder {
public:
  /**
   * Initialize the base ndn_BinaryXmlEncoder struct with an initial array of 16 bytes.  Use simpleRealloc.
   */
  BinaryXmlEncoder() 
  : output_(16)
  {
  }
  
  /**
   * Return the output as a shared_ptr.
   */
  ptr_lib::shared_ptr<std::vector<unsigned char> > getOutput() 
  {
    return output_.get();<commit_msg>Fix bug in constructor: need to call ndn_BinaryXmlEncoder_init.<commit_after>/**
 * @author: <NAME>
 * See COPYING for copyright and distribution information.
 */

#ifndef NDN_BINARYXMLENCODER_HPP
#define NDN_BINARYXMLENCODER_HPP

#include <vector>
#include "../common.hpp"
#include "../util/dynamic-uchar-vector.hpp"
#include "../c/encoding/binary-xml-encoder.h"

namespace ndn {
  
/**
 * A BinaryXmlEncoder extends a C ndn_BinaryXmlEncoder struct and wraps related functions.
 */
class BinaryXmlEncoder : public ndn_BinaryXmlEncoder {
public:
  /**
   * Initialize the base ndn_BinaryXmlEncoder struct with an initial array of 16 bytes.  Use simpleRealloc.
   */
  BinaryXmlEncoder() 
  : output_(1)
  {
    ndn_BinaryXmlEncoder_init(this, &output_);
  }
  
  /**
   * Return the output as a shared_ptr.
   */
  ptr_lib::shared_ptr<std::vector<unsigned char> > getOutput() 
  {
    return output_.get();
{'fraction_non_alphanumeric': 0.11596736596736597, 'fraction_numerical': 0.004079254079254079, 'mean_word_length': 3.8917378917378915, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3939552', 'n_tokens_mistral': 567, 'n_tokens_neox': 545, 'n_words': 142}