GL Studio C++ Runtime API
gls_rso_container_util.h
Go to the documentation of this file.
1/// \file gls_rso_container_util.h
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/// 12249 Science Drive; Suite 300<br>
8/// Orlando, Florida 32826<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#ifndef DISTI_INCLUDED_GLS_RSO_CONTAINER_UTIL_H
40#define DISTI_INCLUDED_GLS_RSO_CONTAINER_UTIL_H
41
42#include "gls_resources.h"
43
44#ifdef GLES
45# include "rso_interface_es_1.h"
46typedef disti::RSOInterfaceES1 RsoImplBaseInterface; ///< Typedef for the original RSO interface.
47#else
48# include "rso_interface_1.h"
49typedef disti::RSOInterface1 RsoImplBaseInterface; ///< Typedef for the original RSO interface.
50#endif
51
52namespace disti
53{
54/** Standard implmentation for the RSO1_ResourceFilter interface
55* This wraps the GlsResourceFilter class
56*/
58{
59protected:
60 /// Reference to the GlsResourceFilter object being wrapped.
61 /// The GlsRSO1_ResourceFilterImpl does not delete this object.
63
64public:
65 /// Constructor
66 /// \param filter The filter object to wrap.
68 : _filter( filter )
69 {}
70
72
73 /// Change the filter object that this interface is wrapping.
74 /// \param filter The new filter to set.
75 void Filter( GlsResourceFilter* filter ) { _filter = filter; }
76
77 /// \return The current filter object.
79
80 /// \return The current levels of qualification to show in the name. -1 means full qualification.
81 virtual int LevelsUp() const { return _filter ? _filter->LevelsUp() : -1; }
82
83 /// How many levels of qualification to show in the name. -1 means full qualification.
84 /// \param value the new qualification level to set
85 virtual void LevelsUp( int value )
86 {
87 if( _filter )
88 {
89 _filter->LevelsUp( value );
90 }
91 }
92
93 /// \return The current levels of children to show.
94 virtual int GroupLevelsDown() const { return _filter ? _filter->GroupLevelsDown() : 0; }
95
96 /// How many levels of children to show.
97 /// 0 means don't show any children properties
98 /// -1 means all the way down.
99 /// \param value The new levels of children to show.
100 virtual void GroupLevelsDown( int value )
101 {
102 if( _filter )
103 {
104 _filter->GroupLevelsDown( value );
105 }
106 }
107
108 /// \return Whether or not to show names, or names and values.
109 virtual bool NamesOnly() const { return _filter ? _filter->NamesOnly() : false; }
110
111 /// If true, only a list of names will be returned.
112 /// Values will not be returned.
113 /// The format changes to not include the ":".
114 /// \param value The new name format flag to set.
115 virtual void NamesOnly( bool value )
116 {
117 if( _filter )
118 {
119 _filter->NamesOnly( value );
120 }
121 }
122
123 /// Manage the exclude list. Takes precedence over includes.
124 /// \param str The new name to add to the exclude list.
125 virtual void AddExclude( const char* str )
126 {
127 if( _filter )
128 {
129 _filter->AddExclude( str );
130 }
131 }
132
133 /// \return The number of items in the exclusion list.
134 virtual int ExcludeCount() const { return _filter ? _filter->ExcludeCount() : 0; }
135
136 /// \return The name of the exclude item associated with the index.
137 /// \param index The index whose name is to be returned.
138 virtual const char* GetExclude( int index ) const { return ( _filter ) ? ( _filter->GetExclude( index ) ) : ( NULL ); }
139
140 /// Manage the include list.
141 /// \param str The new name to add to the include list.
142 virtual void AddInclude( const char* str )
143 {
144 if( _filter )
145 {
146 _filter->AddInclude( str );
147 }
148 }
149
150 /// \return The number of items in the inclusion list.
151 virtual int IncludeCount() const { return _filter ? _filter->IncludeCount() : 0; }
152
153 /// \return The name of the include item associated with the index.
154 /// \param index The index whose name is to be returned.
155 virtual const char* GetInclude( int index ) const { return ( _filter ) ? ( _filter->GetInclude( index ) ) : ( NULL ); }
156
157 /// Check a name against the filter.
158 /// \param name The name to check against the filter.
159 /// \return Whether or not the name passes the filter (to be included in the results).
160 virtual bool PassFilter( const char* name ) const { return _filter ? _filter->PassFilter( name ) : true; }
161};
162
163} // namespace disti
164
165#endif
Definition: gls_rso_container_util.h:58
GlsResourceFilter * _filter
Definition: gls_rso_container_util.h:62
GlsResourceFilter * Filter()
Definition: gls_rso_container_util.h:78
virtual void NamesOnly(bool value)
Definition: gls_rso_container_util.h:115
virtual void LevelsUp(int value)
Definition: gls_rso_container_util.h:85
GlsRSO1_ResourceFilterImpl(GlsResourceFilter *filter)
Definition: gls_rso_container_util.h:67
virtual void GroupLevelsDown(int value)
Definition: gls_rso_container_util.h:100
virtual const char * GetInclude(int index) const
Definition: gls_rso_container_util.h:155
virtual void AddExclude(const char *str)
Definition: gls_rso_container_util.h:125
virtual int IncludeCount() const
Definition: gls_rso_container_util.h:151
virtual int GroupLevelsDown() const
Definition: gls_rso_container_util.h:94
virtual void AddInclude(const char *str)
Definition: gls_rso_container_util.h:142
virtual const char * GetExclude(int index) const
Definition: gls_rso_container_util.h:138
virtual bool NamesOnly() const
Definition: gls_rso_container_util.h:109
virtual bool PassFilter(const char *name) const
Definition: gls_rso_container_util.h:160
virtual int ExcludeCount() const
Definition: gls_rso_container_util.h:134
void Filter(GlsResourceFilter *filter)
Definition: gls_rso_container_util.h:75
virtual int LevelsUp() const
Definition: gls_rso_container_util.h:81
Definition: gls_resources.h:49
void LevelsUp(int value)
Definition: gls_resources.h:82
unsigned int IncludeCount() const
const char * GetInclude(unsigned int index) const
unsigned int ExcludeCount() const
const char * GetExclude(unsigned int index) const
void NamesOnly(bool value)
Definition: gls_resources.h:110
void AddInclude(const char *name)
virtual bool PassFilter(const char *name)
void AddExclude(const char *name)
void GroupLevelsDown(int value)
Definition: gls_resources.h:101
Definition: rso_interface_1.h:649
Definition: rso_interface_1.h:60
disti::GlsResourceFilter classes and methods.
disti::RSOInterface1 RsoImplBaseInterface
Typedef for the original RSO interface.
Definition: gls_rso_container_util.h:49
Definition: bmpimage.h:46
Defines the RSO interface, which provides a generic way of accessing RSOs and other content,...