str2num_exceptions.cpp 907 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // $Id$
  3. //
  4. #include<__vic/str2num.h>
  5. #include<stdexcept>
  6. namespace __vic {
  7. namespace impl {
  8. //----------------------------------------------------------------------------
  9. void throw_empty_integer()
  10. {
  11. throw std::invalid_argument("Invalid integer: empty string");
  12. }
  13. //----------------------------------------------------------------------------
  14. void throw_null_integer()
  15. {
  16. throw std::invalid_argument("Invalid integer: null string");
  17. }
  18. //----------------------------------------------------------------------------
  19. void throw_non_digit_char()
  20. {
  21. throw std::invalid_argument("Invalid integer: non-digit char");
  22. }
  23. //----------------------------------------------------------------------------
  24. void throw_integer_too_long()
  25. {
  26. throw std::range_error("Integer value is too long");
  27. }
  28. //----------------------------------------------------------------------------
  29. } // namespace
  30. } // namespace