# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Public Attributes | Protected Member Functions

# vl::Say Class Reference

A simple String formatting class. More...

`#include <Say.hpp>`

List of all members.

## Public Member Functions

| Say (const String &fstr)
Say & | operator<< (const SayArg &p)
template<typename T >
Say & | operator<< (T p)
| operator String ()
String | str () const

## Public Attributes

String | format_string

## Protected Member Functions

String | parse (const Say &pset) const
String | euronotation (const String &str, int base) const
String | format (unsigned long long n, int base, int field, int decimals, int align, int fill, int plus, int finalizer, int eur) const
String | format (signed long long nn, int base, int field, int decimals, int align, int fill, int plus, int finalizer, int eur) const
String | format (double num, int base, int field, int decimals, int align, int fill, int plus, int finalizer, int eur) const
String | pipeline (const String &str, int base, int field, int decimals, int finalizer, int align, int eur, int fill, int negative, int plus) const

## Detailed Description

A simple String formatting class.

Remarks:
  Things that we cannot do:
  - Exponential rounding
  - Explicit parameter reference
  - Dynamic field and decimal length

Things we can do:

- Handles: String, char*, signed/unsigned char/short/int/long long, float, double
- Shows both integer and fractional numbers in the following bases 2, 8, 10, 16 (actually any base between 2 and 16 but the parser knows only these 4)
- Field size
- Field alignment
- "+" Sign
- Decimal field size with rounding (only for normal notation for now)
- Uppercase and lowercase output
- "Euro" notation ouput for numbers
- Normal and exponential notation
- Clear and helpful debugging messages
- Typesafe, portable, easy to use, clean

Definition at line 124 of file Say.hpp.

## Constructor & Destructor Documentation

vl::Say::Say | ( | const String & | fstr ) | `[inline]`

Definition at line 129 of file Say.hpp.

## Member Function Documentation

Say& vl::Say::operator<< | ( | const SayArg & | p ) | `[inline]`

Definition at line 134 of file Say.hpp.

template<typename T >

Say& vl::Say::operator<< | ( | T | p ) | `[inline]`

Definition at line 141 of file Say.hpp.

vl::Say::operator String | ( | ) | `[inline]`

Definition at line 147 of file Say.hpp.

String vl::Say::str | ( | ) | const`[inline]`

Definition at line 152 of file Say.hpp.

Referenced by format(), and pipeline().

String Say::parse | ( | const Say & | pset ) | const`[protected]`

Definition at line 171 of file Say.cpp.

References vl::SayArg::float64, vl::SayArg::FLOAT64, format(), format_string, vl::String::length(), vl::SayArg::slonglong, vl::SayArg::SLONGLONG, vl::SayArg::str, vl::SayArg::STRING, vl::SayArg::type, vl::SayArg::ulonglong, and vl::SayArg::ULONGLONG.

String Say::euronotation | ( | const String & | str,
|  | int | base
| ) |  | const`[protected]`

Definition at line 494 of file Say.cpp.

References vl::String::contains(), vl::String::insert(), and vl::String::length().

Referenced by pipeline().

String Say::format | ( | unsigned long long | n,
|  | int | base,
|  | int | field,
|  | int | decimals,
|  | int | align,
|  | int | fill,
|  | int | plus,
|  | int | finalizer,
|  | int | eur
| ) |  | const`[protected]`

Definition at line 532 of file Say.cpp.

References vl::String::insert(), pipeline(), and str().

Referenced by vlSDL::SDLWindow::initSDLWindow(), parse(), and pipeline().

String Say::format | ( | signed long long | nn,
|  | int | base,
|  | int | field,
|  | int | decimals,
|  | int | align,
|  | int | fill,
|  | int | plus,
|  | int | finalizer,
|  | int | eur
| ) |  | const`[protected]`

Definition at line 583 of file Say.cpp.

References vl::String::insert(), pipeline(), and str().

String Say::format | ( | double | num,
|  | int | base,
|  | int | field,
|  | int | decimals,
|  | int | align,
|  | int | fill,
|  | int | plus,
|  | int | finalizer,
|  | int | eur
| ) |  | const`[protected]`

Definition at line 646 of file Say.cpp.

References vl::exp(), vl::floor(), pipeline(), vl::sign(), and str().

String Say::pipeline | ( | const String & | str,
|  | int | base,
|  | int | field,
|  | int | decimals,
|  | int | finalizer,
|  | int | align,
|  | int | eur,
|  | int | fill,
|  | int | negative,
|  | int | plus
| ) |  | const`[protected]`

Definition at line 847 of file Say.cpp.

References vl::String::append(), vl::String::contains(), vl::dot(), euronotation(), vl::String::find(), format(), vl::String::insert(), vl::String::length(), vl::String::remove(), vl::String::resize(), and str().

Referenced by format().

## Member Data Documentation

String vl::Say::format_string

Definition at line 127 of file Say.hpp.

Referenced by parse().

The documentation for this class was generated from the following files:

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/Say.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlCore/Say.cpp

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:44:15.
Permission is granted to use this page to write and publish articles regarding Visualization Library.