X-Git-Url: http://git.indexdata.com/?p=yazpp-moved-to-github.git;a=blobdiff_plain;f=src%2Fgdu.cpp;h=10860cf245ab352d0b7e35efc76a5c1fe3cc2006;hp=9fb99a067680d642d50f41cc099ee3169fafba0e;hb=80f76096e4a83eeeb66ea55ef0d526b1f360a10c;hpb=0cc824e02bc2c69986bec8c9dd9ff53f07a0cd3d diff --git a/src/gdu.cpp b/src/gdu.cpp index 9fb99a0..10860cf 100644 --- a/src/gdu.cpp +++ b/src/gdu.cpp @@ -1,8 +1,6 @@ -/* - * Copyright (c) 1998-2005, Index Data. +/* This file is part of the yazpp toolkit. + * Copyright (C) 1998-2009 Index Data and Mike Taylor * See the file LICENSE for details. - * - * $Id: gdu.cpp,v 1.4 2006-03-29 13:14:15 adam Exp $ */ #include @@ -48,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) { @@ -84,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