예제 #1
0
파일: xml.cpp 프로젝트: janosvitok/ffado
 *  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 "xml.h"

#include <dbus-c++/debug.h>

#include <expat.h>

std::istream& operator >> ( std::istream& in, DBus::Xml::Document& doc )
{
	std::stringbuf xmlbuf;
	in.get(xmlbuf, '\0');
	doc.from_xml(xmlbuf.str());

	return in;
}

std::ostream& operator << ( std::ostream& out, const DBus::Xml::Document& doc )
{
	return out << doc.to_xml();
}

using namespace DBus;
using namespace DBus::Xml;

Error::Error( const char* error, int line, int column )
예제 #2
-1
파일: Client.cpp 프로젝트: Damax/zia
void	Client::sendResponse(Transaction& trans, std::stringbuf& responsebody)
{
  std::cout << "ici le dump:====\n" << trans.getResponse().dump() << std::endl;
  std::string str = trans.getResponse().dump();
  str += responsebody.str();
  str += "\r\n\r\n";
  this->_socket->send(str.data(), str.size()-1);
}
예제 #3
-2
// Return the last error (if any) then clear the buffer to welcome the next one.
PyObject* getLastErrorMessage()
{
	// Get the error message then clean the buffer
#if PY_MAJOR_VERSION >= 3
	PyObject* error = PyBytes_FromString(buffer.str().c_str());
#else
	PyObject* error = PyString_FromString(buffer.str().c_str());
#endif

	buffer.str("");

	return error;
}