fintp_base
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExtensionRegex.h
Go to the documentation of this file.
1 /*
2 * FinTP - Financial Transactions Processing Application
3 * Copyright (C) 2013 Business Information Systems (Allevo) S.R.L.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>
17 * or contact Allevo at : 031281 Bucuresti, 23C Calea Vitan, Romania,
18 * phone +40212554577, office@allevo.ro <mailto:office@allevo.ro>, www.allevo.ro.
19 */
20 
21 #ifndef EXTENSIONREGEX_H
22 #define EXTENSIONREGEX_H
23 
24 #include "../DllMain.h"
25 
26 #include <map>
27 #include <vector>
28 
29 using namespace std;
30 
31 #include <xalanc/Include/PlatformDefinitions.hpp>
32 #include <xalanc/XPath/Function.hpp>
33 #include <xercesc/util/PlatformUtils.hpp>
34 #include <xalanc/XalanTransformer/XalanTransformer.hpp>
35 #include <xalanc/XPath/XObjectFactory.hpp>
36 
37 XALAN_USING_XALAN(Function)
38 XALAN_USING_XALAN(XPathExecutionContext)
39 XALAN_USING_XALAN(XalanDOMString)
40 XALAN_USING_XALAN(XalanNode)
41 //XALAN_USING_XALAN(StaticStringToDOMString)
42 XALAN_USING_XALAN(XObjectPtr)
43 
44 #ifdef XALAN_1_9
45 XALAN_USING_XALAN(MemoryManagerType)
46 #endif
47 
48 namespace FinTP
49 {
50  class ExportedObject FunctionRegex : public Function
51  {
52  public:
53  virtual XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectArgVectorType& args,const LocatorType* locator ) const;
54 
55  #ifdef XALAN_1_9
56  #if defined( XALAN_NO_COVARIANT_RETURN_TYPE )
57  virtual Function* clone( MemoryManagerType& theManager ) const;
58  #else
59  virtual FunctionRegex* clone( MemoryManagerType& theManager ) const;
60  #endif
61  protected:
62  const XalanDOMString& getError( XalanDOMString& theResult ) const;
63  #else
64  #if defined( XALAN_NO_COVARIANT_RETURN_TYPE )
65  virtual Function* clone() const;
66  #else
67  virtual FunctionRegex* clone() const;
68  #endif
69  protected:
70  const XalanDOMString getError() const;
71  #endif
72 
73  private:
74  // The assignment and equality operators are not implemented...
75  FunctionRegex& operator=( const FunctionRegex& );
76  bool operator==( const FunctionRegex& ) const;
77 
78  static map< string, vector< string > > m_GroupNames;
79  static map< string, string > m_Cache;
80 
81  static void buildNodeNames( const string& regex );
82  };
83 
84  class ExportedObject FunctionRegexMatch : public Function
85  {
86  public:
87  virtual XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectArgVectorType& args,const LocatorType* locator ) const;
88 
89  #ifdef XALAN_1_9
90  #if defined( XALAN_NO_COVARIANT_RETURN_TYPE )
91  virtual Function* clone( MemoryManagerType& theManager ) const;
92  #else
93  virtual FunctionRegexMatch* clone( MemoryManagerType& theManager ) const;
94  #endif
95  protected:
96  const XalanDOMString& getError( XalanDOMString& theResult ) const;
97  #else
98  #if defined( XALAN_NO_COVARIANT_RETURN_TYPE )
99  virtual Function* clone() const;
100  #else
101  virtual FunctionRegexMatch* clone() const;
102  #endif
103  protected:
104  const XalanDOMString getError() const;
105  #endif
106 
107  private:
108  // The assignment and equality operators are not implemented...
109  FunctionRegexMatch& operator=( const FunctionRegexMatch& );
110  bool operator==( const FunctionRegexMatch& ) const;
111  };
112 }
113 
114 #endif // EXTENSIONREGEX_H