Classes | Typedefs | Functions
General helper functions and classes

Classes

class  Aseba::BasicFormatableString< charT >
struct  Aseba::UnifiedTime
 Time or durations, in milliseconds. More...

Typedefs

typedef BasicFormatableString
< char > 
Aseba::FormatableString
typedef BasicFormatableString
< wchar_t > 
Aseba::WFormatableString

Functions

BasicFormatableString & Aseba::BasicFormatableString< charT >::arg (int value, int fieldWidth=0, int base=10, charT fillChar= ' ')
BasicFormatableString & Aseba::BasicFormatableString< charT >::arg (unsigned value, int fieldWidth=0, int base=10, charT fillChar= ' ')
BasicFormatableString & Aseba::BasicFormatableString< charT >::arg (float value, int fieldWidth=0, int precision=6, charT fillChar= ' ')
static uint16 Aseba::crc_xmodem_update (uint16 crc, uint8 data)
static uint16 Aseba::crc_xmodem_update (uint16 crc, const uint8 *data, size_t len)
uint16 Aseba::crcXModem (const uint16 oldCrc, const std::wstring &s)
 Update the XModem CRC (x^16 + x^12 + x^5 + 1 (0x1021)) with a wstring.
uint16 Aseba::crcXModem (const uint16 oldCrc, const uint16 v)
 Update the XModem CRC (x^16 + x^12 + x^5 + 1 (0x1021)) with a uint16 value.
void Aseba::dumpTime (std::ostream &stream, bool raw=false)
 Dump the current time to a stream.
static UnifiedTime Aseba::UnifiedTime::fromRawTimeString (const std::string &rawTimeString)
 Return the time from the raw time string.
BasicFormatableString & Aseba::BasicFormatableString< charT >::operator= (const S &str)
template<typename Derived , typename Base >
static Derived Aseba::polymorphic_downcast (Base base)
 Asserts a dynamic cast. Similar to the one in boost/cast.hpp.
template<typename Derived , typename Base >
static Derived Aseba::polymorphic_downcast_or_null (Base base)
 Asserts a dynamic cast or a null. Similar to the one in boost/cast.hpp.
void Aseba::BasicFormatableString< charT >::proceedReplace (const S &replacement)
void Aseba::UnifiedTime::sleep () const
 Sleep for this amount of time.
std::string Aseba::UnifiedTime::toHumanReadableStringFromEpoch () const
 Create a human readable string with this time.
std::string Aseba::UnifiedTime::toRawTimeString () const
 Return the raw time string representing this time.
 Aseba::UnifiedTime::UnifiedTime ()
 Constructor, set time to current time.
 Aseba::UnifiedTime::UnifiedTime (Value ms)
 Constructor, from a specific number of ms.
 Aseba::UnifiedTime::UnifiedTime (Value seconds, Value milliseconds)
 Constructor, from a specific number of seconds and ms.
std::wstring Aseba::UTF8ToWString (const std::string &s)
 Transform a UTF8 string into a wstring, this function is thread-safe.
std::string Aseba::WStringToUTF8 (const std::wstring &s)
 Transform a wstring into an UTF8 string, this function is thread-safe.

Typedef Documentation

typedef BasicFormatableString<char> Aseba::FormatableString

Definition at line 120 of file FormatableString.h.

typedef BasicFormatableString<wchar_t> Aseba::WFormatableString

Definition at line 121 of file FormatableString.h.


Function Documentation

template<typename charT>
BasicFormatableString< charT > & Aseba::BasicFormatableString< charT >::arg ( int  value,
int  fieldWidth = 0,
int  base = 10,
charT  fillChar = ' ' 
)

Replace the next arg by an int value.

Parameters:
valueValue used to replace the current argument.
fieldWidthmin width of the displayed number
baseRadix of the number (8, 10 or 16)
fillCharCharacter used to pad the number to reach fieldWidth
See also:
arg(const T& value)

Definition at line 47 of file FormatableString.cpp.

template<typename charT>
BasicFormatableString< charT > & Aseba::BasicFormatableString< charT >::arg ( unsigned  value,
int  fieldWidth = 0,
int  base = 10,
charT  fillChar = ' ' 
)

