dvi2bitmap dvi2bitmap1.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Functions | Variables
Util Namespace Reference

Various utility functions. More...

## Functions
string_list & | tokenise_string (string str)
| Tokenise string at whitespace. More...
char ** | string_list_to_array (string_list &l)
| Convert a `string_list` to a null-terminated array of character pointers. More...
void | delete_string_array (char **sl)
| Deletes the array of strings returned by string_list_to_array. More...
bool | parseRGB (Bitmap::BitmapColour &, const char *)
| Parse an RGB specification. More...
void | verbosity (const verbosities level)
| Sets the verbosity of the methods in this class. More...

## Variables
verbosities | verbosity_ = normal

## Detailed Description

Various utility functions.

## Function Documentation

void Util::delete_string_array | ( | char ** | sl) |  |

Deletes the array of strings returned by string_list_to_array.

Parameters

  sl | a null-terminated array of strings

bool Util::parseRGB | ( | Bitmap::BitmapColour & | rgb,
|  | const char * | s
| ) |  |

Parse an RGB specification.

This is either a sequence of three integers separated by slashes (or in fact any non-number character), or else a string of the form `#RRGGBB`. Set the `rgb' structure to the resulting numbers. The integers must be in the range [0,255], and may be specified in decimal, octal, or hex.

Parameters

  rgb | the `BitmapColour` corresponding to the `s` argument
  s | the RGB specification

Returns
  true if the parse is successful.

References Bitmap::BitmapColour_s::blue, Bitmap::BitmapColour_s::green, and Bitmap::BitmapColour_s::red.

Referenced by main().

char ** Util::string_list_to_array | ( | string_list & | l) |  |

Convert a `string_list` to a null-terminated array of character pointers.

The resulting array can conveniently be deleted using delete_string_array.

Parameters

  l | a string_list

Returns
  a pointer to a null-terminated array of null-terminated character arrays

Referenced by PipeStream::PipeStream().

string_list & Util::tokenise_string | ( | string | str) |  |

Tokenise string at whitespace.

Parameters

  str | the string to be tokenised

Returns
  a list containing the whitespace-separated tokens in the string

References normal, and verbosity_.

Referenced by main(), and PipeStream::PipeStream().

void Util::verbosity | ( | const verbosities | level) |  |

Sets the verbosity of the methods in this class.

Parameters

  level | how verbose the class's methods should be

References verbosity_.

Referenced by main().

## Variable Documentation

verbosities Util::verbosity_ = normal

Referenced by InputByteStream::bindToFileDescriptor(), Bitmap::Bitmap(), InputByteStream::bufferSeek(), InputByteStream::close(), PkFont::fontgenCommand(), PkFont::magnification(), InputByteStream::openSourceSpec(), Bitmap::paint(), InputByteStream::reloadBuffer(), Bitmap::rule(), Bitmap::scaleDown(), Bitmap::strut(), PkFont::substitute_font_string(), tokenise_string(), verbosity(), and Bitmap::write().