Ipelib
|
#include <ipeattributes.h>
Public Member Functions | |
String | toString (int index) const |
int | toIndex (String str) |
Static Public Member Functions | |
static Repository * | get () |
static void | cleanup () |
Repository of strings.
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 "[3 1] 0" for a dash pattern. To avoid storing these common strings hundreds of times, Repository keeps a repository of strings. Inside an Object, strings are replaced by indices into the repository.
The Repository is a singleton object. It is created the first time it is used. You obtain access to the repository using get().
|
static |
Get pointer to singleton Repository.
Referenced by ipe::Attribute::Attribute(), ipe::StyleSheet::saveAsXml(), and ipe::Attribute::string().
|
static |
Destroy repository object.
String Repository::toString | ( | int | index | ) | const |
Return string with given index.
Referenced by ipe::StyleSheet::saveAsXml(), and ipe::Attribute::string().
int Repository::toIndex | ( | String | str | ) |
Return index of given string.
The string is added to the repository if it doesn't exist yet.
References ipe::String::empty().
Referenced by ipe::Attribute::Attribute().