glob_sequence Class Reference
[File System Library]

#include <unixstl/filesystem/glob_sequence.hpp>

Inheritance diagram for glob_sequence:

stl_collection_tag collection_tag

List of all members.


Detailed Description

STL-like readonly sequence based on the results of file-system wildcard matches.

This class presents and STL-like readonly sequence interface to allow the iteration over the results of file-system wildcard matches.

Public Types

Member Constants
enum  search_flags {
  includeDots = 0x0008,
  directories = 0x0010,
  files = 0x0020,
  noSort = 0x0100,
  markDirs = 0x0200,
  absolutePath = 0x0400,
  breakOnError = 0x0800,
  noEscape = 0x1000
}
Types
typedef glob_sequence class_type
 This class.
typedef char char_type
 The char type.
typedef filesystem_traits
< char_type
traits_type
typedef char_type const * value_type
 The value type.
typedef value_type const & const_reference
 The non-mutating (const) reference type.
typedef value_type const * const_pointer
 The non-mutating (const) pointer type.
typedef size_t size_type
 The size type.
typedef us_ptrdiff_t difference_type
 The difference type.
typedef
stlsoft::allocator_selector
< value_type >::allocator_type 
allocator_type
 The allocator type.
typedef
stlsoft::pointer_iterator
< value_type const
, const_pointer,
const_reference >::type 
const_iterator
 The non-mutating (const) iterator type.

Public Member Functions

Construction
template<typename S>
 glob_sequence (S const &pattern, int flags=noSort)
 Constructs a sequence according to the given criteria.
template<typename S1, typename S2>
 glob_sequence (S1 const &directory, S2 const &pattern, int flags=noSort)
 Constructs a sequence according to the given criteria.
 ~glob_sequence () throw ()
 Releases any acquired resources.
Attributes
size_t size () const
 Returns the number of elements in the sequence.
bool empty () const
 Indicates whether the search sequence is empty.
Element Access
const_reference operator[] (size_type index) const
 Returns the value corresponding to the given index.
Iteration
const_iterator begin () const
 Begins the iteration.
const_iterator end () const
 Ends the iteration.


Member Typedef Documentation

This class.

typedef char char_type

The char type.

typedef char_type const* value_type

The value type.

typedef value_type const& const_reference

The non-mutating (const) reference type.

typedef value_type const* const_pointer

The non-mutating (const) pointer type.

typedef size_t size_type

The size type.

typedef us_ptrdiff_t difference_type

The difference type.

typedef stlsoft:: allocator_selector<value_type>::allocator_type allocator_type

The allocator type.

typedef stlsoft:: pointer_iterator< value_type const , const_pointer , const_reference >::type const_iterator

The non-mutating (const) iterator type.


Member Enumeration Documentation

Enumerator:
includeDots  Requests that dots directories be included in the returned sequence.
directories  Causes the search to include directories.
files  Causes the search to include files.
noSort  Does not sort entries. Corresponds to GLOB_NOSORT.
markDirs  Mark directories with a trailing path name separator. Corresponds to GLOB_MARK.
absolutePath  Return all entries in absolute format.
breakOnError  Causes processing to stop on the first filesystem error. Corresponds to GLOB_ERR.
noEscape  Treats backslashes literally. Corresponds to GLOB_NOESCAPE.


Constructor & Destructor Documentation

glob_sequence ( S const &  pattern,
int  flags = noSort 
) [inline, explicit]

Constructs a sequence according to the given criteria.

The constructor initialises a glob_sequence instance on the given pattern with the given flags.

Parameters:
pattern The pattern against which to match the file-system contents
flags Flags to alter the behaviour of the search
Note:
If exceptions are supported, then this will throw a glob_sequence_exception on failure of any underlying functions

References unixstl::c_str_ptr(), stlsoft_ns_qual, and UNIXSTL_ASSERT.

glob_sequence ( S1 const &  directory,
S2 const &  pattern,
int  flags = noSort 
) [inline]

Constructs a sequence according to the given criteria.

The constructor initialises a glob_sequence instance on the given pattern with the given flags.

Parameters:
directory The directory in which the pattern is located
pattern The pattern against which to match the file-system contents
flags Flags to alter the behaviour of the search
Note:
If exceptions are supported, then this will throw a glob_sequence_exception on failure of any underlying functions

References unixstl::c_str_ptr(), stlsoft_ns_qual, and UNIXSTL_ASSERT.

~glob_sequence (  )  throw ()

Releases any acquired resources.


Member Function Documentation

size_t size (  )  const

Returns the number of elements in the sequence.

bool empty (  )  const

Indicates whether the search sequence is empty.

const_reference operator[] ( size_type  index  )  const

Returns the value corresponding to the given index.

Note:
In debug-mode a runtime assert is applied to enforce that the index is valid. There is no release-time checking on the index validity!

const_iterator begin (  )  const

Begins the iteration.

Returns:
An iterator representing the start of the sequence

const_iterator end (  )  const

Ends the iteration.

Returns:
An iterator representing the end of the sequence


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:59:07 2010 for STLSoft by  doxygen 1.5.6