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 #ifdef GLES
45 #include "rso_interface_es_1.h"
46 typedef disti::RSOInterfaceES1 RsoImplBaseInterface;
47 #else
48 #include "rso_interface_1.h"
50 #endif
51 
52 namespace disti
53 {
54 /** Standard implmentation for the RSO1_ResourceFilter interface
55 * This wraps the GlsResourceFilter class
56 */
58 {
59 protected:
60  // Reference to the GlsResourceFilter object being wrapped
61  // The GlsRSO1_ResourceFilterImpl does not delete this object.
62  GlsResourceFilter* _filter;
63 
64 public:
66  : _filter( filter )
67  {}
68 
69  virtual ~GlsRSO1_ResourceFilterImpl() {}
70 
71  // Change the filter object that this interface is wrapping
72  void Filter( GlsResourceFilter* filter ) { _filter = filter; }
73  GlsResourceFilter* Filter() { return _filter; }
74 
75  // How many levels of qualification to show in the name.
76  // -1 means full qualification.
77  virtual int LevelsUp() const { return _filter ? _filter->LevelsUp() : -1; }
78  virtual void LevelsUp( int value )
79  {
80  if( _filter )
81  {
82  _filter->LevelsUp( value );
83  }
84  }
85 
86  // How many levels of children to show.
87  // 0 means don't show any children properties
88  // -1 means all the way down.
89  virtual int GroupLevelsDown() const { return _filter ? _filter->GroupLevelsDown() : 0; }
90  virtual void GroupLevelsDown( int value )
91  {
92  if( _filter )
93  {
94  _filter->GroupLevelsDown( value );
95  }
96  }
97 
98  // If true, only a list of names will be returned.
99  // Values will not be returned.
100  // The format changes to not include the ":".
101  virtual bool NamesOnly() const { return _filter ? _filter->NamesOnly() : false; }
102  virtual void NamesOnly( bool value )
103  {
104  if( _filter )
105  {
106  _filter->NamesOnly( value );
107  }
108  }
109 
110  // Manage the exclude list
111  virtual void AddExclude( const char* str )
112  {
113  if( _filter )
114  {
115  _filter->AddExclude( str );
116  }
117  }
118  virtual int ExcludeCount() const { return _filter ? _filter->ExcludeCount() : 0; }
119  virtual const char* GetExclude( int index ) const { return ( _filter ) ? ( _filter->GetExclude( index ) ) : ( NULL ); }
120 
121  // Manage the include list
122  virtual void AddInclude( const char* str )
123  {
124  if( _filter )
125  {
126  _filter->AddInclude( str );
127  }
128  }
129  virtual int IncludeCount() const { return _filter ? _filter->IncludeCount() : 0; }
130  virtual const char* GetInclude( int index ) const { return ( _filter ) ? ( _filter->GetInclude( index ) ) : ( NULL ); }
131 
132  // Check a name against the filter.
133  virtual bool PassFilter( const char* name ) const { return _filter ? _filter->PassFilter( name ) : true; }
134 };
135 
136 } // namespace disti
137 
138 #endif
const char * GetInclude(unsigned int index) const
virtual int GroupLevelsDown() const
Definition: gls_rso_container_util.h:89
unsigned int ExcludeCount() const
Returns the number of exclude entries in the filter.
virtual bool NamesOnly() const
Definition: gls_rso_container_util.h:101
virtual int ExcludeCount() const
Definition: gls_rso_container_util.h:118
bool NamesOnly()
Definition: gls_resources.h:103
Definition: gls_rso_container_util.h:57
Defines the RSO interface, which provides a generic way of accessing RSOs and other content...
void AddInclude(const char *name)
virtual bool PassFilter(const char *name)
Test a resource name against the filter.
Definition: rso_interface_1.h:592
unsigned int IncludeCount() const
Returns the number of includes in the filter.
Definition: rso_interface_1.h:60
void AddExclude(const char *name)
int LevelsUp()
Definition: gls_resources.h:79
int GroupLevelsDown()
Definition: gls_resources.h:96
virtual bool PassFilter(const char *name) const
Definition: gls_rso_container_util.h:133
virtual void AddInclude(const char *str)
Manage the list of included attributes.
Definition: gls_rso_container_util.h:122
virtual int LevelsUp() const
Definition: gls_rso_container_util.h:77
virtual int IncludeCount() const
Definition: gls_rso_container_util.h:129
virtual const char * GetExclude(int index) const
Returns NULL if index >= ExcludeCount() or index < -1.
Definition: gls_rso_container_util.h:119
virtual void AddExclude(const char *str)
Manage the list of excluded attributes.
Definition: gls_rso_container_util.h:111
Definition: gls_resources.h:50
disti::GlsResourceFilter classes and methods.
const char * GetExclude(unsigned int index) const
Definition: bmpimage.h:46