Add internal copy of the Xerces net accessor for libcurl, to get SSL support.
[shibboleth/cpp-xmltooling.git] / xmltooling / util / CurlNetAccessor.cpp
1 /*\r
2  * Licensed to the Apache Software Foundation (ASF) under one or more\r
3  * contributor license agreements.  See the NOTICE file distributed with\r
4  * this work for additional information regarding copyright ownership.\r
5  * The ASF licenses this file to You under the Apache License, Version 2.0\r
6  * (the "License"); you may not use this file except in compliance with\r
7  * the License.  You may obtain a copy of the License at\r
8  * \r
9  *      http://www.apache.org/licenses/LICENSE-2.0\r
10  * \r
11  * Unless required by applicable law or agreed to in writing, software\r
12  * distributed under the License is distributed on an "AS IS" BASIS,\r
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14  * See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  */\r
17 \r
18 /*\r
19  * $Id: CurlNetAccessor.cpp 471747 2006-11-06 14:31:56Z amassari $\r
20  */\r
21 \r
22 #include "internal.h"\r
23 #include "util/CurlURLInputStream.h"\r
24 #include "util/CurlNetAccessor.h"\r
25 \r
26 #include <xercesc/util/XMLUniDefs.hpp>\r
27 #include <xercesc/util/XMLUni.hpp>\r
28 #include <xercesc/util/XMLString.hpp>\r
29 #include <xercesc/util/XMLExceptMsgs.hpp>\r
30 \r
31 using namespace xmltooling;\r
32 \r
33 const XMLCh CurlNetAccessor::fgMyName[] =\r
34 {\r
35     chLatin_C, chLatin_u, chLatin_r, chLatin_l, chLatin_N, chLatin_e,\r
36     chLatin_t, chLatin_A, chLatin_c, chLatin_c, chLatin_e, chLatin_s,\r
37     chLatin_s, chLatin_o, chLatin_r, chNull\r
38 };\r
39 \r
40 \r
41 BinInputStream*\r
42 CurlNetAccessor::makeNew(const XMLURL&  urlSource, const XMLNetHTTPInfo* httpInfo/*=0*/)\r
43 {\r
44         // Just create a CurlURLInputStream\r
45         // We defer any checking of the url type for curl in CurlURLInputStream\r
46         CurlURLInputStream* retStrm =\r
47                 new (urlSource.getMemoryManager()) CurlURLInputStream(urlSource, httpInfo);\r
48         return retStrm;            \r
49 }\r