/[projects]/smsdaemon/plugins/ListPlugin.cpp
ViewVC logotype

Annotation of /smsdaemon/plugins/ListPlugin.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 137 - (hide annotations) (download)
Sun Dec 7 11:08:31 2008 UTC (15 years, 6 months ago) by torben
File size: 570 byte(s)
ListPlugin.cpp: dont send the plugin descriptions back to user (too much text)

PluginManager.cpp, HostStatusPlugin.(h|cpp), CMakeLists.txt: 
	Add a new plugin which sends server status back to requester (data is from uptime(1) and df(1) )


1 torben 118 #include "ListPlugin.h"
2     #include "IGsmModem.h"
3     #include "Sms.h"
4     #include "common.h"
5     #include "PluginManager.h"
6    
7     ListPlugin::ListPlugin()
8     : Plugin("list", "return a list of all loaded plugins")
9     {
10     }
11    
12     void ListPlugin::Execute(IGsmModem& modem, SMS& sms)
13     {
14    
15     std::vector<Plugin*> plugins = Common::instance()->GetPluginManager()->GetPluginList();
16    
17     std::vector<Plugin*>::iterator it;
18    
19    
20     std::string reply = "Loaded plugins:\n";
21     for (it = plugins.begin(); it != plugins.end(); ++it)
22     {
23 torben 137 reply += (*it)->GetCommand() + "\n";
24 torben 118 }
25    
26     modem.SendSms(sms.sender, reply, true);
27     }

  ViewVC Help
Powered by ViewVC 1.1.20