std::stringstream subclass which defaults to the "C" locale, so serialization of numbers is uniform across locales. More...
#include <uniform_string_stream.h>
Public Member Functions | |
void | parseFloat (float &f) |
Parse a float, supporting both period- and comma- style floats (1,2 and 1.2). More... | |
UniformStringStream () | |
UniformStringStream (const std::string &str) | |
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 44 of file uniform_string_stream.h.
rviz::UniformStringStream::UniformStringStream | ( | ) |
Definition at line 36 of file uniform_string_stream.cpp.
rviz::UniformStringStream::UniformStringStream | ( | const std::string & | str | ) |
Definition at line 41 of file uniform_string_stream.cpp.
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 46 of file uniform_string_stream.cpp.