mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 20:04:24 -04:00
Added RsStatusString() - returns a string for given status number
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@527 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a5d69bee24
commit
3eafd7d00e
2 changed files with 26 additions and 1 deletions
|
@ -39,6 +39,8 @@ const uint32_t RS_STATUS_AWAY = 0x0002;
|
||||||
const uint32_t RS_STATUS_BUSY = 0x0003;
|
const uint32_t RS_STATUS_BUSY = 0x0003;
|
||||||
const uint32_t RS_STATUS_ONLINE = 0x0004;
|
const uint32_t RS_STATUS_ONLINE = 0x0004;
|
||||||
|
|
||||||
|
std::string RsStatusString(uint32_t status);
|
||||||
|
|
||||||
class StatusInfo
|
class StatusInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -29,10 +29,33 @@ std::ostream& operator<<(std::ostream& out, const StatusInfo& si)
|
||||||
{
|
{
|
||||||
out << "StatusInfo: " << std::endl;
|
out << "StatusInfo: " << std::endl;
|
||||||
out << "id: " << si.id << std::endl;
|
out << "id: " << si.id << std::endl;
|
||||||
out << "status: " << si.status << std::endl;
|
out << "status: " << si.status;
|
||||||
|
out << " (" << RsStatusString(si.status) << ")" << std::endl;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string RsStatusString(uint32_t status)
|
||||||
|
{
|
||||||
|
std::string str;
|
||||||
|
if (status == RS_STATUS_OFFLINE)
|
||||||
|
{
|
||||||
|
str = "Offline";
|
||||||
|
}
|
||||||
|
else if (status == RS_STATUS_AWAY)
|
||||||
|
{
|
||||||
|
str = "Away";
|
||||||
|
}
|
||||||
|
else if (status == RS_STATUS_BUSY)
|
||||||
|
{
|
||||||
|
str = "Busy";
|
||||||
|
}
|
||||||
|
else if (status == RS_STATUS_ONLINE)
|
||||||
|
{
|
||||||
|
str = "Online";
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
RsStatus *rsStatus = NULL;
|
RsStatus *rsStatus = NULL;
|
||||||
|
|
||||||
p3Status::p3Status()
|
p3Status::p3Status()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue