CLI  2.9
syntax_tag.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2006-2018, Alexis Royer, http://alexis.royer.free.fr/CLI
3 
4  All rights reserved.
5 
6  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
10  and/or other materials provided with the distribution.
11  * Neither the name of the CLI library project nor the names of its contributors may be used to endorse or promote products derived from this software
12  without specific prior written permission.
13 
14  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26 
27 
31 
32 #ifndef _CLI_SYNTAX_TAG_H_
33 #define _CLI_SYNTAX_TAG_H_
34 
35 #include "cli/namespace.h"
36 #include "cli/syntax_node.h"
37 #include "cli/tk.h"
38 
39 
41 
42 
43  class SyntaxTag : public SyntaxNode
44  {
45  public:
47  explicit SyntaxTag(
48  const bool B_Hollow
49  );
50 
52  virtual ~SyntaxTag(void);
53 
54  private:
56  explicit SyntaxTag(void);
58  SyntaxTag(const SyntaxTag&);
60  SyntaxTag& operator=(const SyntaxTag&);
61 
62  public:
63  // Inherit doxygen comments from cli::Element documentation.
64  virtual const tk::String GetKeyword(void) const;
65 
68  const bool GetbHollow(void) const;
69 
70  private:
72  const bool m_bHollow;
73  };
74 
75 
77  class SyntaxRef : public Element
78  {
79  public:
81  explicit SyntaxRef(
82  const SyntaxTag& CLI_Tag
83  );
84 
86  virtual ~SyntaxRef(void);
87 
88  private:
90  explicit SyntaxRef(void);
92  SyntaxRef(const SyntaxRef&);
94  SyntaxRef& operator=(const SyntaxRef&);
95 
96  public:
97  // Inherit doxygen comments from cli::Element documentation.
98  virtual const tk::String GetKeyword(void) const;
99 
102  const SyntaxTag& GetTag(void) const;
103 
104  private:
106  const SyntaxTag* const m_pcliTag;
107  };
108 
110 
111 #endif // _CLI_SYNTAX_TAG_H_
Main namespace of the CLI library.
SyntaxNode class definition.
Syntax node elements.
Definition: syntax_node.h:51
virtual ~SyntaxRef(void)
Destructor.
#define CLI_NS_END(__ns)
End a namespace definition.
Definition: namespace.h:45
virtual const tk::String GetKeyword(void) const
String identifier accessor.
const SyntaxTag & GetTag(void) const
Tag reference accessor.
Namespace management.
Syntax tag element class.
Definition: syntax_tag.h:43
Generic CLI element.
Definition: element.h:55
#define CLI_NS_BEGIN(__ns)
Begin a namespace definition.
Definition: namespace.h:38
CLI toolkit definition.
Syntax tag reference element.
Definition: syntax_tag.h:77