inc/BitStream.h
changeset 0 95b198f216e5
equal deleted inserted replaced
-1:000000000000 0:95b198f216e5
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BITSTREAM_H
       
    21 #define BITSTREAM_H
       
    22 
       
    23 #include <bigint.h>
       
    24 
       
    25 #define INLINE
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 *  TBitStream: Stream of bits
       
    33 *
       
    34 *  @lib    -
       
    35 *  @since  3.0
       
    36 */
       
    37 template<TInt S>
       
    38 class TBitStream
       
    39     {
       
    40 public: // New functions
       
    41 
       
    42     INLINE void Clear();
       
    43 
       
    44     INLINE void SetBit(
       
    45         const TInt aBit);
       
    46         
       
    47     INLINE void SetBitValue(
       
    48         const TInt aBit,
       
    49         const TInt aValue);
       
    50         
       
    51     INLINE void ClearBit(
       
    52         const TInt aBit);
       
    53         
       
    54     INLINE TInt GetBit(
       
    55         const TInt aBit) const;
       
    56         
       
    57     INLINE void XorBit(
       
    58         const TInt aBit,
       
    59         const TInt aValue);
       
    60         
       
    61     INLINE TPtrC8 Des() const;
       
    62     
       
    63     INLINE void Set(
       
    64         const TDesC8& aInput);
       
    65     
       
    66     INLINE void Copy(
       
    67         TBitStream<S> aBitStream);
       
    68         
       
    69     INLINE void Or(
       
    70         TBitStream<S> aBitStream);
       
    71         
       
    72     INLINE void Xor(
       
    73         TBitStream<S> aBitStream);
       
    74         
       
    75     INLINE void And(
       
    76         TBitStream<S> aBitStream);
       
    77         
       
    78     INLINE void Not();
       
    79     
       
    80     INLINE TInt operator[](
       
    81         const TInt aBit) const;
       
    82     
       
    83 protected: // New functions
       
    84 
       
    85 protected: // Data
       
    86 
       
    87     // Buffer with the data
       
    88     TBuf8<S / 8> iData;
       
    89     };
       
    90 
       
    91 #include "BitStream.inl"
       
    92 
       
    93 #endif      // BITSTREAM_H   
       
    94             
       
    95 // End of File