| GL Studio C++ Runtime API

gls_rso_container_util.h
Go to the documentation of this file.
1/*! \file
2 \brief Standard GL Studio implementation of the rso interface (container side), disti::GlsRSO1_ResourceFilterImpl.
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<br>
9 USA<br>
10 <br>
11 All rights reserved.<br>
12
13 This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38
39*/
40#ifndef _GLS_RSO_CONTAINER_UTIL_H
41#define _GLS_RSO_CONTAINER_UTIL_H
42
43#include "gls_resources.h"
44
45#ifdef GLES
46# include "rso_interface_es_1.h"
47 typedef disti::RSOInterfaceES1 RsoImplBaseInterface; ///< Typedef for the original RSO interface.
48#else
49# include "rso_interface_1.h"
50 typedef disti::RSOInterface1 RsoImplBaseInterface; ///< Typedef for the original RSO interface.
51#endif
52
53 namespace disti
54{
55/** Standard implmentation for the RSO1_ResourceFilter interface
56* This wraps the GlsResourceFilter class
57*/
58 class GlsRSO1_ResourceFilterImpl : public RsoImplBaseInterface::ResourceFilter
59{
60 protected:
61 /// Reference to the GlsResourceFilter object being wrapped.
62 /// The GlsRSO1_ResourceFilterImpl does not delete this object.
63 GlsResourceFilter* _filter;
64
65 public:
66 /// Constructor
67 /// \param filter The filter object to wrap.
68 GlsRSO1_ResourceFilterImpl( GlsResourceFilter* filter )
69 : _filter( filter )
70 {}
71
72 virtual ~GlsRSO1_ResourceFilterImpl() {}
73
74 /// Change the filter object that this interface is wrapping.
75 /// \param filter The new filter to set.
76 void Filter( GlsResourceFilter* filter ) { _filter = filter; }
77
78 /// \return The current filter object.
79 GlsResourceFilter* Filter() { return _filter; }
80
81 /// \return The current levels of qualification to show in the name. -1 means full qualification.
82 virtual int LevelsUp() const { return _filter ? _filter->LevelsUp() : -1; }
83
84 /// How many levels of qualification to show in the name. -1 means full qualification.
85 /// \param value the new qualification level to set
86 virtual void LevelsUp( int value )
87 {
88 if( _filter )
89 {
90 _filter->LevelsUp( value );
91 }
92 }
93
94 /// \return The current levels of children to show.
95 virtual int GroupLevelsDown() const { return _filter ? _filter->GroupLevelsDown() : 0; }
96
97 /// How many levels of children to show.
98 /// 0 means don't show any children properties
99 /// -1 means all the way down.
100 /// \param value The new levels of children to show.
101 virtual void GroupLevelsDown( int value )
102 {
103 if( _filter )
104 {
105 _filter->GroupLevelsDown( value );
106 }
107 }
108
109 /// \return Whether or not to show names, or names and values.
110 virtual bool NamesOnly() const { return _filter ? _filter->NamesOnly() : false; }
111
112 /// If true, only a list of names will be returned.
113 /// Values will not be returned.
114 /// The format changes to not include the ":".
115 /// \param value The new name format flag to set.
116 virtual void NamesOnly( bool value )
117 {
118 if( _filter )
119 {
120 _filter->NamesOnly( value );
121 }
122 }
123
124 /// Manage the exclude list. Takes precedence over includes.
125 /// \param str The new name to add to the exclude list.
126 virtual void AddExclude( const char* str )
127 {
128 if( _filter )
129 {
130 _filter->AddExclude( str );
131 }
132 }
133
134 /// \return The number of items in the exclusion list.
135 virtual int ExcludeCount() const { return _filter ? _filter->ExcludeCount() : 0; }
136
137 /// \return The name of the exclude item associated with the index.
138 /// \param index The index whose name is to be returned.
139 virtual const char* GetExclude( int index ) const { return ( _filter ) ? ( _filter->GetExclude( index ) ) : ( NULL ); }
140
141 /// Manage the include list.
142 /// \param str The new name to add to the include list.
143 virtual void AddInclude( const char* str )
144 {
145 if( _filter )
146 {
147 _filter->AddInclude( str );
148 }
149 }
150
151 /// \return The number of items in the inclusion list.
152 virtual int IncludeCount() const { return _filter ? _filter->IncludeCount() : 0; }
153
154 /// \return The name of the include item associated with the index.
155 /// \param index The index whose name is to be returned.
156 virtual const char* GetInclude( int index ) const { return ( _filter ) ? ( _filter->GetInclude( index ) ) : ( NULL ); }
157
158 /// Check a name against the filter.
159 /// \param name The name to check against the filter.
160 /// \return Whether or not the name passes the filter (to be included in the results).
161 virtual bool PassFilter( const char* name ) const { return _filter ? _filter->PassFilter( name ) : true; }
162};
163
164} // namespace disti
165
166#endif
disti::GlsRSO1_ResourceFilterImpl
Definition: gls_rso_container_util.h:59
disti::GlsRSO1_ResourceFilterImpl::_filter
GlsResourceFilter * _filter
Definition: gls_rso_container_util.h:63
disti::GlsRSO1_ResourceFilterImpl::Filter
GlsResourceFilter * Filter()
Definition: gls_rso_container_util.h:79
disti::GlsRSO1_ResourceFilterImpl::NamesOnly
virtual void NamesOnly(bool value)
Definition: gls_rso_container_util.h:116
disti::GlsRSO1_ResourceFilterImpl::LevelsUp
virtual void LevelsUp(int value)
Definition: gls_rso_container_util.h:86
disti::GlsRSO1_ResourceFilterImpl::GlsRSO1_ResourceFilterImpl
GlsRSO1_ResourceFilterImpl(GlsResourceFilter *filter)
Definition: gls_rso_container_util.h:68
disti::GlsRSO1_ResourceFilterImpl::GroupLevelsDown
virtual void GroupLevelsDown(int value)
Definition: gls_rso_container_util.h:101
disti::GlsRSO1_ResourceFilterImpl::GetInclude
virtual const char * GetInclude(int index) const
Definition: gls_rso_container_util.h:156
disti::GlsRSO1_ResourceFilterImpl::AddExclude
virtual void AddExclude(const char *str)
Definition: gls_rso_container_util.h:126
disti::GlsRSO1_ResourceFilterImpl::IncludeCount
virtual int IncludeCount() const
Definition: gls_rso_container_util.h:152
disti::GlsRSO1_ResourceFilterImpl::GroupLevelsDown
virtual int GroupLevelsDown() const
Definition: gls_rso_container_util.h:95
disti::GlsRSO1_ResourceFilterImpl::AddInclude
virtual void AddInclude(const char *str)
Definition: gls_rso_container_util.h:143
disti::GlsRSO1_ResourceFilterImpl::GetExclude
virtual const char * GetExclude(int index) const
Definition: gls_rso_container_util.h:139
disti::GlsRSO1_ResourceFilterImpl::NamesOnly
virtual bool NamesOnly() const
Definition: gls_rso_container_util.h:110
disti::GlsRSO1_ResourceFilterImpl::PassFilter
virtual bool PassFilter(const char *name) const
Definition: gls_rso_container_util.h:161
disti::GlsRSO1_ResourceFilterImpl::ExcludeCount
virtual int ExcludeCount() const
Definition: gls_rso_container_util.h:135
disti::GlsRSO1_ResourceFilterImpl::Filter
void Filter(GlsResourceFilter *filter)
Definition: gls_rso_container_util.h:76
disti::GlsRSO1_ResourceFilterImpl::LevelsUp
virtual int LevelsUp() const
Definition: gls_rso_container_util.h:82
disti::GlsResourceFilter
Definition: gls_resources.h:51
disti::GlsResourceFilter::LevelsUp
void LevelsUp(int value)
Definition: gls_resources.h:84
disti::GlsResourceFilter::IncludeCount
unsigned int IncludeCount() const
disti::GlsResourceFilter::GetInclude
const char * GetInclude(unsigned int index) const
disti::GlsResourceFilter::ExcludeCount
unsigned int ExcludeCount() const
disti::GlsResourceFilter::GetExclude
const char * GetExclude(unsigned int index) const
disti::GlsResourceFilter::NamesOnly
void NamesOnly(bool value)
Definition: gls_resources.h:112
disti::GlsResourceFilter::AddInclude
void AddInclude(const char *name)
disti::GlsResourceFilter::PassFilter
virtual bool PassFilter(const char *name)
disti::GlsResourceFilter::AddExclude
void AddExclude(const char *name)
disti::GlsResourceFilter::GroupLevelsDown
void GroupLevelsDown(int value)
Definition: gls_resources.h:103
disti::RSOInterface1
Definition: rso_interface_1.h:61
gls_resources.h
disti::GlsResourceFilter classes and methods.
RsoImplBaseInterface
disti::RSOInterfaceES1 RsoImplBaseInterface
Typedef for the original RSO interface.
Definition: gls_rso_container_util.h:47
disti
Definition: bmpimage.h:47
rso_interface_1.h
Defines the RSO interface, which provides a generic way of accessing RSOs and other content,...