DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Private Attributes | List of all members
Diades::Utils::basic_substring< Ch > Class Template Reference

#include <Substring.hh>

Public Types

typedef std::basic_string< Ch >::size_type size_type
 

Public Member Functions

 basic_substring (std::basic_string< Ch > &s, size_type i, size_type nb)
 
 basic_substring (std::basic_string< Ch > &s, const std::basic_string< Ch > &s2)
 
 basic_substring (std::basic_string< Ch > &s, const Ch *p)
 
basic_substringoperator= (const std::basic_string< Ch > &)
 
basic_substringoperator= (const basic_substring< Ch > &)
 
basic_substringoperator= (Ch)
 
 operator std::basic_string< Ch > () const
 
 operator const Ch * () const
 

Private Attributes

std::basic_string< Ch > * ps
 
size_type pos
 
size_type n
 

Detailed Description

template<class Ch>
class Diades::Utils::basic_substring< Ch >

This class implements the Substring class written in the C++ reference book of Stroustrup. This class implements the definition of a sub-string given a string. See C++ book for details

The basic use is as follows:

string toto("toto"); SubString oto(toto,"o"); cout << oto << endl; // print "oto"

Definition at line 27 of file Substring.hh.

Member Typedef Documentation

◆ size_type

template<class Ch>
typedef std::basic_string<Ch>::size_type Diades::Utils::basic_substring< Ch >::size_type

Definition at line 30 of file Substring.hh.

Constructor & Destructor Documentation

◆ basic_substring() [1/3]

template<class Ch>
Diades::Utils::basic_substring< Ch >::basic_substring ( std::basic_string< Ch > &  s,
size_type  i,
size_type  nb 
)
inline

Definition at line 33 of file Substring.hh.

References Diades::Utils::basic_substring< Ch >::operator=().

◆ basic_substring() [2/3]

template<class Ch >
Diades::Utils::basic_substring< Ch >::basic_substring ( std::basic_string< Ch > &  s,
const std::basic_string< Ch > &  s2 
)

Definition at line 60 of file Substring.hh.

References Diades::Utils::basic_substring< Ch >::pos.

◆ basic_substring() [3/3]

template<class Ch >
Diades::Utils::basic_substring< Ch >::basic_substring ( std::basic_string< Ch > &  s,
const Ch *  p 
)

Member Function Documentation

◆ operator const Ch *()

template<class Ch>
Diades::Utils::basic_substring< Ch >::operator const Ch * ( ) const

◆ operator std::basic_string< Ch >()

template<class Ch >
Diades::Utils::basic_substring< Ch >::operator std::basic_string< Ch > ( ) const

◆ operator=() [1/3]

template<class Ch >
basic_substring< Ch > & Diades::Utils::basic_substring< Ch >::operator= ( const std::basic_string< Ch > &  s)

◆ operator=() [2/3]

template<class Ch >
basic_substring< Ch > & Diades::Utils::basic_substring< Ch >::operator= ( const basic_substring< Ch > &  s)

◆ operator=() [3/3]

template<class Ch >
basic_substring< Ch > & Diades::Utils::basic_substring< Ch >::operator= ( Ch  c)

Member Data Documentation

◆ n

template<class Ch>
size_type Diades::Utils::basic_substring< Ch >::n
private

◆ pos

template<class Ch>
size_type Diades::Utils::basic_substring< Ch >::pos
private

◆ ps

template<class Ch>
std::basic_string<Ch>* Diades::Utils::basic_substring< Ch >::ps
private

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