You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
574 B
C++
24 lines
574 B
C++
2 years ago
|
// This file is under GNU General Public License 3.0
|
||
|
// see LICENSE.txt
|
||
|
|
||
5 years ago
|
#include "status_to_string.hh"
|
||
|
#include <sstream>
|
||
|
|
||
|
|
||
2 years ago
|
namespace pEp {
|
||
5 years ago
|
|
||
2 years ago
|
// in pEpEngine.h positive values are hex, negative are decimal. :-o
|
||
|
// TODO: the code should be generated!
|
||
|
std::string status_to_string(PEP_STATUS status)
|
||
5 years ago
|
{
|
||
2 years ago
|
std::stringstream ss;
|
||
|
if (status > 0) {
|
||
|
ss << "0x" << std::hex << status;
|
||
|
} else {
|
||
|
ss << status;
|
||
|
}
|
||
|
return ss.str() + " \"" + pEp_status_to_string(status) + '"';
|
||
5 years ago
|
}
|
||
2 years ago
|
|
||
5 years ago
|
} // end of namespace pEp
|