PageRenderTime 51ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/cln-1.3.2/src/base/input/cl_read_bad_syntax_exception.cc

#
C++ | 32 lines | 19 code | 9 blank | 4 comment | 2 complexity | 5f7d68baf58d0853ff1c7151ba30afc5 MD5 | raw file
Possible License(s): GPL-2.0
  1. // read_number_bad_syntax_exception().
  2. // General includes.
  3. #include "base/cl_sysdep.h"
  4. // Specification.
  5. #include "cln/number_io.h"
  6. // Implementation.
  7. #include <sstream>
  8. #include "cln/io.h"
  9. namespace cln {
  10. static inline const std::string
  11. read_number_bad_syntax_msg (const char * string, const char * string_limit)
  12. {
  13. std::ostringstream buf;
  14. fprint(buf, "Illegal number syntax: \"");
  15. for (const char * ptr = string; ptr != string_limit; ptr++)
  16. fprintchar(buf, *ptr);
  17. fprint(buf, "\"");
  18. return buf.str();
  19. }
  20. read_number_bad_syntax_exception::read_number_bad_syntax_exception (const char * string, const char * string_limit)
  21. : read_number_exception(read_number_bad_syntax_msg(string, string_limit))
  22. {}
  23. } // namespace cln