mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05: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
@ -39,6 +39,8 @@ const uint32_t RS_STATUS_AWAY = 0x0002;
|
||||
const uint32_t RS_STATUS_BUSY = 0x0003;
|
||||
const uint32_t RS_STATUS_ONLINE = 0x0004;
|
||||
|
||||
std::string RsStatusString(uint32_t status);
|
||||
|
||||
class StatusInfo
|
||||
{
|
||||
public:
|
||||
|
@ -29,10 +29,33 @@ std::ostream& operator<<(std::ostream& out, const StatusInfo& si)
|
||||
{
|
||||
out << "StatusInfo: " << 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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
p3Status::p3Status()
|
||||
|
Loading…
Reference in New Issue
Block a user