[Documentation] [TitleIndex] [WordIndex


Typically c/c++ libraries bundle streaming and formatting within the same tool (printf, iostream, ...). This tends to make them cumbersome for simple tasks. The formatter classes in this package externalise the formatting task from the io manipulation (which is usually just (u)char manipulation), This increases the efficiency of low level operations whilst also maintaining type safety. They typically do this by making use of the lower level functionality provided by ecl_converters.

The formatter classes can be used standalone, with stl streams or with ecl_streams.

Compiling & Linking

Include the following at the top of any translation unit:

   1 #include <ecl/formatters.hpp>
   3 // The formatter template family
   4 using ecl::Format;
   6 // Common formatter parameters
   7 using ecl::NoAlign;
   8 using ecl::LeftAlign;
   9 using ecl::CentreAlign;
  10 using ecl::RightAlign;
  12 // Integral formatter parameters
  13 using ecl::Bin;
  14 using ecl::Dec;
  15 using ecl::Hex;
  17 // Float formatter parameters
  18 using ecl::Fixed;
  19 using ecl::Sci;

If outside of ros, you will also need to link to ecl_formatters.


Available Formatters

Each standard formatter is a template specialisation of the form Format<inputType> where the available input types are:

2024-07-20 13:20