some header and include changes
This commit is contained in:
parent
b55f3cd36e
commit
f88e32ba32
7 changed files with 137 additions and 17 deletions
|
@ -18,7 +18,7 @@ endif
|
||||||
bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect
|
bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect
|
||||||
|
|
||||||
dbusxx_xml2cpp_SOURCES = xml.h xml.cpp xml2cpp.h xml2cpp.cpp \
|
dbusxx_xml2cpp_SOURCES = xml.h xml.cpp xml2cpp.h xml2cpp.cpp \
|
||||||
generate_adaptor.cpp generate_proxy.cpp generate_adaptor.h\
|
generate_adaptor.cpp generate_adaptor.h generate_proxy.cpp\
|
||||||
generate_proxy.h generator_utils.cpp generator_utils.h
|
generate_proxy.h generator_utils.cpp generator_utils.h
|
||||||
dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la) $(xml_LIBS)
|
dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la) $(xml_LIBS)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,30 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* D-Bus++ - C++ bindings for D-Bus
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser 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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "generator_utils.h"
|
#include "generator_utils.h"
|
||||||
#include "generate_adaptor.h"
|
#include "generate_adaptor.h"
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* D-Bus++ - C++ bindings for D-Bus
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser 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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __DBUSXX_TOOLS_GENERATE_ADAPTOR_H
|
#ifndef __DBUSXX_TOOLS_GENERATE_ADAPTOR_H
|
||||||
#define __DBUSXX_TOOLS_GENERATE_ADAPTOR_H
|
#define __DBUSXX_TOOLS_GENERATE_ADAPTOR_H
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "generator_utils.h"
|
#include "generator_utils.h"
|
||||||
#include "generate_proxy.h"
|
#include "generate_proxy.h"
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* D-Bus++ - C++ bindings for D-Bus
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser 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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __DBUSXX_TOOLS_GENERATE_PROXY_H
|
#ifndef __DBUSXX_TOOLS_GENERATE_PROXY_H
|
||||||
#define __DBUSXX_TOOLS_GENERATE_PROXY_H
|
#define __DBUSXX_TOOLS_GENERATE_PROXY_H
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,30 @@
|
||||||
#include "generator_utils.h"
|
/*
|
||||||
|
*
|
||||||
|
* D-Bus++ - C++ bindings for D-Bus
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser 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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include "generator_utils.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -19,6 +43,21 @@ const char *dbus_includes = "\n\
|
||||||
\n\
|
\n\
|
||||||
";
|
";
|
||||||
|
|
||||||
|
void underscorize(string &str)
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < str.length(); ++i)
|
||||||
|
{
|
||||||
|
if (!isalpha(str[i]) && !isdigit(str[i])) str[i] = '_';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string stub_name(string name)
|
||||||
|
{
|
||||||
|
underscorize(name);
|
||||||
|
|
||||||
|
return "_" + name + "_stub";
|
||||||
|
}
|
||||||
|
|
||||||
const char *atomic_type_to_string(char t)
|
const char *atomic_type_to_string(char t)
|
||||||
{
|
{
|
||||||
static struct { char type; const char *name; } atos[] =
|
static struct { char type; const char *name; } atos[] =
|
||||||
|
@ -47,13 +86,6 @@ const char *atomic_type_to_string(char t)
|
||||||
return atos[i].name;
|
return atos[i].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
string stub_name(string name)
|
|
||||||
{
|
|
||||||
underscorize(name);
|
|
||||||
|
|
||||||
return "_" + name + "_stub";
|
|
||||||
}
|
|
||||||
|
|
||||||
void _parse_signature(const string &signature, string &type, unsigned int &i)
|
void _parse_signature(const string &signature, string &type, unsigned int &i)
|
||||||
{
|
{
|
||||||
for (; i < signature.length(); ++i)
|
for (; i < signature.length(); ++i)
|
||||||
|
@ -133,11 +165,3 @@ string signature_to_type(const string &signature)
|
||||||
_parse_signature(signature, type, i);
|
_parse_signature(signature, type, i);
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
void underscorize(string &str)
|
|
||||||
{
|
|
||||||
for (unsigned int i = 0; i < str.length(); ++i)
|
|
||||||
{
|
|
||||||
if (!isalpha(str[i]) && !isdigit(str[i])) str[i] = '_';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,3 +1,26 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* D-Bus++ - C++ bindings for D-Bus
|
||||||
|
*
|
||||||
|
* Copyright (C) 2005-2007 Paolo Durante <shackan@gmail.com>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser 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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef __DBUSXX_TOOLS_GENERATOR_UTILS_H
|
#ifndef __DBUSXX_TOOLS_GENERATOR_UTILS_H
|
||||||
#define __DBUSXX_TOOLS_GENERATOR_UTILS_H
|
#define __DBUSXX_TOOLS_GENERATOR_UTILS_H
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue