Menu

[r2398]: / framework / trunk / tests / test_plugin_so.cpp  Maximize  Restore  History

Download this file

29 lines (25 with data), 582 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <cppcms/plugin.h>
#include <ctype.h>
#include "plugin_base.h"
namespace foo {
std::string lower(std::string f)
{
for(size_t i=0;i<f.size();i++) {
f[i]=tolower(f[i]);
}
return f;
}
class bar : public bar_base {
public:
bar(std::string const &m) : msg_(m) {}
virtual char const *msg() { return msg_.c_str(); };
static bar *create(std::string const &m)
{
return new bar(m);
}
private:
std::string msg_;
};
};
CPPCMS_PLUGIN_ENTRY(foo,lower,std::string(std::string const &))
CPPCMS_PLUGIN_ENTRY(foo,bar::create,bar_base *(std::string const &))
MongoDB Logo MongoDB