/* libxml++
 * Copyright (C) 2000  Ari Johnson
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 */

/* Modified by Motama GmbH, Copyright (C) 2006-2007 Motama GmbH */


#ifndef NMM_XML_ENCODER_HPP
#define NMM_XML_ENCODER_HPP NMM_XML_ENCODER_HPP

#include "nmm/nmm_prefix.hpp"

#include <string>

namespace NMM {
  
  /** Helper class to encode Strings to and from UTF-8.
   */
  class XMLEncoder {
  public:
    /**
     * Constructor
     * @param encoding-standard as string
     */
    XMLEncoder(const std::string& e)
      : _encoding(e){};
    
    /** Encode the given string to UTF-8. 
     * 
     * The input-string must have a encoding as specified in the
     * contructor.
     */
    std::string getUTF8(const std::string& s);
    
    /** Encode a string to the standard specified in the constructor.
     *
     * The input-string must be in UTF-8
     */
    std::string getEncodedString(const std::string& s);
    
  private:
    std::string _encoding;
  };
  
}

#include "nmm/nmm_suffix.hpp"

#endif
