Home > Support > Documentation

ASN1BEREncodeStream.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1997-2007 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00024 
00030 #ifndef _ASN1BERENCODESTREAM_H_
00031 #define _ASN1BERENCODESTREAM_H_
00032 
00033 #include "rtsrc/asn1CppTypes.h"
00034 #include "rtxsrc/OSRTOutputStreamIF.h"
00035 #include "rtbersrc/asn1berStream.h"
00036 
00048 class EXTERNBER ASN1BEREncodeStream : public ASN1MessageBuffer
00049 {
00050  protected:
00051    OSRTOutputStreamIF* mpStream;
00052    OSBOOL mbOwnStream;
00053  public:
00058    ASN1BEREncodeStream (OSRTOutputStreamIF& os);
00059 
00060    ASN1BEREncodeStream (OSRTOutputStreamIF* pos, OSBOOL bOwnStream = TRUE);
00061 
00062    ~ASN1BEREncodeStream ();
00063    
00067    virtual void* getAppInfo () { return ASN1MessageBuffer::getAppInfo (); }
00068 
00076    virtual OSRTCtxtPtr getContext () { return ASN1MessageBuffer::getContext (); }
00077 
00084    virtual OSCTXT* getCtxtPtr () { return ASN1MessageBuffer::getCtxtPtr (); }
00085 
00093    virtual char* getErrorInfo () { return ASN1MessageBuffer::getErrorInfo (); }
00094 
00111    virtual char* getErrorInfo (char* pBuf, size_t& bufSize) {
00112       return ASN1MessageBuffer::getErrorInfo (pBuf, bufSize); 
00113    }
00114 
00128    virtual int getStatus () const { return ASN1MessageBuffer::getStatus (); }
00129 
00134    virtual void printErrorInfo () { ASN1MessageBuffer::printErrorInfo (); }
00135 
00140    virtual void resetErrorInfo () { ASN1MessageBuffer::resetErrorInfo (); }
00141 
00145    virtual void setAppInfo (void* pAppInfo) { 
00146       ASN1MessageBuffer::setAppInfo (pAppInfo); 
00147    }
00148 
00154    virtual void setDiag (OSBOOL value=TRUE) { 
00155       ASN1MessageBuffer::setDiag (value); 
00156    }
00157 
00158 
00169    virtual int close () { return mpStream->close (); }
00170 
00179    virtual int flush () { return mpStream->flush (); }
00180 
00186    virtual OSBOOL isOpened () { return mpStream->isOpened (); }
00187 
00199    virtual long write (const OSOCTET* pdata, size_t size) {
00200       return mpStream->write (pdata, size);
00201    }
00202 
00212    ASN1BEREncodeStream& operator << (ASN1CType& val); 
00213 
00214 
00215 
00239    int encodeBMPStr 
00240       (const Asn116BitCharString& val, ASN1TagType tagging = ASN1EXPL);
00241 
00261    int encodeBigInt (const char *pval, ASN1TagType tagging = ASN1EXPL);
00262 
00285    int encodeBitStr (const OSOCTET* pbits, OSUINT32 numbits, 
00286                       ASN1TagType tagging = ASN1EXPL);
00287 
00306    int encodeBitStr (const ASN1DynBitStr& val, ASN1TagType tagging = ASN1EXPL);
00307 
00327    int encodeBool (OSBOOL val, ASN1TagType tagging = ASN1EXPL);
00328 
00351    int encodeCharStr (const char* pval, ASN1TagType tagging = ASN1EXPL, 
00352                        ASN1TAG tag = 0);
00353 
00374    int encodeEnum (OSINT32 val, ASN1TagType tagging = ASN1EXPL);
00375 
00388    int encodeEoc ();
00389 
00400    int encodeIndefLen ();
00401 
00418    int encodeInt (OSINT32 val, ASN1TagType tagging = ASN1EXPL);
00419 
00436    int encodeInt8 (OSINT8 val, ASN1TagType tagging = ASN1EXPL);
00437 
00454    int encodeInt16 (OSINT16 val, ASN1TagType tagging = ASN1EXPL);
00455 
00472    int encodeInt64 (OSINT64 val, ASN1TagType tagging = ASN1EXPL);
00473 
00489    int encodeNull (ASN1TagType tagging = ASN1EXPL);
00490 
00499    int encodeObj (ASN1CType& val);
00500 
00522    int encodeObjId (const ASN1OBJID& val, ASN1TagType tagging = ASN1EXPL);
00523 
00546    int encodeObjId64 (const ASN1OID64& val, ASN1TagType tagging = ASN1EXPL);
00547 
00567    int encodeOctStr (const OSOCTET* pocts, OSUINT32 numocts, 
00568                       ASN1TagType tagging = ASN1EXPL);
00569 
00588    int encodeOctStr (const ASN1DynOctStr& val, ASN1TagType tagging = ASN1EXPL);
00589    
00615    int encodeReal (OSREAL val, ASN1TagType tagging = ASN1EXPL);
00616 
00638    int encodeRelativeOID (const ASN1OBJID& val, ASN1TagType tagging = ASN1EXPL);
00639 
00655    int encodeTag (ASN1TAG tag);
00656 
00672    int encodeTagAndIndefLen (ASN1TAG tag);
00673 
00694    int encodeTagAndLen (ASN1TAG tag, OSINT32 len);
00695    
00712    int encodeUInt (OSUINT32 val, ASN1TagType tagging = ASN1EXPL);
00713 
00731    int encodeUInt8 (OSUINT8 val, ASN1TagType tagging = ASN1EXPL);
00732 
00750    int encodeUInt16 (OSUINT16 val, ASN1TagType tagging = ASN1EXPL);
00751 
00769    int encodeUInt64 (OSUINT64 val, ASN1TagType tagging = ASN1EXPL);
00770 
00794    int encodeUnivStr 
00795       (const Asn132BitCharString& val, ASN1TagType tagging = ASN1EXPL);
00796 
00811    OSBOOL isA (int bufferType);
00812 } ;
00813 
00815 #endif /* _ASN1BERENCODESTREAM_H_ */
00816