# IpeRepository Class Reference
[Ipe Attributes]

Repository of attribute values. More...

List of all members.

## Public Member Functions

- IpeRepository ()
- IpeString ToString (IpeAttribute index) const
- IpeColor ToColor (IpeAttribute index) const
- IpeFixed ToScalar (IpeAttribute index) const
- IpeVector ToVector (IpeAttribute index) const
- IpeAttribute ToAttribute (const IpeColor &color)
- IpeAttribute ToAttribute (IpeKind kind, IpeFixed value)
- IpeAttribute ToAttribute (IpeKind kind, const IpeVector &vec)
- IpeAttribute MakeColor (IpeString str)
- IpeAttribute MakeString (IpeKind kind, IpeString str)
- IpeAttribute MakeDashStyle (IpeString str)
- IpeAttribute MakeTextSize (IpeString str)
- IpeAttribute MakeScalar (IpeKind kind, IpeString str)
- IpeAttribute MakeVector (IpeKind kind, IpeString str)
- IpeAttribute MakeSymbol (IpeKind kind, IpeString str)
- IpeString String (IpeAttribute attr) const

## Detailed Description

Repository of attribute values.

Ipe documents can use symbolic attributes, such as 'normal', 'fat', or 'thin' for line thickness, or 'red', 'navy', 'turquoise' for color, as well as absolute attributes such as (0.5,0.5,0.5) for medium gray. To avoid storing these very common values hundreds of times, IpeRepository keeps a repository of all the non-scalar attribute values in the document. Inside IpeObject's attributes are represented as integer indices into the repository.

There are currently the following symbolic attributes:

- Color
- Line style (dash pattern)
- Font size
- Media size

These attributes can be symbolic, but the value is stored inside the IpeAttribute:

- Mark size
- Arrow size
- Grid size
- Angle size (for angular snap)
- Line width

## Constructor & Destructor Documentation

IpeRepository::IpeRepository | ( |  | ) |

| Constructor.

## Member Function Documentation

IpeString IpeRepository::ToString | ( | IpeAttribute | attr | ) | const

| Return string with given index. Both positive (dash style) and negativ (symbolic name) index is possible.

IpeColor IpeRepository::ToColor | ( | IpeAttribute | index | ) | const

| Return color with given index.

IpeFixed IpeRepository::ToScalar | ( | IpeAttribute | index | ) | const

| Return value with given index.

IpeVector IpeRepository::ToVector | ( | IpeAttribute | index | ) | const

| Return vector with given index.

IpeAttribute IpeRepository::ToAttribute | ( | const IpeColor & | color | ) |

| Lookup a color (add it if it doesn't exist yet), and return index.

IpeAttribute IpeRepository::ToAttribute | ( | IpeKind | kind,
|  | IpeFixed | value
| ) |

| Lookup value (add it if it doesn't exist yet), and return index.

IpeAttribute IpeRepository::ToAttribute | ( | IpeKind | kind,
|  | const IpeVector & | vec
| ) |

| Lookup vector (add it if it doesn't exist yet), and return index.

IpeAttribute IpeRepository::MakeColor | ( | IpeString | str | ) |

| Create an IpeAttribute representing the color described. Empty string creates null color, string starting with a letter creates a symbolic color (includes special case "void"), otherwise absolute color.

IpeAttribute IpeRepository::MakeString | ( | IpeKind | kind,
|  | IpeString | str
| ) |

| Construct absolute value (which is a string).

IpeAttribute IpeRepository::MakeDashStyle | ( | IpeString | str | ) |

| Construct dash style attribute from string. Empty string creates null value, string starting with '[' creates an absolute dash style, otherwise symbolic dash style (including the special case "solid").

IpeAttribute IpeRepository::MakeTextSize | ( | IpeString | str | ) |

| Construct text size attribute from string. Empty string creates null value, string starting with digit creates an numeric absolute value, string starting with letter creates symbolic text size, anything else creates absolute (string) text size.

IpeAttribute IpeRepository::MakeScalar | ( | IpeKind | kind,
|  | IpeString | str
| ) |

| Construct scalar attribute from string. Empty string creates null value, string starting with non-letter creates an absolute value, string starting with letter creates symbolic value.

IpeAttribute IpeRepository::MakeVector | ( | IpeKind | kind,
|  | IpeString | str
| ) |

| Construct vector attribute from string. Empty string creates null value, string starting with non-letter creates an absolute value, string starting with letter creates symbolic value.

IpeAttribute IpeRepository::MakeSymbol | ( | IpeKind | kind,
|  | IpeString | str
| ) |

| Construct symbolic attribute from string. Empty string creates null value, anything else creates symbolic value.

IpeString IpeRepository::String | ( | IpeAttribute | attr | ) | const

| Return string representation of attribute (symbolic or absolute).

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

- ipecolor.h
- ipecolor.cpp