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

#include <UT_TagManager.h>

Classes

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_TagManager ()
 
 ~UT_TagManager ()
 
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)
 

Friends

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 202 of file UT_TagManager.h.

Member Typedef Documentation

Definition at line 239 of file UT_TagManager.h.

Member Enumeration Documentation

Enumerator
TAG_OP_ADD 
TAG_OP_RM 
TAG_OP_SET 

Definition at line 295 of file UT_TagManager.h.

Constructor & Destructor Documentation

UT_TagManager::UT_TagManager ( )
UT_TagManager::~UT_TagManager ( )

Member Function Documentation

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

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)
Note
You are responsible for deleting this Smart pointer access to tag expressions

Definition at line 288 of file UT_TagManager.h.

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

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 248 of file UT_TagManager.h.

UT_TagListPtr UT_TagManager::createListForName ( int  name_index)
inline

Definition at line 252 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
friend

Definition at line 330 of file UT_TagManager.h.

friend class UT_TagList
friend

Definition at line 329 of file UT_TagManager.h.


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