Class.cpp 614 B

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