GL Studio 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) 2015 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 "rso_interface_1.h"
44 #include "gls_resources.h"
45 
46 namespace disti {
47 
48 /** Standard implmentation for the RSO1_ResourceFilter interface
49 * This wraps the GlsResourceFilter class
50 */
52 {
53 protected:
54  // Reference to the GlsResourceFilter object being wrapped
55  // The GlsRSO1_ResourceFilterImpl does not delete this object.
56  GlsResourceFilter* _filter;
57 public:
59  _filter(filter)
60  {}
61 
62  virtual ~GlsRSO1_ResourceFilterImpl() {}
63 
64  // Change the filter object that this interface is wrapping
65  void Filter(GlsResourceFilter* filter) { _filter = filter; }
66  GlsResourceFilter* Filter() { return _filter; }
67 
68  // How many levels of qualification to show in the name.
69  // -1 means full qualification.
70  virtual int LevelsUp() const { return _filter?_filter->LevelsUp():-1; }
71  virtual void LevelsUp(int value) { if(_filter) { _filter->LevelsUp(value); } }
72 
73  // How many levels of children to show.
74  // 0 means don't show any children properties
75  // -1 means all the way down.
76  virtual int GroupLevelsDown() const { return _filter?_filter->GroupLevelsDown():0; }
77  virtual void GroupLevelsDown(int value) { if(_filter) { _filter->GroupLevelsDown(value); } }
78 
79  // If true, only a list of names will be returned.
80  // Values will not be returned.
81  // The format changes to not include the ":".
82  virtual bool NamesOnly() const { return _filter?_filter->NamesOnly():false; }
83  virtual void NamesOnly(bool value) { if(_filter) { _filter->NamesOnly(value); } }
84 
85  // Manage the exclude list
86  virtual void AddExclude(const char* str) { if(_filter) { _filter->AddExclude(str); } }
87  virtual int ExcludeCount() const { return _filter?_filter->ExcludeCount():0; }
88  virtual const char* GetExclude(int index) const { return (_filter)?(_filter->GetExclude(index)):(NULL); }
89 
90  // Manage the include list
91  virtual void AddInclude(const char* str) { if(_filter) { _filter->AddInclude(str); } }
92  virtual int IncludeCount() const { return _filter?_filter->IncludeCount():0; }
93  virtual const char* GetInclude(int index) const { return (_filter)?(_filter->GetInclude(index)):(NULL); }
94 
95  // Check a name against the filter.
96  virtual bool PassFilter(const char* name) const { return _filter?_filter->PassFilter(name):true; }
97 };
98 
99 } // namespace disti
100 
101 #endif
const char * GetInclude(unsigned int index) const
unsigned int ExcludeCount() const
Returns the number of exclude entries in the filter.
bool NamesOnly()
Definition: gls_resources.h:103
Definition: gls_rso_container_util.h:51
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:564
unsigned int IncludeCount() const
Returns the number of includes in the filter.
void AddExclude(const char *name)
int LevelsUp()
Definition: gls_resources.h:79
int GroupLevelsDown()
Definition: gls_resources.h:96
Definition: gls_resources.h:50
disti::GlsResourceFilter classes and methods.
const char * GetExclude(unsigned int index) const
Definition: bmpimage.h:46