Carna  Version 3.0.1
Functions
Carna::base::text Namespace Reference

Provides text-related helper functions. More...

Functions

std::string cat (const std::string &file)
 Reads file in text mode and returns contents.
 
template<typename To , typename From >
To lexical_cast (const From &from)
 Performs lexical cast. More...
 

Detailed Description

Provides text-related helper functions.

Function Documentation

template<typename To , typename From >
To Carna::base::text::lexical_cast ( const From &  from)

Performs lexical cast.

Example:

const unsigned int i = 3;
const std::string s = lexical_cast< std::string >( i );
const unsigned int j = lexical_cast< unsigned int >( s );
CARNA_ASSERT( i == j );

Definition at line 68 of file text.h.