connectivitymodules/SeCon/wbxml/conmlhandler/inc/sconxmlworkspace.h
branchRCL_3
changeset 20 4a793f564d72
parent 0 d0791faffa3f
equal deleted inserted replaced
19:0aa8cc770c8a 20:4a793f564d72
       
     1 /*
       
     2 * Copyright (c) 2005 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:  ConML parser/generator
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __SCONXMLWORKSPACE_H__
       
    20 #define __SCONXMLWORKSPACE_H__
       
    21 
       
    22 // -----------------------------------------------------------------------------
       
    23 // Includes
       
    24 // -----------------------------------------------------------------------------
       
    25 #include <e32base.h>
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CXMLWorkspace - workspace for WBXML / XML -documents
       
    29 // -----------------------------------------------------------------------------
       
    30 class CXMLWorkspace : public CBase
       
    31 	{
       
    32 public:
       
    33 	~CXMLWorkspace();
       
    34 	static CXMLWorkspace* NewL();
       
    35 
       
    36 	// transaction handling
       
    37 	/**
       
    38         * Function to Begin transaction
       
    39         * @param none
       
    40         * @return none
       
    41         */
       
    42 	void BeginTransaction();
       
    43 	
       
    44 	/**
       
    45         * Commits the transactions done
       
    46         * @param none
       
    47         * @return none
       
    48         */
       
    49 	void CommitAll();
       
    50 	
       
    51 	/**
       
    52         *  Commits the latest transacion done
       
    53         * @param none
       
    54         * @return KErrNone or an error code
       
    55         */
       
    56 	TInt Commit();
       
    57 	
       
    58 	/**
       
    59         *  Deletes the latest transacion done
       
    60         * @param none
       
    61         * @return KErrNone or an error code
       
    62         */
       
    63 	TInt Rollback();
       
    64 
       
    65         /**
       
    66         *  Resets the buffer
       
    67         * @param none
       
    68         * @return KErrNone or an error code
       
    69         */
       
    70 	void Reset();
       
    71 	
       
    72 	/**
       
    73         *  Writes to the buffer
       
    74         * @param none
       
    75         * @return none
       
    76         */
       
    77 	void WriteL( const TDesC8& aData );
       
    78 	void WriteL( const TUint8 aData );
       
    79 	
       
    80 	/**
       
    81         * Returns the buffer
       
    82         * @param none
       
    83         * @return the buffer
       
    84         */
       
    85 	TPtrC8 Buffer();
       
    86         
       
    87         /**
       
    88         *  Returns the free space left in the buffer
       
    89         * @param none
       
    90         * @return free space of the buffer
       
    91         */
       
    92 	TInt FreeSize();
       
    93 	
       
    94 	/**
       
    95         *  Returns the maximum size of the buffer
       
    96         * @param none
       
    97         * @return Buffer maximum size
       
    98         */
       
    99 	TInt MaxSize();
       
   100 	
       
   101 	/**
       
   102         *  Returns the size of the buffer space used
       
   103         * @param none
       
   104         * @return Size of the buffer used
       
   105         */
       
   106 	TInt Size();
       
   107 
       
   108 protected:
       
   109 	void ConstructL();
       
   110 
       
   111 private:
       
   112 	void Delete( TInt aPos, TInt aLength );
       
   113 	CXMLWorkspace();
       
   114 private:
       
   115 	CBufFlat* iBuffer;
       
   116 	RArray<TUint>* iTransactions;
       
   117 	};
       
   118 
       
   119 #endif // __SCONXMLWORKSPACE_H__
       
   120