Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Open Source
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

asn1PerCppTypes.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1997-2005 by 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 //
00025 // CHANGE LOG
00026 // Date         Init    Description
00027 // 07/14/02     ED      Lowercase method names
00028 // 10/31/03     CZ      Class descriptions
00029 // 11/04/03     CZ      Augment Documentation 
00030 //
00032 
00037 #ifndef _ASN1PERCPPTYPES_H_
00038 #define _ASN1PERCPPTYPES_H_
00039 
00040 extern "C" {
00041 #include "asn1per.h"
00042 }
00043 #include "asn1CppTypes.h"
00044 
00061 // ASN.1 PER message buffer class
00070 class EXTERNPER ASN1PERMessageBuffer : public ASN1MessageBuffer {
00071  protected:
00072 
00083    ASN1PERMessageBuffer (Type bufferType, ASN1BOOL aligned);
00084 
00085 
00099    ASN1PERMessageBuffer (Type bufferType, ASN1OCTET* pMsgBuf, 
00100                          size_t msgBufLen, ASN1BOOL aligned);
00101  public:
00102 
00109    inline void binDump (const char* varname) { 
00110       pu_bindump (mpContext->getPtr(), (char*)varname); 
00111    }
00112 
00119    inline void hexDump () { 
00120       pu_hexdump (mpContext->getPtr()); 
00121    }
00122 
00128    inline size_t getMsgLen () { 
00129       return pu_getMsgLen (mpContext->getPtr());
00130    }
00131 
00141    inline void setTrace (ASN1BOOL value) {
00142       pu_setTrace (mpContext->getPtr(), value);
00143    }
00144 
00162    int setBuffer (const ASN1OCTET* pMsgBuf, size_t msgBufLen);
00163 
00164    // deprecated methods
00165    inline void BinDump (const char* varname) { binDump (varname); }
00166    inline void HexDump () { hexDump (); }
00167    inline int GetMsgLen () { return (int)getMsgLen (); }
00168    inline void SetTrace (ASN1BOOL value) { setTrace (value); }
00169 } ;
00170 
00171 // ASN.1 PER encode message buffer class
00178 class EXTERNPER ASN1PEREncodeBuffer : public ASN1PERMessageBuffer {
00179  public:
00189    ASN1PEREncodeBuffer (ASN1BOOL aligned) : 
00190       ASN1PERMessageBuffer (PEREncode, aligned) {}
00191 
00204    ASN1PEREncodeBuffer (ASN1OCTET* pMsgBuf, size_t msgBufLen, ASN1BOOL aligned) 
00205       : ASN1PERMessageBuffer (PEREncode, pMsgBuf, msgBufLen, aligned) {}
00211    inline size_t getMsgBitCnt () { 
00212       return pe_GetMsgBitCnt (mpContext->getPtr());
00213    }
00214 
00224    virtual ASN1OCTET* getMsgCopy ();
00225 
00231    virtual const ASN1OCTET* getMsgPtr ();
00232 
00244    int init ();
00245 
00255    virtual ASN1BOOL isA (Type bufferType) {
00256       return bufferType == PEREncode;
00257    }
00258 
00259    // deprecated methods
00260    inline int GetMsgBitCnt () { return (int)getMsgBitCnt(); }
00261 
00262 } ;
00263 
00264 // ASN.1 PER decode message buffer class
00273 class EXTERNPER ASN1PERDecodeBuffer : public ASN1PERMessageBuffer {
00274  public:
00282    ASN1PERDecodeBuffer (ASN1BOOL aligned) :
00283       ASN1PERMessageBuffer (PERDecode, aligned)
00284       {}
00285 
00296    ASN1PERDecodeBuffer (const ASN1OCTET* pMsgBuf, 
00297                         size_t msgBufLen, ASN1BOOL aligned) :
00298       ASN1PERMessageBuffer (PERDecode, (ASN1OCTET*)pMsgBuf, msgBufLen, aligned)
00299       {}
00300 
00309     ASN1PERDecodeBuffer (const char* filePath, ASN1BOOL aligned);
00310 
00320    virtual ASN1BOOL isA (Type bufferType) {
00321       return bufferType == PERDecode;
00322    }
00323 
00333    int readBinaryFile (const char* filePath);
00334 } ;
00335 
00336 
00343 #endif
00344 
00345 
00346 

Copyright © 1997-2005 Objective Systems,Inc.
All Rights Reserved.
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.

This file was last modified on 8 Sep 2005.
ASN1C PER Runtime, ASN1C v5.8x