From 7009fa36f11a103525e4617f41b884bf6a2b8e87 Mon Sep 17 00:00:00 2001 From: chrisparker126 Date: Thu, 15 Apr 2010 10:50:41 +0000 Subject: [PATCH] removed old p3status.h/cc service, replaced with p3statusservice.h/cc - did not follow naming convention for services git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2716 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3status.cc | 119 ------------------------- libretroshare/src/services/p3status.h | 54 ----------- 2 files changed, 173 deletions(-) delete mode 100644 libretroshare/src/services/p3status.cc delete mode 100644 libretroshare/src/services/p3status.h diff --git a/libretroshare/src/services/p3status.cc b/libretroshare/src/services/p3status.cc deleted file mode 100644 index 731dd4be8..000000000 --- a/libretroshare/src/services/p3status.cc +++ /dev/null @@ -1,119 +0,0 @@ -/* - * libretroshare/src/services: p3status.cc - * - * RetroShare C++ . - * - * Copyright 2008 by Vinny Do. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - -#include "services/p3status.h" - -std::ostream& operator<<(std::ostream& out, const StatusInfo& si) -{ - out << "StatusInfo: " << std::endl; - out << "id: " << si.id << 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() -{ - loadDummyData(); -} - -p3Status::~p3Status() -{ -} - -/********* RsStatus ***********/ - -bool p3Status::getStatus(std::string id, StatusInfo& statusInfo) -{ - std::map::iterator it; - it = mStatusInfoMap.find(id); - if (it == mStatusInfoMap.end()) - { - return false; - } - - statusInfo.id = (it->second).id; - statusInfo.status = (it->second).status; - - return true; -} - -bool p3Status::setStatus(StatusInfo& statusInfo) -{ - mStatusInfoMap[statusInfo.id] = statusInfo; - - return true; -} - -/******************************/ - -void p3Status::loadDummyData() -{ - StatusInfo si; - - si.id = "id01"; - si.status = RS_STATUS_OFFLINE; - - setStatus(si); - - si.id = "id02"; - si.status = RS_STATUS_AWAY; - - setStatus(si); - - si.id = "id03"; - si.status = RS_STATUS_BUSY; - - setStatus(si); - - si.id = "id04"; - si.status = RS_STATUS_ONLINE; - - setStatus(si); -} diff --git a/libretroshare/src/services/p3status.h b/libretroshare/src/services/p3status.h deleted file mode 100644 index 11af7b1e9..000000000 --- a/libretroshare/src/services/p3status.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef RS_P3_STATUS_INTERFACE_H -#define RS_P3_STATUS_INTERFACE_H - -/* - * libretroshare/src/services: p3status.h - * - * RetroShare C++ . - * - * Copyright 2008 by Vinny Do. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - -#include - -#include "rsiface/rsstatus.h" - -class p3Status: public RsStatus -{ - public: - - p3Status(); -virtual ~p3Status(); - -/********* RsStatus ***********/ - -virtual bool getStatus(std::string id, StatusInfo& statusInfo); -virtual bool setStatus(StatusInfo& statusInfo); - -/******************************/ - - private: - -void loadDummyData(); -std::map mStatusInfoMap; - -}; - -#endif