OKlibrary  0.2.1.6
OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy > Class Template Reference

Functor for adding suitable prefixes to the include directives of an istream. More...

#include <IncludeHandling.hpp>

List of all members.

Public Types

typedef
ProgramRepresentationIncludes 
program_representation_includes_type
typedef APC::prefix_type prefix_type
typedef APC::checked_iterator_type checked_iterator_type

Public Member Functions

 ExtendIncludeDirectives (const APC &prefix_container_)
 ~ExtendIncludeDirectives ()
template<class IncludeDirective >
void extend_include_directive (IncludeDirective &include_directive) const
 Function for extending a single include directive.
template<class Range >
void transform_include_directives (Range &range_input)
 Functor for extending a range of include directives.
void operator() (std::istream &input)
 Functor for extending the include directives contained in a std::istream.

Public Attributes

program_representation_includes_type pr

Detailed Description

template<class APC, class UniquenessPolicy = ThrowIfNonUnique>
class OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >

Functor for adding suitable prefixes to the include directives of an istream.

The constructor takes an AssociativePrefixContainer argument. This container is held as a public data member. There are two bracket operators. The first operator takes an input stream and replaces it's include directives according to the UniquenessPolicy template parameter and the extended include directives of the APC. The second operator takes a range and iterates over it, extending the include directives of each element.

The input is an istream and a form of an "associative prefix container". All include directives are extracted, checked whether they have a unique extension via the prefix container, if yes, they are extended (in the representation of the input, not in the input itself), if not, a policy-controlled alternative action takes place.

Todo:

Create an informal concept.

Update the above explanation.

Create a formal concept.

Ask the boost mailing list to correct the wrong "add ..." in the documentation of boost::split. !!

Definition at line 464 of file IncludeHandling.hpp.


Member Typedef Documentation

template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
typedef APC::checked_iterator_type OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::checked_iterator_type

Definition at line 474 of file IncludeHandling.hpp.

template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
typedef APC::prefix_type OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::prefix_type

Definition at line 473 of file IncludeHandling.hpp.

template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
typedef ProgramRepresentationIncludes OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::program_representation_includes_type

Definition at line 470 of file IncludeHandling.hpp.


Constructor & Destructor Documentation

template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::ExtendIncludeDirectives ( const APC &  prefix_container_) [inline]

Definition at line 477 of file IncludeHandling.hpp.

template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::~ExtendIncludeDirectives ( ) [inline]

Definition at line 478 of file IncludeHandling.hpp.


Member Function Documentation

template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
template<class IncludeDirective >
void OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::extend_include_directive ( IncludeDirective include_directive) const [inline]

Function for extending a single include directive.

This function has an include_directive argument and extends the include_directive according to the first_extension function of prefix_container.

Definition at line 498 of file IncludeHandling.hpp.

References OKlib::Refactoring::IncludeDirective< String >::header_file().

Referenced by OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::transform_include_directives().

template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
void OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::operator() ( std::istream &  input) [inline]
template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
template<class Range >
void OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::transform_include_directives ( Range &  range_input) [inline]

Functor for extending a range of include directives.

This operator has a Range argument range, which is intended to be a range of include directives. The operator should replace each include directive in the range by the first extension (if it exists) according to prefix_container. If the first extension == prefix_container.end() then the operator throws an exception. The uniqueness is handled by the Uniqueness Policy.

Definition at line 525 of file IncludeHandling.hpp.

References Latex_Handler::begin(), end, and OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::extend_include_directive().

Referenced by OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::operator()().


Member Data Documentation

template<class APC , class UniquenessPolicy = ThrowIfNonUnique>
program_representation_includes_type OKlib::Refactoring::ExtendIncludeDirectives< APC, UniquenessPolicy >::pr

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