X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fgdu.cpp;h=10860cf245ab352d0b7e35efc76a5c1fe3cc2006;hb=b217549fd1effa4467ac57a9e7510d75d7b8c446;hp=377adcac4fa22156ac560ffb74ccf69c382830e5;hpb=4b3585940162cf9ca65ca4a6914c0addcde50eef;p=yazpp-moved-to-github.git diff --git a/src/gdu.cpp b/src/gdu.cpp index 377adca..10860cf 100644 --- a/src/gdu.cpp +++ b/src/gdu.cpp @@ -1,5 +1,5 @@ /* This file is part of the yazpp toolkit. - * Copyright (C) 1998-2008 Index Data and Mike Taylor + * Copyright (C) 1998-2009 Index Data and Mike Taylor * See the file LICENSE for details. */ @@ -46,6 +46,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) { @@ -82,6 +91,7 @@ void GDU::move_away_gdu(ODR dst, Z_GDU **gdu) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab