Public Member Functions | List of all members
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>

Inheritance diagram for rviz::UniformStringStream:
Inheritance graph
[legend]

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)
 

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:


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Wed Aug 28 2019 04:01:54