predictivesearch/PcsUtils/inc/CWords.h
author Arnaud Lenoir
Mon, 11 Oct 2010 13:34:41 +0100
branchRCL_3
changeset 76 a7e7933e67a8
parent 63 f4a778e096c2
child 64 c1e8ba0c2b16
permissions -rw-r--r--
Added sf_test directory to start the work related to the guidlines for package test organisation (http://developer.symbian.org/wiki/index.php/Guidelines_for_Package_Test_Organisation).

/*
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Utility class that splits a string into words
*
*/

#ifndef __C_WORDS_H__
#define __C_WORDS_H__

#include <e32base.h>
#include <bamdesca.h>

/**
 * Utility class that splits a string into words
 */
NONSHARABLE_CLASS(CWords) : 
        public CBase, 
        public MDesCArray
    {
    public:  // Constructors and destructor
        /**
         * Creates a new instance of this class.
         * @param aText the text to separate
         */
        IMPORT_C static CWords* NewLC(const TDesC& aText);
        /**
         * Destructor.
         */
        IMPORT_C ~CWords();
        
    public:  // from MDesCArray
        IMPORT_C TInt MdcaCount() const;
        IMPORT_C TPtrC16 MdcaPoint(TInt aIndex) const;

    private:  // Implementation
        CWords();
        void ConstructL(const TDesC& aText);
        static TBool DefaultIsWordSeparator(TChar aChar);

    private:

        /// Own: array of words
        RArray<TPtrC> iWords;
    };
    
#endif // C_WORDS_H