os/ossrv/genericopenlibs/openenvcore/backend/inc/inidata.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2007-2009 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 * Name        : inidata.h
    16 * Part of     : stdio server
    17 * To read inifile.
    18 * 
    19 *
    20 */
    21 
    22 
    23 
    24 #ifndef __INIDATA_H__
    25 #define __INIDATA_H__
    26 
    27  #include <e32base.h>
    28 
    29  class CIniData : public CBase
    30  /*
    31   *
    32   * @publishedPartner
    33   * @test
    34   *
    35   * Defines the interface to acess to ini data file
    36   *
    37   * The basic functions, FindVar(), SetValue(), AddValue() and WriteToFileL()
    38   * Compulsory to call WriteToFileL() after calling any SetValue() or AddValue()
    39   */
    40      {
    41  public:
    42      // Constructor, pass in name of ini file to open
    43      // Default search path is 'c:\system\data' on target filesystem
    44      // ie. 'NewL(_L("c:\\system\\data\\ttools.ini"))' is equivalent
    45      // to 'NewL(_L("ttools.ini"))'
    46      static CIniData* NewL(const TDesC& aName);
    47      virtual ~CIniData();
    48 
    49 
    50      TBool FindVar(const TDesC &aSection,   // Section to look under
    51                          const TDesC &aKeyName,      // Key to look for
    52                          TPtrC &aResult);            // Buffer to store result
    53 
    54      TBool FindVar(const TDesC &aSection,   // Section to look under
    55                          const TDesC &aKeyName,      // Key to look for
    56                          TInt &aResult);             // Int ref to store result
    57 
    58 
    59  protected:
    60    		  CIniData();
    61    		  void ConstructL(const TDesC& aName);
    62  private:
    63      HBufC* iName;
    64      HBufC* iToken;
    65      TPtr iPtr;
    66      };
    67 
    68 #endif /*__INIDATA_H__*/