/*
 * Author:          Patrick-Christopher Mattulat
 * Co-Author:       Claude Sonnet 4.6 (LLM)
 * Company:         Lynar Studios
 * E-Mail:          webmaster@lynarstudios.com
 * Created:         2020-08-17
 * Changed:         2026-06-23
 *
 * */

#ifndef LS_STD_LONG_HPP
#define LS_STD_LONG_HPP

#include <ls-std/core/Class.hpp>
#include <ls-std/core/interface/IBoxing.hpp>
#include <ls-std/core/type/Types.hpp>
#include <ls-std/os/dynamic-goal.hpp>
#include <memory>

/*
 * @doc: class(name: 'Long', package: 'boxing')
 * @doc: boxing.Long.description('This class represents the primitive datatype long and provides functionalities for arithmetic operations and string representation.')
 * */

namespace ls::standard::boxing
{
  class LS_STD_DYNAMIC_GOAL Long : public ls::standard::core::Class, public ls::standard::core::interface_type::IBoxing
  {
    public:

      explicit Long(ls::standard::core::type::long_type _value);
      Long();
      ~Long() noexcept override;

      // assignment operators

      ls::standard::boxing::Long &operator=(ls::standard::core::type::long_type _value);

      // arithmetic operators

      ls::standard::core::type::long_type operator-() const;
      ls::standard::core::type::long_type operator+(const ls::standard::boxing::Long &_long) const;
      ls::standard::core::type::long_type operator+(ls::standard::core::type::long_type _value) const;
      ls::standard::core::type::long_type operator*(const ls::standard::boxing::Long &_long) const;
      ls::standard::core::type::long_type operator*(ls::standard::core::type::long_type _value) const;
      ls::standard::core::type::long_type operator-(const ls::standard::boxing::Long &_long) const;
      ls::standard::core::type::long_type operator-(ls::standard::core::type::long_type _value) const;
      ls::standard::core::type::long_type operator/(const ls::standard::boxing::Long &_long) const;
      ls::standard::core::type::long_type operator/(ls::standard::core::type::long_type _value) const;
      ls::standard::core::type::long_type operator%(const ls::standard::boxing::Long &_long) const;
      ls::standard::core::type::long_type operator%(ls::standard::core::type::long_type _value) const;

      // compound operators

      ls::standard::boxing::Long &operator+=(const ls::standard::boxing::Long &_long);
      ls::standard::boxing::Long &operator+=(ls::standard::core::type::long_type _value);
      ls::standard::boxing::Long &operator-=(const ls::standard::boxing::Long &_long);
      ls::standard::boxing::Long &operator-=(ls::standard::core::type::long_type _value);
      ls::standard::boxing::Long &operator*=(const ls::standard::boxing::Long &_long);
      ls::standard::boxing::Long &operator*=(ls::standard::core::type::long_type _value);
      ls::standard::boxing::Long &operator/=(const ls::standard::boxing::Long &_long);
      ls::standard::boxing::Long &operator/=(ls::standard::core::type::long_type _value);

      // comparison operators

      bool operator==(const ls::standard::boxing::Long &_long) const;
      bool operator==(ls::standard::core::type::long_type _value) const;
      bool operator!=(const ls::standard::boxing::Long &_long) const;
      bool operator!=(ls::standard::core::type::long_type _value) const;
      bool operator>(const ls::standard::boxing::Long &_long) const;
      bool operator>(ls::standard::core::type::long_type _value) const;
      bool operator>=(const ls::standard::boxing::Long &_long) const;
      bool operator>=(ls::standard::core::type::long_type _value) const;
      bool operator<(const ls::standard::boxing::Long &_long) const;
      bool operator<(ls::standard::core::type::long_type _value) const;
      bool operator<=(const ls::standard::boxing::Long &_long) const;
      bool operator<=(ls::standard::core::type::long_type _value) const;

      // logical operators

      friend bool operator!(const ls::standard::boxing::Long &_long)
      {
        return !_long.value;
      }

      // increment / decrement operator

      void operator++();
      void operator--();

      // implementation

      void parse(const ::std::string &_parseText) override;
      [[nodiscard]] ::std::string toString() override;

      // additional functionality

      [[nodiscard]] ls::standard::core::type::long_type getValue() const;

    private:

      ls::standard::core::type::long_type value{};

      [[nodiscard]] static ::std::string _fetchClassName();
  };
}

#endif
