<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.apertium.org/w/index.php?action=history&amp;feed=atom&amp;title=Template%3AC%2B%2B_D-Bus_snippet</id>
	<title>Template:C++ D-Bus snippet - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.apertium.org/w/index.php?action=history&amp;feed=atom&amp;title=Template%3AC%2B%2B_D-Bus_snippet"/>
	<link rel="alternate" type="text/html" href="https://wiki.apertium.org/w/index.php?title=Template:C%2B%2B_D-Bus_snippet&amp;action=history"/>
	<updated>2026-05-05T14:13:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.apertium.org/w/index.php?title=Template:C%2B%2B_D-Bus_snippet&amp;diff=3159&amp;oldid=prev</id>
		<title>Wynand.winterbach: Blah</title>
		<link rel="alternate" type="text/html" href="https://wiki.apertium.org/w/index.php?title=Template:C%2B%2B_D-Bus_snippet&amp;diff=3159&amp;oldid=prev"/>
		<updated>2007-12-19T21:59:59Z</updated>

		<summary type="html">&lt;p&gt;Blah&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;map&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;sstream&amp;gt;&lt;br /&gt;
#include &amp;lt;string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;dbus-c++/dbus.h&amp;gt;&lt;br /&gt;
#include &amp;quot;Translate-glue.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static const char* TRANSLATE_SERVICE_NAME = &amp;quot;org.apertium.mode&amp;quot;;&lt;br /&gt;
static const char* TRANSLATE_OBJECT_PATH = &amp;quot;/&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
class Translate&lt;br /&gt;
: public org::apertium::Translate,&lt;br /&gt;
  public DBus::IntrospectableProxy,&lt;br /&gt;
  public DBus::ObjectProxy&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
    Translate(DBus::Connection&amp;amp; connection, const char* path, const char* name)&lt;br /&gt;
    : DBus::ObjectProxy(connection, path, name) {&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
DBus::BusDispatcher dispatcher;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char** argv) {&lt;br /&gt;
    DBus::default_dispatcher = &amp;amp;dispatcher;&lt;br /&gt;
    DBus::Connection bus = DBus::Connection::SessionBus();&lt;br /&gt;
&lt;br /&gt;
    std::stringstream input;&lt;br /&gt;
    std::string mode;&lt;br /&gt;
    std::map&amp;lt; ::DBus::String, ::DBus::String&amp;gt; translate_options;&lt;br /&gt;
&lt;br /&gt;
    if (argc != 2) {&lt;br /&gt;
        std::cerr &amp;lt;&amp;lt; &amp;quot;usage: dbus_test &amp;lt;mode&amp;gt;&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    mode = std::string(argv[1]);&lt;br /&gt;
&lt;br /&gt;
    while (!std::cin.eof() and std::cin) {&lt;br /&gt;
        std::string str;&lt;br /&gt;
        std::cin &amp;gt;&amp;gt; str;&lt;br /&gt;
        input &amp;lt;&amp;lt; str &amp;lt;&amp;lt; &amp;quot; &amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    Translate translator(bus, TRANSLATE_OBJECT_PATH, TRANSLATE_SERVICE_NAME);&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; translator.translate(mode, translate_options, input.str()) &lt;br /&gt;
              &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wynand.winterbach</name></author>
		
	</entry>
</feed>