| GL Studio C++ Runtime API

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GlsResourceFilter Class Reference

`#include <gls_resources.h>`

## Public Member Functions
| GlsResourceFilter (GlsResourceFilter *source)
| GlsResourceFilter (GlsResourceFilter &source)
void | LevelsUp (int value)
int | LevelsUp ()
void | GroupLevelsDown (int value)
int | GroupLevelsDown ()
void | NamesOnly (bool value)
bool | NamesOnly ()
void | AddExclude (const char *name)
unsigned int | ExcludeCount () const
const char * | GetExclude (unsigned int index) const
void | RemoveExclude (unsigned int index)
void | ClearExcludes ()
| Removes all entries from the exclude list.
void | AddInclude (const char *name)
unsigned int | IncludeCount () const
const char * | GetInclude (unsigned int index) const
void | RemoveInclude (unsigned int index)
void | ClearIncludes ()
| Removes all entries from the include list.
virtual bool | PassFilter (const char *name)
void | PushParentName (const char *parent)
unsigned int | ParentNameCount () const
const char * | GetParentName (unsigned int index) const
void | PopParentName ()
| Removes the top entry on the parent name stack.
void | ClearParentNames ()
| Removes all entries on the parent name stack.
GlsResourceFilter & | operator= (const GlsResourceFilter &rhs)

## Static Public Member Functions
static std::string | BuildHierarchyName (DisplayFrame *frame, GlsResourceFilter *filter)
static std::string | BuildHierarchyName (DisplayObject *obj, GlsResourceFilter *filter)

## Public Attributes
int | _levelsUp
| Levels of qualification to show in names, -1 is fully qualified.
int | _groupLevelsDown
| How many levels to recurse through groups, -1 is fully recursive.
DynamicArray< char * > | _excludeList
| List of names to exclude from the filter, takes precedence over includes.
DynamicArray< char * > | _includeList
| List of names to include, if empty all names are acceptable.
bool | _namesOnly
| If true, will return names only, and not names and values.
DynamicArray< const char * > | _parentNameStack
| List of parent names, used to append to the name during traversal.

## Detailed Description

Used for specifiying a filter for accessing resources

## Constructor & Destructor Documentation

## ◆ GlsResourceFilter() [1/2]

GlsResourceFilter | ( | GlsResourceFilter * | source | ) |

Copy constructor

Parameters

  source | The object to copy from.

## ◆ GlsResourceFilter() [2/2]

GlsResourceFilter | ( | GlsResourceFilter & | source | ) |

Copy constructor

Parameters

  source | The object to copy from.

## Member Function Documentation

## ◆ AddExclude()

void AddExclude | ( | const char * | name | ) |

Add a resource name to the exclude filter Resources on the exclude list will not pass the filter. Excludes take precedence over includes.

Parameters

  name | The new name to add to the exclude list.

## ◆ AddInclude()

void AddInclude | ( | const char * | name | ) |

Add a resource name to the include filter If there are no includes specified, all resources will pass the filter by default. If IncludeCount() > 0, then only resources that are included will pass the filter.

Parameters

  name | The new name to add to the include list.

## ◆ BuildHierarchyName() [1/2]

static std::string BuildHierarchyName | ( | DisplayFrame * | frame,
|  | GlsResourceFilter * | filter
| ) |  |
| static

Returns
  The qualified name for a DisplayFrame.

Parameters

  frame | The object to build the name for.
  filter | The filter currently in use (as this is a static function).

## ◆ BuildHierarchyName() [2/2]

static std::string BuildHierarchyName | ( | DisplayObject * | obj,
|  | GlsResourceFilter * | filter
| ) |  |
| static

Returns
  The qualified name for a DisplayObject.

Parameters

  obj | The object to build the name for.
  filter | The filter currently in use (as this is a static function).

## ◆ ExcludeCount()

unsigned int ExcludeCount | ( |  | ) | const

Returns
  The number of exclude entries in the filter.

## ◆ GetExclude()

