Cambridge SMT System
ucam::util::PatternAddress< T > Class Template Reference

class that expands a wildcard into its actual value. This is useful e.g. for filenames ranging several sentences More...

#include <addresshandler.hpp>

Public Member Functions

 PatternAddress (const std::string &address, const std::string &wildcard="?")
 Constructor. More...
 
const std::string get (T idx)
 Expands string and returns. More...
 
const std::string operator() (T idx)
 Expands string and returns. More...
 
const std::string operator() ()
 Returns original string, without replacing any wildcard. More...
 

Detailed Description

template<typename T = uint>
class ucam::util::PatternAddress< T >

class that expands a wildcard into its actual value. This is useful e.g. for filenames ranging several sentences

Remarks
. This class can be trivially extended to deal automatically with key-dependent wildcards, e.g. %range%%, etc.

Definition at line 33 of file addresshandler.hpp.

Constructor & Destructor Documentation

template<typename T = uint>
ucam::util::PatternAddress< T >::PatternAddress ( const std::string &  address,
const std::string &  wildcard = "?" 
)
inline

Constructor.

Parameters
addressstring containing wildcards
wildcardWildcard that will be parsed. By default, ?

Definition at line 48 of file addresshandler.hpp.

Member Function Documentation

template<typename T = uint>
const std::string ucam::util::PatternAddress< T >::get ( idx)
inline

Expands string and returns.

Parameters
idxActual index to expand the wildcard with.

Definition at line 59 of file addresshandler.hpp.

Here is the caller graph for this function:

template<typename T = uint>
const std::string ucam::util::PatternAddress< T >::operator() ( idx)
inline

Expands string and returns.

Parameters
idxActual index to expand the wildcard with.
Returns
expanded string.

Definition at line 72 of file addresshandler.hpp.

template<typename T = uint>
const std::string ucam::util::PatternAddress< T >::operator() ( )
inline

Returns original string, without replacing any wildcard.

Returns
Original string.

Definition at line 81 of file addresshandler.hpp.

Here is the call graph for this function:


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