Forgot to add the first stab implementation.

This commit is contained in:
Jack Moffitt
2005-08-02 20:21:00 +00:00
parent 359c47ffdc
commit 1f0ee8df31
2 changed files with 120 additions and 0 deletions

46
src/oostanza.cpp Normal file
View File

@@ -0,0 +1,46 @@
#include "strophe.h"
#include "strophepp.h"
using namespace XMPP;
void *Stanza::operator new(size_t size, Context *ctx)
{
return ctx->alloc(size);
}
void Stanza::operator delete(void *p, Context *ctx)
{
ctx->free(p);
}
Stanza::Stanza(Context *ctx)
{
m_ctx = ctx;
m_stanza = ::xmpp_stanza_new(ctx->getContext());
// TODO: check for errors
}
Stanza::~Stanza()
{
::xmpp_stanza_release(m_stanza);
}
void Stanza::release()
{
if (::xmpp_stanza_release(m_stanza))
delete(m_ctx) this;
}
Stanza *Stanza::clone()
{
::xmpp_stanza_clone(m_stanza);
return this;
}
Stanza *Stanza::copy()
{
// TODO
return NULL;
}