FBB::Glob(3bobcat)         Files matching a pattern         FBB::Glob(3bobcat)

       FBB::Glob - Wrapper around glob(3) to find files matching a pattern

       #include <bobcat/glob>
       Linking option: -lbobcat

       The FBB::Glob class is a wrapper around the C function glob(3). It
       returns a list of files matching a certain pattern provided to
       FBB::Glob’s constructors or members.

       All constructors, members, operators and manipulators, mentioned in
       this man-page, are defined in the namespace FBB.


       This enumeration, which is identical to the stat(3bobcat) Type
       enumeration, defines the following values:

       o      BLOCK_DEVICE: the object represents a block device

       o      CHARACTER_DEVICE: the object represents a character device

       o      DIRECTORY: the object represents a directory

       o      FIFO: the object represents a named pipe (a queue)

       o      REGULAR_FILE: the object represents a regular file

       o      SOCKET: the object represents a socket

       o      SYMBOLIC_LINK: the object represents a symbolic link

       o      ANY: any of the above types


       o      NO_FLAG:   Equals 0, and can be used to avoid having to specify
              0. It has no further use.

       o      ERR: Return on read errors;

       o      MARK: Append a slash to each name.

       o      NOSORT: Don’t sort the names.

       o      NOESCAPE: Backslashes don’t quote metacharacters.

       o      PERIOD: Leading .-characters can be matched by metachars (i.e.,
              * and ?).

       o      NOMATCH: When specified the constructors won’t throw exceptions
              when no files matching their glob-patterns could be found.
              Instead they will return normally, and Glob’s size() member (see
              below) will return 0.


       o      FIRST: Filenames starting with a dot will be listed first.
              Within this set and in the leftover-set the relative ordering is

       o      DEFAULT: Return filenames as they appear in the globbing

       o      Glob(std::string const &pattern = "*", int flags = PERIOD, Dots
              dots = FIRST):
              This constructor (which can also be used as the default
              constructor) determines all elements matching pattern.

              An Exception exception is thrown if the constructor could not
              properly complete it tasks.

              Multiple flags may be specified, separated by the bitor

              This constructor properly completes its task if only defined
              Flag values were specified and if the glob(3) function returned
              without errors.

       o      Glob(Type type, std::string const &pattern = "*", int flags =
              PERIOD, Dots dots = FIRST):
              This constructor determines all elements of pattern matching
              Type. The specified type value may consist of any bitor-ed
              combination of enum values defined by the Type enum.

       Copy and move constructors (and assignment operators) are available.

       o      char const *operator[](size_t idx) const:
              The element at index position idx is returns as a C string. It
              returns an empty string if idx is or exceeds size().

       o      size_t size() const:
              Returns the number of elements that were detected.

       o      char const *const *begin() const:
              Returns a pointer to the first element that was detected. This
              pointer can be used in generic algorithms as an output-iterator
              supporting pointer arithmetic.

       o      char const *const *end() const:
              Returns a pointer beyond the last element that was detected.
              This pointer can be used in generic algorithms as an
              output-iterator supporting pointer arithmetic.

       o      void swap(Glob &other):
              Swaps the contents of the other object with the current object.

           int main(int argc, char **argv)
               if (argc == 1)
                   cout << "Provide glob-expression as 1st arg\n";
                   return 1;

               cout << "General:\n";

               Glob general;

               for (size_t idx = 0; idx < general.size(); idx++)
                   cout << idx << ": " << general[idx] << endl;

               cout << "Pattern: " << argv[1] << "\n";

               Glob pattern(argv[1], Glob::PERIOD, Glob::DEFAULT);

               for (size_t idx = 0; idx < pattern.size(); idx++)
                   cout << idx << ": " << pattern[idx] << endl;

       bobcat/glob - defines the class interface

       bobcat(7), stat(3bobcat), glob(3)

       No Reported Bugs.

       o      bobcat_5.00.02-x.dsc: detached signature;

       o      bobcat_5.00.02-x.tar.gz: source archive;

       o      bobcat_5.00.02-x_i386.changes: change log;

       o      libbobcat1_5.00.02-x_*.deb: debian package holding the

       o      libbobcat1-dev_5.00.02-x_*.deb: debian package holding the
              libraries, headers and manual pages;

       o public archive location;

       Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.

       This is free software, distributed under the terms of the GNU General
       Public License (GPL).

       Frank B. Brokken (

libbobcat-dev_5.00.02-x.tar.gz     2005-2019                FBB::Glob(3bobcat)