Replace the next arg by an int value.

Parameters:
valueValue used to replace the current argument.
fieldWidthmin width of the displayed number
baseRadix of the number (8, 10 or 16)
fillCharCharacter used to pad the number to reach fieldWidth
See also:
arg(const T& value)

Definition at line 64 of file FormatableString.cpp.

template<typename charT>
BasicFormatableString< charT > & Aseba::BasicFormatableString< charT >::arg ( float  value,
int  fieldWidth = 0,
int  precision = 6,
charT  fillChar = ' ' 
)

Replace the next arg by a float value.

Parameters:
valueValue used to replace the current argument.
fieldWidthmin width of the displayed number.
precisionNumber of digits displayed.
fillCharCharacter used to pad the number to reach fieldWidth.
See also:
arg(const T& value)

Definition at line 81 of file FormatableString.cpp.

static uint16 Aseba::crc_xmodem_update ( uint16  crc,
uint8  data 
) [static]

Definition at line 229 of file utils.cpp.

static uint16 Aseba::crc_xmodem_update ( uint16  crc,
const uint8 data,
size_t  len 
) [static]

Definition at line 245 of file utils.cpp.

uint16 Aseba::crcXModem ( const uint16  oldCrc,
const std::wstring &  s 
)

Update the XModem CRC (x^16 + x^12 + x^5 + 1 (0x1021)) with a wstring.

Definition at line 252 of file utils.cpp.

uint16 Aseba::crcXModem ( const uint16  oldCrc,
const uint16  v 
)

Update the XModem CRC (x^16 + x^12 + x^5 + 1 (0x1021)) with a uint16 value.

Definition at line 261 of file utils.cpp.

void Aseba::dumpTime ( std::ostream &  stream,
bool  raw 
)

Dump the current time to a stream.

Definition at line 118 of file utils.cpp.

UnifiedTime Aseba::UnifiedTime::fromRawTimeString ( const std::string &  rawTimeString) [static]

Return the time from the raw time string.

Definition at line 110 of file utils.cpp.

template<typename charT >
BasicFormatableString< charT > & Aseba::BasicFormatableString< charT >::operator= ( const S str)

Affects a new value to the format string and reset the arguments counter.

Parameters:
strNew format string.

Definition at line 99 of file FormatableString.cpp.

template<typename Derived , typename Base >
static Derived Aseba::polymorphic_downcast ( Base  base) [inline, static]

Asserts a dynamic cast. Similar to the one in boost/cast.hpp.

Definition at line 39 of file utils.h.

template<typename Derived , typename Base >
static Derived Aseba::polymorphic_downcast_or_null ( Base  base) [inline, static]

Asserts a dynamic cast or a null. Similar to the one in boost/cast.hpp.

Definition at line 49 of file utils.h.

template<typename charT >
void Aseba::BasicFormatableString< charT >::proceedReplace ( const S replacement) [private]

Replace the next argument by replacement.

Definition at line 36 of file FormatableString.cpp.

void Aseba::UnifiedTime::sleep ( ) const

Sleep for this amount of time.

Definition at line 73 of file utils.cpp.

Create a human readable string with this time.

Definition at line 86 of file utils.cpp.

std::string Aseba::UnifiedTime::toRawTimeString ( ) const

Return the raw time string representing this time.

Definition at line 101 of file utils.cpp.

Constructor, set time to current time.

Definition at line 45 of file utils.cpp.

Constructor, from a specific number of ms.

Definition at line 63 of file utils.cpp.

Aseba::UnifiedTime::UnifiedTime ( Value  seconds,
Value  milliseconds 
)

Constructor, from a specific number of seconds and ms.

Definition at line 68 of file utils.cpp.

std::wstring Aseba::UTF8ToWString ( const std::string &  s)

Transform a UTF8 string into a wstring, this function is thread-safe.

Definition at line 185 of file utils.cpp.

std::string Aseba::WStringToUTF8 ( const std::wstring &  s)

Transform a wstring into an UTF8 string, this function is thread-safe.

Definition at line 127 of file utils.cpp.



aseba
Author(s): Stéphane Magnenat
autogenerated on Thu Jan 2 2014 11:17:17