Click here to Skip to main content
15,881,204 members
Articles / Desktop Programming / MFC

A Multiple Substring Search Class: CIVStringSet

Rate me:
Please Sign up or sign in to vote.
4.69/5 (6 votes)
25 Apr 2010CPOL4 min read 152.6K   2.1K   37  
A string array class using MFC or STL that performs very fast multiple string searches
// StringSetSampleDlg.h : header file

#pragma once

#include "StringSet.H"

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CStringSetSampleDlg
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

class CStringSetSampleDlg : public CDialog
{
    // Construction
public:
    CStringSetSampleDlg( CWnd * pParent = NULL ) ;  // standard constructor

    // Dialog Data
protected:
    enum { IDD = IDD_STRINGSETSAMPLE_DIALOG } ;
    CEdit       m_editSearch ;
    CString     m_strSearch ;
    CEdit       m_editSeekTokens ;
    CListBox    m_lbSeekTokens ;
    CListBox    m_lbFoundTokens ;
    CIVStringSet m_setStrings ;

    // ClassWizard generated virtual function overrides
protected:
    virtual void DoDataExchange( CDataExchange * pDX ) ;    // DDX/DDV support
    virtual BOOL OnInitDialog() ;

    // Implementation
protected:
    HICON m_hIcon ;

    afx_msg void OnSysCommand( UINT nID, LPARAM lParam ) ;
    afx_msg void OnPaint() ;
    afx_msg HCURSOR OnQueryDragIcon() ;
    afx_msg void OnKillFocusStringsToSeek() ;
    afx_msg void OnSearch() ;
    DECLARE_MESSAGE_MAP()
} ;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Microsoft
United States United States
Scot is a Sr. Escalation Engineer for the Microsoft Developer Support VS & Languages team. He helps software developers who are Microsoft customers find bugs in their own, or Microsoft's, code.

Scot spends most of his time writing, reading, or thinking about C++ software, thereby classifying him as a geek.

Comments and Discussions