Class.cpp 712 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-08-07
  6. * Changed: 2023-02-07
  7. *
  8. * */
  9. #include <ls-std/core/Class.hpp>
  10. #include <ls-std/core/exception/IllegalArgumentException.hpp>
  11. ls::std::core::Class::Class(const ::std::string &_name)
  12. {
  13. this->_assignClassName(_name);
  14. }
  15. ls::std::core::Class::~Class() = default;
  16. ::std::string ls::std::core::Class::getClassName()
  17. {
  18. return this->name;
  19. }
  20. void ls::std::core::Class::_assignClassName(const ::std::string &_name)
  21. {
  22. if (_name.empty())
  23. {
  24. throw ls::std::core::IllegalArgumentException{"_name is empty"};
  25. }
  26. this->name = _name;
  27. }