X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FConsole%2FtestServer.cc;h=69192a2cb033fd4b0a79941cf4dccfdbc3163fd8;hb=941ca33da6ee01d78c07fa6b514de10da1ef3948;hp=c18fe7057019f3f4e7ca59ed3b22b7de8c2d5348;hpb=9e09a3d9a5f3f41ea7661771987faec068da1182;p=senf.git diff --git a/senf/Utils/Console/testServer.cc b/senf/Utils/Console/testServer.cc index c18fe70..69192a2 100644 --- a/senf/Utils/Console/testServer.cc +++ b/senf/Utils/Console/testServer.cc @@ -29,6 +29,7 @@ #include namespace kw = senf::console::kw; +namespace fty = senf::console::factory; void echo(std::ostream & output, senf::console::ParseCommandInfo const & command) { @@ -48,10 +49,10 @@ struct TestObject TestObject() : dir(this) { - dir.add("vat", &TestObject::vat) - .arg("vat", "VAT in %", kw::default_value = 19) - .arg("amount", "Amount including VAT") - .doc("Returns the amount of {vat}-% VAT included in {amount}"); + dir.add("vat", fty::Command(&TestObject::vat, this) + .arg("vat", "VAT in %", kw::default_value = 19) + .arg("amount", "Amount including VAT") + .doc("Returns the amount of {vat}-% VAT included in {amount}") ); } double vat (int vat, double amount) @@ -80,13 +81,13 @@ int main(int, char **) .doc("This is the console test application"); senf::console::root() - .mkdir("console") - .doc("Console settings"); + .add("console",fty::Directory() + .doc("Console settings")); senf::console::DirectoryNode & serverDir ( senf::console::root() - .mkdir("server") - .doc("server commands") ); + .add("server",fty::Directory() + .doc("server commands"))); senf::console::ScopedDirectory<> testDir; senf::console::root() @@ -94,25 +95,25 @@ int main(int, char **) .doc("Test functions"); senf::console::root()["console"] - .add("showlog", &enableLogging) - .doc("Enable display of log messages on the current console"); + .add("showlog", fty::Command(&enableLogging) + .doc("Enable display of log messages on the current console")); - senf::console::root().link("sl", senf::console::root()["console"]("showlog")); + senf::console::root().add("sl", fty::Link(senf::console::root()["console"]("showlog"))); serverDir - .add("shutdown", &shutdownServer) - .doc("Terminate server application"); + .add("shutdown", fty::Command(&shutdownServer) + .doc("Terminate server application")); testDir - .add("echo", &echo) - .doc("Example of a function utilizing manual argument parsing"); + .add("echo", fty::Command(&echo) + .doc("Example of a function utilizing manual argument parsing")); TestObject test; testDir .add("extra", test.dir) .doc("Example of an instance directory"); - senf::console::root().link("ex", test.dir); + senf::console::root().add("ex", fty::Link(test.dir)); senf::console::Server::start( senf::INet4SocketAddress(23232u) ) .name("testServer");