Code Search for Developers
 
 
  

ChStrArr.h from bccSDK at Krugle


Show ChStrArr.h syntax highlighted

//***************************************************************************
//
//  Copyright © Microsoft Corporation.  All rights reserved.
//
//  CHSTRARR.H
//
//  Purpose: Utility library version of MFC CHStringArray
//
//***************************************************************************

#if _MSC_VER > 1000
#pragma once
#endif

#ifndef _CHStringArray_
#define _CHStringArray_

#ifdef __BORLANDC__
#pragma option push -b -a8 -pc -A- /*P_O_Push*/
#endif

#include <polarity.h>
#include <ProvExce.h>

class POLARITY CHStringArray 
{
    public:

        CHStringArray();
        ~CHStringArray();

        // Attributes
        int GetSize() const             { return m_nSize; }
        int GetUpperBound() const       { return m_nSize-1; }
        void SetSize(int nNewSize, int nGrowBy = -1) throw ( CHeap_Exception ) ;

        // Operations
        // Clean up
        void FreeExtra() throw ( CHeap_Exception ) ;
        void RemoveAll()                { SetSize(0); }

        // Accessing elements
#if (!defined DEBUG && !defined _DEBUG)
        CHString GetAt(int nIndex) const{ return m_pData[nIndex]; }
        void SetAt(int nIndex, LPCWSTR newElement){ m_pData[nIndex] = newElement; }
        CHString& ElementAt(int nIndex) { return m_pData[nIndex]; }
#else
        CHString GetAt(int nIndex) const;
        void SetAt(int nIndex, LPCWSTR newElement);
        CHString& ElementAt(int nIndex);
#endif

        // Direct Access to the element data (may return NULL)
        const CHString* GetData() const { return (const CHString*)m_pData; }
        CHString* GetData()             { return (CHString*)m_pData; }

        // Potentially growing the array
        void SetAtGrow(int nIndex, LPCWSTR newElement) throw ( CHeap_Exception ) ;
        int Add(LPCWSTR newElement) throw ( CHeap_Exception ) 
        { 
            int nIndex = m_nSize;
            SetAtGrow(nIndex, newElement);
            return nIndex; 
        }

        int Append(const CHStringArray& src) throw ( CHeap_Exception ) ;
        void Copy(const CHStringArray& src) throw ( CHeap_Exception ) ;

        // overloaded operator helpers
        CHString operator[](int nIndex) const { return GetAt(nIndex); }
        CHString& operator[](int nIndex)      { return ElementAt(nIndex); }

        // Operations that move elements around
        void InsertAt(int nIndex, LPCWSTR newElement, int nCount = 1) throw ( CHeap_Exception ) ;
        void RemoveAt(int nIndex, int nCount = 1);
        void InsertAt(int nStartIndex, CHStringArray* pNewArray) throw ( CHeap_Exception ) ;

        // Implementation

    protected:
        CHString* m_pData;      // the actual array of data
        int m_nSize;            // # of elements (upperBound - 1)
        int m_nMaxSize;         // max allocated
        int m_nGrowBy;          // grow amount
                                // local typedefs for class templates
        typedef CHString BASE_TYPE;
        typedef LPCWSTR BASE_ARG_TYPE;
};
////////////////////////////////////////////////////////////////////////////
#ifdef __BORLANDC__
#pragma option pop /*P_O_Pop*/
#endif

#endif




See more files for this project here

bccSDK

This project has a goal to provide complete port of latest MS Platform SDK along with some other commonly used separate SDK\'s for both older and newer Borland compilers. This includes headers, idl files and static and import lib files.

Project homepage: http://sourceforge.net/projects/bccsdk
Programming language(s): C,C++,IDL
License: mit

  atl/
  idl/
  wtl/
  ADSIid.h
  AF_Irda.h
  AccCtrl.h
  AclAPI.h
  AclUI.h
  ActivScp.h
  ActiveDS.h
  Admex.h
  Adptif.h
  AdsDb.h
  AdsErr.h
  AdsHlp.h
  AdsProp.h
  Adsnms.h
  Adssts.h
  AdtGen.h
  AgtCtl.h
  AgtCtl_i.c
  AgtErr.h
  AgtSvr.h
  AgtSvr_i.c
  AppAvCap.h
  AqAdmTyp.h
  AqErr.mc
  Asptlb.h
  AtalkWsh.h
  AuthZ.h
  Authif.h
  AviFmt.h
  BLBErr.h
  BaseTsd.h
  BaseTyps.h
  BatClass.h
  BiDiSpl.h
  Bits.h
  BitsMsg.h
  BluetoothAPIs.h
  CChannel.h
  CDONTS.h
  CDOSys.h
  CDOSysErr.h
  CDOSysStr.h
  CDOSys_I.c
  CGuid.h
  CatErr.mc
  CdErr.h
  CeLib.h
  CertAdm.h
  CertBCli.h
  CertBase.h
  CertCli.h
  CertEnc.h
  CertExit.h
  CertMod.h
  CertPol.h
  CertSrv.h
  CertView.h
  Certif.h
  ChPtrArr.h
  ChStrArr.h
  ChString.h
  ChanMgr.h
  CiError.h
  CluAdmEx.h
  ClusApi.h
  ClusCfgGuids.h
  ClusCfgServer.h
  ClusCfgWizard.h
  CmnQuery.h
  Codecs.h
  Color.Dlg
  ColorDlg.h
  ComAdmin.h
  ComCat.h
  ComDef.h
  ComSvcs.h
  CommCtrl.h
  CommCtrl.rh
  CommDlg.h
  CompObj.h
  ConfPriv.h
  CorReg.h
  Cpl.h
  Cplext.h
  CustCntl.h
  CustomAw.h
  DHtmldid.h
  DHtmled.h
  DHtmled.js
  DHtmled.vbs
  DHtmliid.h
  DSAdmin.h
  DSClient.h
  DSQuery.h
  DSRole.h
  DShow.h
  DataPath.h
  DbgEng.h
  DbgHelp.h
  DbgProp.h
  Dbt.h