X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fgdu.cpp;h=231e8ef02f0073ed8a3d1fbc13fd3b307ded1d32;hb=d1010e2fab0026b538230f67293bd5d4724c0913;hp=8df705e8136a3adead1ad6936b612c525318de9b;hpb=6b22d0543d41bec8626f3ae7ac866bcab7de44bd;p=yazpp-moved-to-github.git diff --git a/src/gdu.cpp b/src/gdu.cpp index 8df705e..231e8ef 100644 --- a/src/gdu.cpp +++ b/src/gdu.cpp @@ -1,8 +1,11 @@ /* This file is part of the yazpp toolkit. - * Copyright (C) 1998-2009 Index Data and Mike Taylor + * Copyright (C) 1998-2011 Index Data and Mike Taylor * See the file LICENSE for details. */ +#if HAVE_CONFIG_H +#include +#endif #include using namespace yazpp_1; @@ -46,6 +49,15 @@ void GDU::base(Z_GDU *gdu, ODR encode) odr_destroy(encode); } +int GDU::get_size() +{ + int len = 0; + ODR encode = odr_createmem(ODR_ENCODE); + if (m_gdu && z_GDU(encode, &m_gdu, 0, "encode")) + odr_getbuf(encode, &len, 0); + odr_destroy(encode); + return len; +} GDU &GDU::operator=(const GDU &g) {