Catalog file Lookup wrapper class Ffsco (for WIN32)

Source: Internet
Author: User
Tags ini win32 wrapper

1. Introduction

File lookups can be useful in many situations, class ffsco a simple encapsulation of file lookup operations, using only the pass parameter lookup path and file matching format (which can inherit the match method of the class to implement its own matching algorithm) to the Find method, the query results (files/directories, etc.) are saved to the inside of the class Vector containers, you can use whatever you want.

Requirements:

System support Standard C++/vector/string

Users understand Vector/string

2, the description

Findfirstfile/findnextfile implemented using functions provided by WIN32. Recursive method for subdirectory lookup.

3, the use of methods

Add file ffsco.h/ffsco.cpp to include file ffsco.h, e.g in place of use.

#include "ffsco.h"

Add name space Use declaration:

using namespace helper_coffs;

Define Ffsco class objects:

ffsco o;

Set whether to find subdirectories:

//o.dirs(1);  //--查找子目录

Set the maximum number of search results (default 65536/maximum 1048576 of course you can modify the limit):

//o.limit(100);  //--最多查找100个

Start lookup (return number of results):

int count = o.find(path, fext);
//int count = o.find("c:\\winnt");
//int count = o.find("c:\\winnt", "*.exe; *.dll; *.ini");
//int count = o.find("c:\\winnt\\", "*.exe; *.dll; *.ini");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.