const char * GetExclude | ( | unsigned int | index | ) | const

Returns
  The resource name for the given exclude list entry.

Parameters

  index | < ExcludeCount()

## ◆ GetInclude()

const char * GetInclude | ( | unsigned int | index | ) | const

Returns
  The resource name for the given include list entry.

Parameters

  index | < IncludeCount()

## ◆ GetParentName()

const char * GetParentName | ( | unsigned int | index | ) | const

Returns
  The parent name for the given position on the stack.

Parameters

  index | The index of the parent name to return.

## ◆ GroupLevelsDown() [1/2]

int GroupLevelsDown | ( |  | ) |
| inline

Returns
  The number of group levels to traverse.

## ◆ GroupLevelsDown() [2/2]

void GroupLevelsDown | ( | int | value | ) |
| inline

How many levels of children to show. This is different from LevelsUp because this is based on the draw heirarchy (Groups rather than components). For example with: GroupLevelsDown = 0, only the specified object's resources will be shown. GroupLevelsDown = 1, only the immeadiate children of the object's resources will be shown. GroupLevelsDown = -1, means all children will be shown. Note that the name stays fully qualified for the children. For example: if GroupLevelsDown == 1 the results would include: Altimeter.Visible: 1 Altimeter.Group1.Visible: 1 but NOT: Altimeter.Group1.Poly.Visible: 1

Parameters

  value | The new group traversal level to set.

## ◆ IncludeCount()

unsigned int IncludeCount | ( |  | ) | const

Returns
  The number of includes in the filter.

## ◆ LevelsUp() [1/2]

int LevelsUp | ( |  | ) |
| inline

Returns
  Te number of levels of qualification.

## ◆ LevelsUp() [2/2]

void LevelsUp | ( | int | value | ) |
| inline

How many levels of qualification above the starting point to show in the attribute names. This is based on the component heirarchy, not the draw hierarchy. For example if you call Altimeter->GetResources() with: LevelsUp = 0, expect: Altitude: 1000 LevelsUp = 1, expect: Altimeter.Altitude: LevelsUp = 2, expect: Cockpit.Altimeter.Altitude: -1 means full qualification.

Parameters

  value | The new qualification level value to set.

## ◆ NamesOnly() [1/2]

bool NamesOnly | ( |  | ) |
| inline

Returns
  Whether names only, or names and values will be returned.

## ◆ NamesOnly() [2/2]

void NamesOnly | ( | bool | value | ) |
| inline

If true, only a list of names will be returned. Values will not be returned. The format changes to not include the ":".

Parameters

  value | The new names only flag to set.

## ◆ operator=()

GlsResourceFilter & operator= | ( | const GlsResourceFilter & | rhs | ) |

Assignment operator

Parameters

  rhs | The object to copy from.

Returns
  The resulting object (this).

## ◆ ParentNameCount()

unsigned int ParentNameCount | ( |  | ) | const

Returns
  The size of the parent name stack.

## ◆ PassFilter()

virtual bool PassFilter | ( | const char * | name | ) |
| virtual

Test a resource name against the filter.

Parameters

  name | The name to test against the filter.

Returns
  True if the name passes.

## ◆ PushParentName()

void PushParentName | ( | const char * | parent | ) |

Pushes a parent name onto the filter's parent stack. This is a list of names of objects that represents the hierarchy above this object; this should be used by the BuildHierarchyName to prepend the parent names when in the editor, as we don't have the ComponentBase's Parent frame pointers available.

Parameters

  parent | The new parent name to push onto the stack.

## ◆ RemoveExclude()

void RemoveExclude | ( | unsigned int | index | ) |

Removes a entry from the exclude list This will reduce the ExcludeCount()

Parameters

  index | < ExcludeCount()

## ◆ RemoveInclude()

void RemoveInclude | ( | unsigned int | index | ) |

Removes a entry from the include list. This will reduce the IncludeCount().

Parameters

  index | < IncludeCount()

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

- gls_resources.h