CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Posts
    1,361

    Is there a standard C++ wildcard filter / matcher class?

    If I am looking through a list of files in a directory using OpenDir(), I want to be able to do wild card pattern matches.

    Under Microsoft's MFC you can specify this with FindFiles like "BA*12??.*.DA*" or something crazy like that. Using the ANSI equivalent, OpenDir() I can't do that.

    I could write my own wild-card filter, but I would rather use something pre-made instead.

  2. #2
    Join Date
    Nov 2006
    Location
    Essen, Germany
    Posts
    1,344

    Re: Is there a standard C++ wildcard filter / matcher class?

    Hi,

    no, such thing does not exist in the standard C libraries. You might want to use boost´s RegEx library.

    Boost

    Regards,
    Guido
    - Guido

  3. #3
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582

    Re: Is there a standard C++ wildcard filter / matcher class?

    I would suggest using both boost::filesystem and boost::regex. They are both portable and powerful.

    Jeff

  4. #4
    Join Date
    Sep 2004
    Posts
    1,361

    Re: Is there a standard C++ wildcard filter / matcher class?

    I was looking at the License am not totally sure what it means. Can I use that code in a commercial product that isn't open source for free?

  5. #5
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582

    Re: Is there a standard C++ wildcard filter / matcher class?

    Yes. You can use it, change it, redistribute it. It can be used in open source and commercial projects. It's a completely open license that is much more relaxed than GPL, for instance. It does not contain the gnu open source 'virus'.

    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured