<commit_before>/*
  Copyright (c) 2014, <NAME>, Ltd.
  All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

   1. Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

   3. Neither the name of J.D. Koftinoff Software, Ltd. nor the names of its
      contributors may be used to endorse or promote products derived from
      this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once

#include "jdksavdecc_util.h"
#include "jdksavdecc_print.h"

namespace JDKSAvdeccMCU
{

class Eui48 : public jdksavdecc_eui48
{
  public:
    Eui48() { jdksavdecc_eui48_init( this ); }

    Eui48( uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f )
    {
        value[0] = a;
        value[1] = b;
        value[2] = c;
        value[3] = d;
        value[4] = e;
        value[5] = f;
    }

    Eui48( jdksavdecc_eui48 const &other )
    {
        jdksavdecc_eui48_copy( this, &other );
    }

    Eui48( uint64_t v ) { jdksavdecc_eui48_init_from_uint64( this, v ); }

    Eui48( const char *s ) { jdksavdecc_eui48_init_from_cstr( this, s ); }

    Eui48( std::string const &s )
    {
        jdksavdecc_eui48_init_from_cstr( this, s.c_str() );
    }

    Eui48 const &operator=( Eui48 const &other )
    {
        jdksavdecc_eui48_copy( this, &other );
        return *this;
    }

    uint64_t convertToUint64() const
    {
        return jdksavdecc_eui48_convert_to_uint64( this );
    }

    bool isSet() const { return jdksavdecc_eui48_is_set( *this ) != 0; }

    int compare( const Eui48 &other ) const
    {
        return jdksavdecc_eui48_compare( this, &other );
    }

    bool operator<( const Eui48 &other ) const { return compare( other ) < 0; }

    bool operator<=( const Eui48 &other ) const
    {
        return compare( other ) <= 0;
    }

    bool operator==( const Eui48 &other ) const
    {
        return compare( other ) == 0;
    }

    bool operator>=( const Eui48 &other ) const
    {
        return compare( other ) >= 0;
    }

    bool operator>( const Eui48 &other ) const { return compare( other ) > 0; }

    bool operator!=( const Eui48 &other ) const
    {
        return compare( other ) != 0;
    }
};

class Eui64 : public jdksavdecc_eui64
{
  public:
    Eui64() { jdksavdecc_eui64_init( this ); }

    Eui64( uint8_t a,
           uint8_t b,
           uint8_t c,
           uint8_t d,
           uint8_t e,
           uint8_t f,
           uint8_t g,
           uint8_t h )
    {
        value[0] = a;
        value[1] = b;
        value[2] = c;
        value[3] = d;<commit_msg>Eui48 cleanups<commit_after>/*
  Copyright (c) 2014, <NAME>, Ltd.
  All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

   1. Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

   3. Neither the name of J.D. Koftinoff Software, Ltd. nor the names of its
      contributors may be used to endorse or promote products derived from
      this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once

#include "jdksavdecc_util.h"
#include "jdksavdecc_print.h"

namespace JDKSAvdeccMCU
{

///
/// \brief The Eui48 class hold an IEEE EUI48 / MAC Address
///
class Eui48 : public jdksavdecc_eui48
{
  public:

    ///
    /// \brief Eui48 constructor
    ///
    /// Initialize all octets to 0xff
    ///
    Eui48() { jdksavdecc_eui48_init( this ); }

    ///
    /// \brief Eui48 Construct with 6 octet values
    /// \param a-f The 6 octets that make up the EUI48
    ///
    Eui48( uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f )
    {
        value[0] = a;
        value[1] = b;
        value[2] = c;
        value[3] = d;
        value[4] = e;
        value[5] = f;
    }

    ///
    /// \brief Eui48 copy constructor from jdksavdecc_eui48 base class
    /// \param other
    ///
    Eui48( jdksavdecc_eui48 const &other )
    {
        jdksavdecc_eui48_copy( this, &other );
    }

    ///
    /// \brief Eui48 construct with right justified uint64_t
    /// \param v uint64_t with low 48 bits containing EUI48
    ///
    Eui48( uint64_t v ) { jdksavdecc_eui48_init_from_uint64( this, v ); }

    ///
    /// \brief Eui48 constructor from c string
    ///
    /// Parses in form UU:VV:WW:XX:YY:ZZ and
    /// UU-VV-WW-XX-YY-ZZ
    ///
    /// \param s pointer to C string
    ///
    Eui48( const char *s ) { jdksavdecc_eui48_init_from_cstr( this, s ); }

    ///
    /// \brief Eui48 constructor from C++ string
    ///
    /// Parses in form UU:VV:WW:XX:YY:ZZ and
    /// UU-VV-WW-XX-YY-ZZ
    ///
    /// \param s std::string reference
    ///
    Eui48( std::string const &s )
    {
        jdksavdecc_eui48_init_from_cstr( this, s.c_str() );
    }

    ///
    /// \brief operator = from jdksavdecc_eui48
    /// \param other reference to jdksavedecc_eui48
    /// \return const reference to self
    ///
    Eui48 const &operator=( jdksavdecc_eui48 const &other )
    {
        jdksavdecc_eui48_copy( this, &other );
        return *this;
    }

    ///
    /// \brief convertToUint64 convert to uine64_t
    /// \return uint64_t with lower 48 bits containing EUI48
    ///
    uint64_t convertToUint64() const
    {
        return jdksavdecc_eui48_convert_to_uint64( this );
    }

    ///
    /// \brief isSet checks is Eui48 has been initialized
    /// \return true if the EUI48 is not FF:FF:FF:FF:FF:FF
    ///
    bool isSet() const { return jdksavdecc_eui48_is_set( *this ) != 0; }

    ///
    /// \brief compare Numeric compare with other Ei48
    /// \param other jdksavdecc_eui48 reference to compare to
    /// \return -1 if less than other, 0 if equal to other, 1 if greater than other
    ///
    int compare( const jdksavdecc_eui48 &other ) const
    {
        return jdksavdecc_eui48_compare( this, &other );
    }

    bool operator<( const jdksavdecc_eui48 &other ) const { return compare( other ) < 0; }

    bool operator<=( const jdksavdecc_eui48 &other ) const
    {
        return compare( other ) <= 0;
    }

    bool operator==( const jdksavdecc_eui48 &other ) const
    {
        return compare( other ) == 0;
    }

    bool operator>=( const jdksavdecc_eui48 &other ) const
    {
        return compare( other ) >= 0;
    }

    bool operator>( const jdksavdecc_eui48 &other ) const { return compare( other ) > 0; }

    bool operator!=( const jdksavdecc_eui48 &other ) const
    {
        return compare( other ) != 0;
    }
};

class Eui64 : public jdksavdecc_eui64
{
  public:
    Eui64() { jdksavdecc_eui64_init( this ); }

    Eui64( uint8_t a,
           uint8_t b,
           uint8_t c,
           uint8_t d,
           uint8_t e,
           uint8_t f,
           uint8_t g,
           uint8_t h )
    {
        value[0] = a;
        value[1] = b;
        value[2] = c;
        value[3] = d;
{'fraction_non_alphanumeric': 0.08958012750054957, 'fraction_numerical': 0.03099582325785887, 'mean_word_length': 2.41297824456114, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3490706', 'n_tokens_mistral': 3226, 'n_tokens_neox': 2958, 'n_words': 1010}