GL Studio C++ Runtime API
GlsResourceFilter Class Reference

#include <gls_resources.h>

Public Member Functions

 GlsResourceFilter (GlsResourceFilter *source)
 Copy constructor.
 
int LevelsUp ()
 
int GroupLevelsDown ()
 
bool NamesOnly ()
 
void AddExclude (const char *name)
 
unsigned int ExcludeCount () const
 Returns the number of exclude entries in the filter.
 
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
 Returns the number of includes in the filter.
 
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)
 Test a resource name against the filter.
 
void PushParentName (const char *parent)
 
unsigned int ParentNameCount () const
 
const char * GetParentName (unsigned int index) const
 
void PopParentName ()
 
void ClearParentNames ()
 
GlsResourceFilteroperator= (const GlsResourceFilter &rhs)
 assignment operator
 

Static Public Member Functions

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

Detailed Description

Used for specifiying a filter for accessing resources

Member Function Documentation

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

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.

static std::string BuildHierarchyName ( DisplayFrame frame,
GlsResourceFilter filter 
)
static
Returns
the qualified name for a DisplayFrame.
static std::string BuildHierarchyName ( DisplayObject obj,
GlsResourceFilter filter 
)
static
Returns
the qualified name for a DisplayObject.
void ClearParentNames ( )

Removes all entries on the parent name stack

const char* GetExclude ( unsigned int  index) const

Returns the resource name for the given exclude list entry

Parameters
index< ExcludeCount()
const char* GetInclude ( unsigned int  index) const

Returns the resource name for the given include list entry

Parameters
index< IncludeCount()
const char* GetParentName ( unsigned int  index) const

Returns the parent name for the given position on the stack

int GroupLevelsDown ( )
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

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

bool NamesOnly ( )
inline

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

unsigned int ParentNameCount ( ) const

Returns the size of the parent name stack

void PopParentName ( )

Removes the top entry on the parent name stack

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.

void RemoveExclude ( unsigned int  index)

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

Parameters
index< ExcludeCount()
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: