HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STY_TargetMatchStatus.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: STY_TargetMatchStatus.h ( STY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __STY_TargetMatchStatus__
12 #define __STY_TargetMatchStatus__
13 
14 #include "STY_API.h"
15 #include "STY_Types.h"
16 
17 // ===========================================================================
18 /// Contains information about the style subject match to the style target.
20 {
21 public:
22  /// Constructor: for fully matched or not matched target test result.
23  STY_TargetMatchStatus( bool is_match )
24  : myIsMatch( is_match )
25  {}
26 
27  /// Constructor: for partially matched target test result.
28  STY_TargetMatchStatus( bool is_match,
29  const STY_TargetHandle & next_target )
30  : myIsMatch( is_match )
31  , myNextTarget( next_target )
32  {}
33 
34  /// Returns true if the subject matched the target, whether fully or
35  /// partially.
36  bool isMatch() const
37  { return myIsMatch; }
38 
39  /// Returns true if the subject fully matched the target.
40  bool isFullMatch() const
41  { return myIsMatch && !myNextTarget; }
42 
43  /// Returns the target that should be tested next.
45  { return myNextTarget; }
46 
47 private:
48  /// Flag set to true if the style matched the target, fully or partially.
49  bool myIsMatch;
50 
51  /// Holds the target that should be matched next.
52  /// If null, the last test fully matched the target, otherwise
53  /// it points to sub-target that still needs to be tested and be matched.
54  STY_TargetHandle myNextTarget;
55 };
56 
57 #endif
58 
Contains information about the style subject match to the style target.
#define STY_API
Definition: STY_API.h:10
bool isFullMatch() const
Returns true if the subject fully matched the target.
STY_TargetMatchStatus(bool is_match, const STY_TargetHandle &next_target)
Constructor: for partially matched target test result.
STY_TargetMatchStatus(bool is_match)
Constructor: for fully matched or not matched target test result.
const STY_TargetHandle & getNextTarget() const
Returns the target that should be tested next.