<commit_before>#ifndef JEZUK_DOM_EXCEPTION_H
#define JEZUK_DOM_EXCEPTION_H

////////////////////////////
// C++ DOM definition
//
// $Id$
////////////////////////////

#include <stdexcept>

namespace Arabica
{
namespace DOM
{

class DOMBadCast : public std::bad_cast
{
public:
  DOMBadCast(const char* expectedType) :
      message_(std::string("Cannot cast to ") + expectedType)
  {
  } // DOMBadCast

  DOMBadCast(const DOMBadCast& rhs) :
      message_(rhs.message_)
  {
  } // DOMBadCase

  virtual ~DOMBadCast() throw()
  {
  } // DOMBadCast

  virtual const char* what() const throw()
  {
    return message_.c_str();
  } // what

private:
  const std::string message_;

  DOMBadCast& operator=(const DOMBadCast&);
  bool operator==(const DOMBadCast&) const;
}; // DOMBadCast
      
class DOMException : public std::runtime_error
{
public:
  enum CODE 
  {
    INDEX_SIZE_ERR,
    DOMSTRING_SIZE_ERR,
    HIERARCHY_REQUEST_ERR,
    WRONG_DOCUMENT_ERR,
    INVALID_CHARACTER_ERR,
    NO_DATA_ALLOWED_ERR,
    NO_MODIFICATION_ALLOWED_ERR,
    NOT_FOUND_ERR,
    NOT_SUPPORTED_ERR,
    INUSE_ATTRIBUTE_ERR,
    INVALID_STATE_ERR,
    SYNTAX_ERR,
    INVALID_MODIFICATION_ERR,
    NAMESPACE_ERR,
    INVALID_ACCESS_ERR
  }; // enum CODE

  DOMException(CODE code) : 
    std::runtime_error("DOMException"), 
    code_(code) 
  { 
  } // DOMException

  DOMException(const DOMException& rhs) :
    std::runtime_error(rhs),
    code_(rhs.code_)
  {
  } // DOMException

  virtual ~DOMException() throw()<commit_msg>Correct DOMException CODE enum values<commit_after>#ifndef JEZUK_DOM_EXCEPTION_H
#define JEZUK_DOM_EXCEPTION_H

////////////////////////////
// C++ DOM definition
//
// $Id$
////////////////////////////

#include <stdexcept>

namespace Arabica
{
namespace DOM
{

class DOMBadCast : public std::bad_cast
{
public:
  DOMBadCast(const char* expectedType) :
      message_(std::string("Cannot cast to ") + expectedType)
  {
  } // DOMBadCast

  DOMBadCast(const DOMBadCast& rhs) :
      message_(rhs.message_)
  {
  } // DOMBadCase

  virtual ~DOMBadCast() throw()
  {
  } // DOMBadCast

  virtual const char* what() const throw()
  {
    return message_.c_str();
  } // what

private:
  const std::string message_;

  DOMBadCast& operator=(const DOMBadCast&);
  bool operator==(const DOMBadCast&) const;
}; // DOMBadCast
      
class DOMException : public std::runtime_error
{
public:
  enum CODE 
  {
    INDEX_SIZE_ERR = 1,
    DOMSTRING_SIZE_ERR = 2,
    HIERARCHY_REQUEST_ERR = 3,
    WRONG_DOCUMENT_ERR = 4,
    INVALID_CHARACTER_ERR = 5,
    NO_DATA_ALLOWED_ERR = 6,
    NO_MODIFICATION_ALLOWED_ERR = 7,
    NOT_FOUND_ERR = 8,
    NOT_SUPPORTED_ERR = 9 ,
    INUSE_ATTRIBUTE_ERR = 10,
    INVALID_STATE_ERR,
    SYNTAX_ERR,
    INVALID_MODIFICATION_ERR,
    NAMESPACE_ERR,
    INVALID_ACCESS_ERR
  }; // enum CODE

  DOMException(CODE code) : 
    std::runtime_error("DOMException"), 
    code_(code) 
  { 
  } // DOMException

  DOMException(const DOMException& rhs) :
    std::runtime_error(rhs),
    code_(rhs.code_)
  {
  } // DOMException

  virtual ~DOMException() throw()
{'fraction_non_alphanumeric': 0.14018087855297157, 'fraction_numerical': 0.0035529715762273903, 'mean_word_length': 2.9302030456852792, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '788543', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1057, 'n_words': 203}