basic_environment_sequence Class Template Reference
[System Library]

#include <winstl/system/environment_sequence.hpp>

Inheritance diagram for basic_environment_sequence:

stl_collection_tag collection_tag

List of all members.


Detailed Description

template<typename C>
class winstl::basic_environment_sequence< C >

STL-like sequence for the system environment variables.

Parameters:
C The character type
Note:
Even though Win32 treats environment variables in a case-insensitive manner, it is possible for the raw environment information (access via the GetEnvironmentStrings() function) to contain multiple entries whose names differ only by case. Thus, later versions of the sequence class support the ignoreCase member constant, which is passed by default to the constructor, in order to facilitate "normal" Win32 operation while supporting all possible modes.

Public Types

Member Constants
enum  {
  showHidden = 0x0001,
  noSort = 0x0002,
  ignoreCase = 0x0004
}
Member Types
typedef C char_type
 The character type.
typedef symbol value_type
 The value type.
typedef
basic_environment_sequence< C > 
class_type
 The current parameterisation of the type.
typedef value_type const * const_pointer
 The non-mutable (const) pointer type.
typedef value_type const & const_reference
 The non-mutable (const) reference type.
typedef size_t size_type
 The size type.
typedef ws_ptrdiff_t difference_type
 The difference type.
typedef
stlsoft::pointer_iterator
< value_type, const_pointer,
const_reference >::type 
const_iterator
 The non-mutating (const) iterator type.

Public Member Functions

 basic_environment_sequence (int flags=ignoreCase)
 Construct a sequence of the current process's environment entries, according to the given criteria.
 ~basic_environment_sequence () throw ()
 Destructor, which releases any resources acquired.
value_type operator[] (size_type index) const
 Returns the name-value item for the given index.
Iteration
const_iterator begin () const
 Begins the iteration.
const_iterator end () const
 Ends the iteration.
const_iterator find (char_type const *name) const
 Searches for an entry holding the given name.
const_iterator find (char_type const *name, char_type const *value) const
 Searches for an entry holding the given name and value.
size_type size () const
 Size.
bool empty () const
 Indicates whether the enviroment sequence is empty.

Classes

struct  compare_symbol
 A function class that compares environment symbols for the basic_environment_sequence class. More...
struct  symbol
 Structure representing the items. More...

Member Typedef Documentation

typedef C char_type

The character type.

typedef symbol value_type

The value type.

The current parameterisation of the type.

typedef value_type const* const_pointer

The non-mutable (const) pointer type.

typedef value_type const& const_reference

The non-mutable (const) reference type.

typedef size_t size_type

The size type.

typedef ws_ptrdiff_t difference_type

The difference type.

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

The non-mutating (const) iterator type.


Member Enumeration Documentation

anonymous enum

Enumerator:
showHidden  Include the hidden environment variables (those beginning with '=') in the sequence.
noSort  Do not explicitly sort the contents.
ignoreCase  Ignore case in when comparing names / values in find() methods.


Constructor & Destructor Documentation

basic_environment_sequence ( int  flags = ignoreCase  )  [explicit]

Construct a sequence of the current process's environment entries, according to the given criteria.

Parameters:
flags One or more of the member constants

~basic_environment_sequence (  )  throw ()

Destructor, which releases any resources acquired.


Member Function Documentation

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

const_iterator find ( char_type const *  name  )  const

Searches for an entry holding the given name.

Parameters:
name The name of the entry. Must not be NULL

const_iterator find ( char_type const *  name,
char_type const *  value 
) const

Searches for an entry holding the given name and value.

Parameters:
name The name of the entry. Must not be NULL
value The value of the entry. Must not be NULL

value_type operator[] ( size_type  index  )  const

Returns the name-value item for the given index.


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

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