Public Member Functions | Static Public Member Functions | List of all members
ipe::Repository Class Reference

#include <ipeattributes.h>

Public Member Functions

String toString (int index) const
int toIndex (String str)

Static Public Member Functions

static Repositoryget ()
static void cleanup ()

Detailed Description

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().

Member Function Documentation

◆ get()

Repository * Repository::get ( )

◆ cleanup()

void Repository::cleanup ( )

Destroy repository object.

◆ toString()

String Repository::toString ( int  index) const

Return string with given index.

Referenced by ipe::StyleSheet::saveAsXml(), and ipe::Attribute::string().

◆ toIndex()

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().

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