Welcome to mirror list, hosted at ThFree Co, Russian Federation.

exception.cpp « base - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 389cb86af0507bcd8a7f72f05aa1d66a76680fe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "exception.hpp"

char const * RootException::what() const throw()
{
  size_t const count = m_Msg.size();

  string asciiMsg;
  asciiMsg.resize(count);

  for (size_t i = 0; i < count; ++i)
  {
    if (static_cast<unsigned char>(m_Msg[i]) < 128)
      asciiMsg[i] = char(m_Msg[i]);
    else
      asciiMsg[i] = '?';
  }

  static string msg;
  msg = string(m_What) + ", \"" + asciiMsg + "\"";
  return msg.c_str();
}