All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_TagManager Class Reference

#include <UT_TagManager.h>


class  WeakKey

Public Types

enum  UT_TagEditOperation { TAG_OP_ADD, TAG_OP_RM, TAG_OP_SET }
using tag_ListType = UT_ConcurrentVector< const char * >
using tag_MapType = UT_ConcurrentHashMap< WeakKey, int, UT_HashFunctor< WeakKey > >

Public Member Functions

UT_TagListPtr createList (const char *list, UT_String &errs)
UT_TagListPtr createListForName (int name_index)
UT_TagExpressionPtr createExpression (const char *expr, UT_String &errs)
UT_TagExpressionPtr editExpression (const UT_TagExpressionPtr &expr, const char *name, UT_TagEditOperation op, UT_String &errors)
void getAllNames (UT_StringArray &tags)


class UT_TagList
class UT_TagExpression

Detailed Description

A tag manager keeps track of lists of tags and expressions. It stores them very compactly for efficient processing.

Definition at line 207 of file UT_TagManager.h.

Member Typedef Documentation

Definition at line 244 of file UT_TagManager.h.

Member Enumeration Documentation


Definition at line 298 of file UT_TagManager.h.

Member Function Documentation

UT_TagExpressionPtr UT_TagManager::createExpression ( const char *  expr,
UT_String errs 

createTagExpression() is used to create a pattern to match against tag lists.

The tag expression can be a very simple expression consisting of

  • name
    Matches tag lists which have the name
  • -name
    Matches tag lists which do NOT contain the name
  • +
    Matches tag lists which have ANY entries
  • -
    Matches tag lists which have NO entries
  • *
    Matches all tag lists (Equivalent to "+|-")
  • -*
    Matches no tag lists (Equivalend to "+&-")

Expressions may be joined with & or | (AND or OR). For example

  • -foo
    Match all tags except those with "foo"
  • * & -foo
    Equivalent to "-foo"
  • -foo & -bar
    Match all tags except those with "foo" or "bar"
  • foo & -bar
    Match all tags that have "foo" but don't have "bar"

Expressions are processed left to right with AND at a higher precedence in the order of operations than OR. Thus:

a & b & c | d & e | f | g & h

is equivalent to:

(a & b & c) | (d & e) | f | (g & h)
You are responsible for deleting this Smart pointer access to tag expressions

Definition at line 291 of file UT_TagManager.h.

UT_TagListPtr UT_TagManager::createList ( const char *  list,
UT_String errs 

getTagList() creates a tag-list object. This is a list of names which are considered as tags for matching (see below). The names allow alphanumeric letters and characters from "_.:"

Definition at line 251 of file UT_TagManager.h.

UT_TagListPtr UT_TagManager::createListForName ( int  name_index)

Definition at line 255 of file UT_TagManager.h.

UT_TagExpressionPtr UT_TagManager::editExpression ( const UT_TagExpressionPtr expr,
const char *  name,
UT_TagEditOperation  op,
UT_String errors 

Apply an edit to an expression. This operation may have bugs, but will always work on a simplified expression.

void UT_TagManager::getAllNames ( UT_StringArray tags)

Get a list of all the tags used by any list or pattern we've constructed

Friends And Related Function Documentation

friend class UT_TagExpression

Definition at line 333 of file UT_TagManager.h.

friend class UT_TagList

Definition at line 332 of file UT_TagManager.h.

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