$search

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::arg (float value, int fieldWidth=0, int precision=6, charT fillChar= ' ')
BasicFormatableString & Aseba::BasicFormatableString::arg (unsigned value, int fieldWidth=0, int base=10, charT fillChar= ' ')
BasicFormatableString & Aseba::BasicFormatableString::arg (int value, int fieldWidth=0, int base=10, charT fillChar= ' ')
static uint16 Aseba::crc_xmodem_update (uint16 crc, const uint8 *data, size_t len)
static uint16 Aseba::crc_xmodem_update (uint16 crc, uint8 data)
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.
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.
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::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::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 (Value seconds, Value milliseconds)
 Constructor, from a specific number of seconds and ms.
 Aseba::UnifiedTime::UnifiedTime (Value ms)
 Constructor, from a specific number of ms.
 Aseba::UnifiedTime::UnifiedTime ()
 Constructor, set time to current time.
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.

Detailed Description


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 ( float  value,
int  fieldWidth = 0,
int  precision = 6,
charT  fillChar = ' ' 
) [inline, inherited]

Replace the next arg by a float value.

Parameters:
value Value used to replace the current argument.
fieldWidth min width of the displayed number.
precision Number of digits displayed.
fillChar Character used to pad the number to reach fieldWidth.
See also:
arg(const T& value)

Definition at line 81 of file FormatableString.cpp.

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

Replace the next arg by an int value.

Parameters:
value Value used to replace the current argument.
fieldWidth min width of the displayed number
base Radix of the number (8, 10 or 16)
fillChar Character 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 ( int  value,
int  fieldWidth = 0,
int  base = 10,
charT  fillChar = ' ' 
) [inline, inherited]

Replace the next arg by an int value.

Parameters:
value Value used to replace the current argument.
fieldWidth min width of the displayed number
base Radix of the number (8, 10 or 16)
fillChar Character used to pad the number to reach fieldWidth
See also:
arg(const T& value)

Definition at line 47 of file FormatableString.cpp.

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

Definition at line 245 of file utils.cpp.

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

Definition at line 229 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.

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.

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

Dump the current time to a stream.

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

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  )  [inline, inherited]

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

Parameters:
str New 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  )  [inline, private, inherited]

Replace the next argument by replacement.

Definition at line 36 of file FormatableString.cpp.

void Aseba::UnifiedTime::sleep (  )  const [inherited]

Sleep for this amount of time.

Definition at line 73 of file utils.cpp.

std::string Aseba::UnifiedTime::toHumanReadableStringFromEpoch (  )  const [inherited]

Create a human readable string with this time.

Definition at line 86 of file utils.cpp.

std::string Aseba::UnifiedTime::toRawTimeString (  )  const [inherited]

Return the raw time string representing this time.

Definition at line 101 of file utils.cpp.

Aseba::UnifiedTime::UnifiedTime ( Value  seconds,
Value  milliseconds 
) [inherited]

Constructor, from a specific number of seconds and ms.

Definition at line 68 of file utils.cpp.

Aseba::UnifiedTime::UnifiedTime ( Value  ms  )  [inherited]

Constructor, from a specific number of ms.

Definition at line 63 of file utils.cpp.

Aseba::UnifiedTime::UnifiedTime (  )  [inherited]

Constructor, set time to current time.

Definition at line 45 of file utils.cpp.

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.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


aseba
Author(s): Stéphane Magnenat
autogenerated on Sat Mar 2 12:31:49 2013