SchemeParser.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
25 //----------------------------------------------------------------------
26 #ifndef ICL_CORE_SCHEME_PARSER_H_INCLUDED
27 #define ICL_CORE_SCHEME_PARSER_H_INCLUDED
28 
29 #include "icl_core/BaseTypes.h"
30 #include "icl_core/ImportExport.h"
31 
32 #include <vector>
33 
34 #include <boost/spirit/version.hpp>
35 #if SPIRIT_VERSION < 0x2000
36 # include <boost/spirit.hpp>
37 # define BOOST_SPIRIT_NAMESPACE boost::spirit
38 #else
39 // Undefine the Boost Spirit version macros because they are redefined
40 // in the include below!
41 # undef SPIRIT_VERSION
42 # undef SPIRIT_PIZZA_VERSION
43 
44 # include <boost/spirit/include/classic.hpp>
45 # define BOOST_SPIRIT_NAMESPACE boost::spirit::classic
46 #endif
47 
48 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
49 # include "icl_core/Deprecate.h"
50 #endif
51 
52 namespace icl_core
53 {
54 
55 struct Query
56 {
59 };
60 
61 typedef std::vector<Query> QueryList;
62 
64 {
70 };
71 
72 struct Scheme
73 {
78  QueryList queries;
79 };
80 
81 #ifdef __cplusplus
82 ICL_CORE_IMPORT_EXPORT std::ostream& operator<<(std::ostream& stream, Scheme const& scheme);
83 #endif // __cplusplus
84 
89 {
90 public:
92  { }
93  virtual void operator () (char const* str, char const* end) const = 0;
94 };
95 
97 {
98 public:
99  virtual ~SchemeFunction()
100  { }
101  virtual void operator () (char const* str, char const* end) const;
103 };
104 
106 {
107 public:
109  { }
110  virtual void operator () (char const* str, char const* end) const;
112 };
113 
115 {
116 public:
117  virtual ~AnchorFunction()
118  { }
119  virtual void operator () (char const* str, char const* end) const;
121 };
122 
124 {
125 public:
127  { }
128  virtual void operator () (char const* str, char const* end) const;
129  QueryList *m_queries;
130 };
131 
133 {
134 public:
136  { }
137  virtual void operator () (char const* str, char const* end) const;
138  QueryList *m_queries;
139 };
140 
146 {
147 public:
149  SchemeParser();
150 
152  ~SchemeParser();
153 
157  bool parseScheme(const String &str);
158 
162  const BOOST_SPIRIT_NAMESPACE::parse_info<> &getParseInfo() const;
163 
165  const icl_core::Scheme &getSchemeResult() const;
166 
169  static bool parseScheme(const String &str, Scheme &scheme_handler,
170  BOOST_SPIRIT_NAMESPACE::parse_info<> &info);
171 
173 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
174 
179 
184  ICL_CORE_VC_DEPRECATE_STYLE const BOOST_SPIRIT_NAMESPACE::parse_info<> &GetParseInfo() const ICL_CORE_GCC_DEPRECATE_STYLE;
185 
190 
194  ICL_CORE_VC_DEPRECATE_STYLE static bool ParseScheme(const String &str, Scheme &scheme_handler,
195  BOOST_SPIRIT_NAMESPACE::parse_info<> &info)
197 
198 #endif
199 
201 private:
202  BOOST_SPIRIT_NAMESPACE::parse_info<> m_info;
203 
205 };
206 
207 } // namespace icl_core
208 
209 #endif // _icl_core_SchemeParser_h_
std::ostream & operator<<(std::ostream &os, StampedBase const &stamped)
Definition: DataHeader.cpp:27
#define ICL_CORE_VC_DEPRECATE_STYLE
Definition: Deprecate.h:53
file:///path/file?key=value
Definition: SchemeParser.h:65
icl_core::Scheme m_scheme
Definition: SchemeParser.h:204
Contains macros to deprecate classes, types, functions and variables.
gps://type (gpsd/oxfs/...)
Definition: SchemeParser.h:68
#define ICL_CORE_IMPORT_EXPORT
Definition: ImportExport.h:42
camera://source?key=value
Definition: SchemeParser.h:67
BOOST_SPIRIT_NAMESPACE::parse_info m_info
Definition: SchemeParser.h:202
Contains import/export definitions for the Win32 plattform.
std::string String
Definition: BaseTypes.h:43
http://domain.org/path/to/site.ext?key=value
Definition: SchemeParser.h:66
SchemeType scheme_type
Definition: SchemeParser.h:74
Contains Interface base classes and base types.
QueryList queries
Definition: SchemeParser.h:78
std::vector< Query > QueryList
Definition: SchemeParser.h:61
#define ICL_CORE_GCC_DEPRECATE_STYLE
Definition: Deprecate.h:54


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58