fintp_base
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExtensionUrl.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 EXTENSIONURL_H
22 #define EXTENSIONURL_H
23 
24 #include <xalanc/Include/PlatformDefinitions.hpp>
25 #include <xalanc/XPath/Function.hpp>
26 #include <xercesc/util/PlatformUtils.hpp>
27 #include <xalanc/XalanTransformer/XalanTransformer.hpp>
28 #include <xalanc/XPath/XObjectFactory.hpp>
29 
30 #include "../DllMain.h"
31 
32 #include <curl/curl.h>
33 
34 XALAN_USING_XALAN(Function)
35 XALAN_USING_XALAN(XPathExecutionContext)
36 XALAN_USING_XALAN(XalanDOMString)
37 XALAN_USING_XALAN(XalanNode)
38 //XALAN_USING_XALAN(StaticStringToDOMString)
39 XALAN_USING_XALAN(XObjectPtr)
40 
41 #ifdef XALAN_1_9
42 XALAN_USING_XALAN(MemoryManagerType)
43 #endif
44 
45 namespace FinTP
46 {
47  class ExportedObject FunctionUrl : public Function
48  {
49  public:
50  virtual XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectArgVectorType& args,const LocatorType* locator ) const;
51 
52  #ifdef XALAN_1_9
53  #if defined( XALAN_NO_COVARIANT_RETURN_TYPE )
54  virtual Function* clone( MemoryManagerType& theManager ) const;
55  #else
56  virtual FunctionUrl* clone( MemoryManagerType& theManager ) const;
57  #endif
58  protected:
59  const XalanDOMString& getError( XalanDOMString& theResult ) const;
60  #else
61  #if defined( XALAN_NO_COVARIANT_RETURN_TYPE )
62  virtual Function* clone() const;
63  #else
64  virtual FunctionUrl* clone() const;
65  #endif
66  protected:
67  const XalanDOMString getError() const;
68  #endif
69 
70  public :
71  static int writer( char *data, size_t size, size_t nmemb, unsigned char** writerData );
72 
73  static string SSLCertificateFileName;
74  static string SSLCertificatePasswd;
75 
76  private:
77 
78  // The assignment and equality operators are not implemented...
79  FunctionUrl& operator=( const FunctionUrl& );
80  bool operator==( const FunctionUrl& ) const;
81 
82  void initCurl( CURL *&conn, const string& url ) const;
83 
84  static char m_ErrorBuffer[ CURL_ERROR_SIZE ];
85  static unsigned char** m_Buffer;
86  static long m_BufferSize;
87  };
88 }
89 
90 #endif // EXTENSIONURL_H