rviz::UniformStringStream Class Reference

std::stringstream subclass which defaults to the "C" locale, so serialization of numbers is uniform across locales. More...

#include <uniform_string_stream.h>

List of all members.

Public Member Functions

void parseFloat (float &f)
 Parse a float, supporting both period- and comma- style floats (1,2 and 1.2).
 UniformStringStream (const std::string &str)
 UniformStringStream ()

Detailed Description

std::stringstream subclass which defaults to the "C" locale, so serialization of numbers is uniform across locales.

For reading floats in, use parseFloat() instead of operator>>, because operator>> is the one from std::stringstream which only handles "C" style floats. parseFloat() handles "C" and also European-style floats which use the ",", like "1,2" parses to 1.2f

Definition at line 45 of file uniform_string_stream.h.


Constructor & Destructor Documentation

rviz::UniformStringStream::UniformStringStream (  ) 

Definition at line 37 of file uniform_string_stream.cpp.

rviz::UniformStringStream::UniformStringStream ( const std::string &  str  ) 

Definition at line 42 of file uniform_string_stream.cpp.


Member Function Documentation

void rviz::UniformStringStream::parseFloat ( float &  f  ) 

Parse a float, supporting both period- and comma- style floats (1,2 and 1.2).

Uses operator>>(std::string&) internally, so consumes up to next whitespace from the stream.

Definition at line 48 of file uniform_string_stream.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


rviz
Author(s): Dave Hershberger, Josh Faust
autogenerated on Wed Jun 6 11:25:48 2012