javaextensions/satsa/apdu/src.s60/cstsasn1sequence.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSTSASN1SEQUENCE_H
       
    20 #define CSTSASN1SEQUENCE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include    <asn1dec.h>
       
    24 #include    "mstsasn1module.h"
       
    25 
       
    26 namespace java
       
    27 {
       
    28 namespace satsa
       
    29 {
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33  *  Base class for sequence (or set) type of modules.
       
    34  *
       
    35  *  @since 3.0
       
    36  */
       
    37 class CSTSASN1Sequence: public CBase, public MSTSASN1Module
       
    38 {
       
    39 public:
       
    40     // New functions
       
    41     /**
       
    42      * C++ default constructor.
       
    43      */
       
    44     CSTSASN1Sequence();
       
    45 
       
    46     /**
       
    47      * Decode a generic ASN1 sequence
       
    48      * @since 3.0
       
    49      * @param aCheckTag If true, sequence or set tag is be checked
       
    50      * @param aRawData raw-data to be splitted in ASN.1 Modules
       
    51      * @return Array of generic asn.1 modules.
       
    52      */
       
    53     static CArrayPtr<TASN1DecGeneric>* DecodeSequenceLC(TBool aCheckTag,
       
    54             const TDesC8& aRawData);
       
    55 
       
    56     /**
       
    57      * Decode a generic ASN1 sequence, with a minimum/maximum number
       
    58      * of top level terms. Will leave with KErrArgument if number of terms
       
    59      * is not between valid range (including min and max)
       
    60      * @since 3.0
       
    61      * @param aCheckTag If true, sequence or set tag is be checked
       
    62      * @param aRawData raw-data to be splitted in ASN.1 Modules
       
    63      * @param aMinTerms minimum of top level terms.
       
    64      * @param aMaxTerms maximum number of top level terms.
       
    65      * @return Array of generic asn.1 modules.
       
    66      */
       
    67     static CArrayPtr<TASN1DecGeneric>* DecodeSequenceLC(TBool aCheckTag,
       
    68             const TDesC8& aRawData, TInt aMinTerms, TInt aMaxTerms);
       
    69     /**
       
    70      * Decode a generic ASN1 sequence, with a minimum number
       
    71      * of top level terms. Will leave with KErrArgument if number of terms
       
    72      * is not at least the minimum amount
       
    73      * @since 3.0
       
    74      * @param aCheckTag If true, sequence or set tag is be checked
       
    75      * @param aRawData raw-data to be splitted in ASN.1 Modules
       
    76      * @param aMinTerms minimum of top level terms.
       
    77      * @return Array of generic asn.1 modules.
       
    78      */
       
    79     static CArrayPtr<TASN1DecGeneric>* DecodeSequenceLC(TBool aCheckTag,
       
    80             const TDesC8& aRawData, TInt aMinTerms);
       
    81 
       
    82 private:
       
    83     // New functions
       
    84 
       
    85     /**
       
    86      * Decode a generic ASN1 sequence. Ignores removed records and
       
    87      * padding bytes
       
    88      * @since 3.0
       
    89      * @param aRawData raw-data to be splitted in ASN.1 Modules
       
    90      * @return Array of generic asn.1 modules.
       
    91      */
       
    92     static CArrayPtrFlat<TASN1DecGeneric>*
       
    93     DecodeItemsLC(const TASN1DecGeneric& aRawData);
       
    94 
       
    95     static void CleanupSequence(TAny* aArray);
       
    96 };
       
    97 
       
    98 } // namespace satsa
       
    99 } // namespace java
       
   100 #endif // CSTSASN1SEQUENCE_H
       
   101 // End of File
       
   102