pax_global_header00006660000000000000000000000064130574644200014517gustar00rootroot0000000000000052 comment=592552a165cc569dac7674cb7fc9de3dc829906f curlpp-0.8.1/000077500000000000000000000000001305746442000130325ustar00rootroot00000000000000curlpp-0.8.1/.gitignore000066400000000000000000000012311305746442000150170ustar00rootroot00000000000000*.Po *.o *.a *.la *.lo *.Plo *.dylib *.lai Makefile *~ build/ m4/ CMakeFiles/ examples/example01 examples/example02 examples/example03 examples/example04 examples/example05 examples/example06 examples/example07 examples/example08 examples/example09 examples/example10 examples/example11 examples/example12 examples/example13 examples/example14 examples/example15 examples/example16 examples/example17 examples/example18 examples/example19 examples/example20 examples/example21 examples/example22 examples/example23 examples/example24 examples/example25 *.exe CMakeCache.txt conanbuildinfo.cmake conaninfo.txt bin/ curlpp-0.8.1/.hgignore000066400000000000000000000004721305746442000146400ustar00rootroot00000000000000(^|/)\.svn($|/) (^|/)\.hg($|/) (^|/)\.hgtags($|/) ^curlpp-svn.log$ ^tailor.state$ ^tailor.state.old$ ^tailor.state.journal$ .*\.o .*\.lo .*\.a .*\.la .*\.Plo .*\.Po #.*#$ Makefile$ Makefile.in$ include/curlpp/config.h.in include/curlpp/config.h ^examples/example[0-9]*$ aclocal.m4$ .dylib$ curlpp.pc$ curlpp.spec$ curlpp-0.8.1/.travis.yml000066400000000000000000000020731305746442000151450ustar00rootroot00000000000000language: cpp # precise gcc doesn't have c++11 support matrix: include: - os: linux dist: trusty compiler: clang env: NAME="trusty" - os: linux dist: trusty compiler: gcc env: NAME="trusty" - os: linux dist: precise compiler: clang env: NAME="precise" - os: osx osx_image: xcode7.2 - os: osx compiler: clang - os: osx compiler: gcc addons: apt: packages: - libcurl4-openssl-dev before_script: - mkdir build && cd build - cmake ../ script: - make && sudo make install - cd ../examples && mkdir build && cd build - cmake ../ - make install: - echo install----------------------------------------------------------------- # Download and install libcurl - if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew update; brew install curl; fi # install cmake 3.2 for precise - if [[ $NAME == "precise" ]]; then sudo add-apt-repository ppa:george-edison55/precise-backports --yes; sudo apt-get update; sudo apt-get install cmake-data cmake; fi curlpp-0.8.1/CMakeLists.txt000066400000000000000000000104041305746442000155710ustar00rootroot00000000000000project(curlpp) # In response to CMake 3.0 generating warnings regarding policy CMP0042, # the OSX RPATH settings have been updated per recommendations found # in the CMake Wiki: # http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH set(CMAKE_MACOSX_RPATH TRUE) endif() # for unix platform, define install directories. include(GNUInstallDirs) if(WIN32) # cmake 3.4 is required for CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS cmake_minimum_required(VERSION 3.4) # c++ 11 support from cmake 3.4 or newer set(CMAKE_CXX_STANDARD 11) # C++11... set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required... set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11 set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) else() if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_LESS 3.1) cmake_minimum_required(VERSION 2.8) # c++11 support for cmake 2.8.12 - 3.0.x # # for non-windows platform we try to keep cmake 2.8 support # since entreprise distribution tends to have 2.8 version. add_compile_options(-std=c++11) else() # c++ 11 support from cmake 3.1 or newer set(CMAKE_CXX_STANDARD 11) # C++11... set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required... set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11 endif() endif() # Conan.io integration if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/conanbuildinfo.cmake) conan_basic_setup() endif() # extra (pkg-config-related files) add_subdirectory(extras) ######################################################################################### # Look for dependencies # Documented at https://cmake.org/cmake/help/v3.0/module/FindCURL.html?highlight=curlpp # Seems simple. message(STATUS "Looking for CURL") include(FindCURL) find_package(CURL REQUIRED) if(CURL_FOUND) message(STATUS "Found CURL version: ${CURL_VERSION_STRING}") message(STATUS "Using CURL include dir(s): ${CURL_INCLUDE_DIRS}") message(STATUS "Using CURL lib(s): ${CURL_LIBRARIES}") else() message(FATAL_ERROR "Could not find CURL") endif() # All following targets should search these directories for headers include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include ${CURL_INCLUDE_DIRS} ) ######################################################################################### # Define Targets # If building on windows, install path will be in build/winbuild if(CMAKE_SYSTEM MATCHES "Windows") set(CMAKE_INSTALL_PREFIX "winbuild") endif() file(GLOB_RECURSE HeaderFileList "${CMAKE_CURRENT_SOURCE_DIR}/include/*") file(GLOB_RECURSE SourceFileList "${CMAKE_CURRENT_SOURCE_DIR}/src/*") add_library(${PROJECT_NAME} SHARED ${HeaderFileList} ${SourceFileList}) target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES} ${CONAN_LIBS}) set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION 1 VERSION 1.0.0) add_library(${PROJECT_NAME}_static STATIC ${HeaderFileList} ${SourceFileList}) # Make sure that on unix-platforms shared and static libraries have # the same root name, but different suffixes. # # (solution taken from https://cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F) # # Making shared and static libraries have the same root name, but different suffixes SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) # Now the library target "curlpp_static" will be named "curlpp.lib" with MS tools. # This conflicts with the "curlpp.lib" import library corresponding to "curlpp.dll", # so we add a "lib" prefix (which is default on other platforms anyway): SET_TARGET_PROPERTIES(${PROJECT_NAME}_static PROPERTIES PREFIX "lib") target_link_libraries(${PROJECT_NAME}_static ${CURL_LIBRARIES} ${CONAN_LIBS}) # install headers install(DIRECTORY include/utilspp/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/utilspp") install(DIRECTORY include/curlpp/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/curlpp") install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_static RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) curlpp-0.8.1/CNAME000066400000000000000000000000161305746442000135750ustar00rootroot00000000000000www.curlpp.orgcurlpp-0.8.1/Readme.md000066400000000000000000000043121305746442000145510ustar00rootroot00000000000000[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Travis CI](https://img.shields.io/travis/jpbarrette/curlpp.svg)](https://travis-ci.org/jpbarrette/curlpp) [![AppVeyor CI](https://img.shields.io/appveyor/ci/jpbarrette/curlpp.svg)](https://ci.appveyor.com/project/jpbarrette/curlpp) # Description [cURLpp](http://www.curlpp.org) is a C++ wrapper for libcURL. libcURL is described as: a free and easy-to-use client-side URL transfer library, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and more! libcurl is highly portable, it builds and works identically on numerous platforms, including Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HPUX, IRIX, AIX, Tru64, Linux, Windows, Amiga, OS/2, BeOs, Mac OS X, Ultrix, QNX, OpenVMS, RISC OS, Novell NetWare, DOS and more... libcurl is free, thread-safe, IPv6 compatible, feature rich, well supported and fast. First, I need to quote Daniel Stenberg, the maintener of libcURL: You can use libcURL instantly from within your C++ programs. You don't need cURLpp for that, cURLpp just adds an OO'ified layer that libcURL doesn't normally provide. It means that you need to be sure that you need, or want, cURLpp features. If not, I suggest to use directly the libcURL library. So, what are thoses features that cURLpp offers? * You can query handles for option values (version 0.5.x and newer only). * It use the C++ standard library structures instead of home made ones. * It is exception safe. * It is type safe. # Download Latest version is available on GitHub [here](https://github.com/jpbarrette/curlpp/releases/latest). # Documentation The programming guide is [here](https://github.com/jpbarrette/curlpp/tree/master/doc/guide.pdf). This guide is greatly inspired by the libcURL guide, that I strongly suggest to read. There's also some examples in the "[examples](http://github.com/jpbarrette/curlpp/tree/master/examples)/" source directory of cURLpp. curlpp-0.8.1/_config.yml000066400000000000000000000000331305746442000151550ustar00rootroot00000000000000theme: jekyll-theme-minimalcurlpp-0.8.1/appveyor.yml000066400000000000000000000025661305746442000154330ustar00rootroot00000000000000version: '0.7.4.{build}' environment: matrix: - PRJ_GEN: "Visual Studio 11 2012 Win64" BDIR: msvc2012 PRJ_CFG: Release PRJ_GEN_VERSION: 11 - PRJ_GEN: "Visual Studio 12 2013 Win64" BDIR: msvc2013 PRJ_CFG: Release PRJ_GEN_VERSION: 12 - PRJ_GEN: "Visual Studio 14 2015 Win64" BDIR: msvc2015 PRJ_CFG: Release PRJ_GEN_VERSION: 14 - PRJ_GEN: "Visual Studio 11 2012 Win64" BDIR: msvc2012 PRJ_CFG: Debug PRJ_GEN_VERSION: 11 - PRJ_GEN: "Visual Studio 12 2013 Win64" BDIR: msvc2013 PRJ_CFG: Debug PRJ_GEN_VERSION: 12 - PRJ_GEN: "Visual Studio 14 2015 Win64" BDIR: msvc2015 PRJ_CFG: Debug PRJ_GEN_VERSION: 14 install: - cmd: echo "Downloading conan..." - cmd: set PATH=%PATH%;%PYTHON%/Scripts/ - cmd: pip.exe install conan - cmd: conan user # Create the conan data directory - cmd: conan --version build_script: - mkdir build.%BDIR% - IF %PRJ_GEN_VERSION% == 11 call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat" - conan install --build=missing -s compiler="Visual Studio" -s compiler.version=%PRJ_GEN_VERSION% -s build_type=%PRJ_CFG% . - cd build.%BDIR% - cmake .. -G"%PRJ_GEN%" - cmake --build . --config %PRJ_CFG% --clean-first curlpp-0.8.1/conanfile.txt000066400000000000000000000000741305746442000155320ustar00rootroot00000000000000[requires] libcurl/7.50.3@lasote/stable [generators] cmake curlpp-0.8.1/doc/000077500000000000000000000000001305746442000135775ustar00rootroot00000000000000curlpp-0.8.1/doc/AUTHORS000066400000000000000000000004251305746442000146500ustar00rootroot00000000000000Eric Lavigne (erlavigne at wanadoo.fr) Jean-Philippe Barrette-LaPierre (jpb at rrette.com) Thanks to some patch providers: Thomas Boutry Jonathan Wakely Peter Krumins Ben Golding Glenn Hoef Jan Gisle Vanem Paul Lacy Nicolas Le Goff curlpp-0.8.1/doc/LICENSE000066400000000000000000000020731305746442000146060ustar00rootroot00000000000000Copyright (c) <2002-2004> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (cURLpp), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. curlpp-0.8.1/doc/README.win32000066400000000000000000000264321305746442000154270ustar00rootroot00000000000000Read the README file first. As of version 0.6.0 curlpp has been built and run on win32. Information contained in this file does not apply to cygwin builds. curlpp has been tested on Microsoft Visual C++ 7.1 (2003), (by Giuseppe "Cowo" Corbelli) Microsoft Visual C++ 8.0 (2005), (by Andrei Korostelev) Microsoft Visual C++ 9.0 (2008), (by Piotr Dobrogost) but any modern C++ compiler should do the job. BUILDING CURLPP WITH MSVC ------------------------- BUILDING CURLPP You can build curlpp in three different ways A. from within MS Visual Studio IDE B. using msbuild tool and solution files C. using namke and makefile A. and B. In case of A. and B. first you have to create solution files for your version of MS Visual Studio. To do this use win32\create-vc-solution.bat batch file with one of the following parameters: 7.1, for Visual Studio 2003 8, for Visual Studio 2005 9, for Visual Studio 2008 This batch file needs sed to be run successfully. You can download sed for win32 platform here http://gnuwin32.sourceforge.net/packages/sed.htm A. Building from within IDE Choosing configuration Choose configuration you would like to build. What configuration you want depens on three aspects. 1. Weather you want to build dynamic library (dll) or static library (lib). Choose configuration with DynamicLib or StaticLib prefix. 2. Weather you want to build debug or release version of the library. Choose configuration with Debug or Release infix. 3. Weather you want static runtime library (RTL) to be used by curlpp or dynamic one. Choose configuration with StaticRTL or DynamicRTL suffix. Names' suffixes of output .lib and .dll files depend on the all three choices. MTd - dynamic, debug, static RTL MT - dynamic, release, static RTL MDd - dynamic, debug, dynamic RTL MD - dynamic, release, dynamic RTL staticMTd - static, debug, static RTL staticMT - static, release, static RTL staticMDd - static, debug, dynamic RTL staticMD - static, release, dynamic RTL We will refer to these suffixes and types of libraries as "build category" further in this document. Setting include directory If you are building curlpp using the original directory structure then you don't need to set value of user macro CURLPP_INCLUDE_PATH (by default ".\include"). If however you modified the original directory structure you have to set value of this macro to the path, where you have curlpp source files. Setting output directory The output files will be placed in a directory set in CURLPP_LIB_PATH user macro (by default ".out\lib"). B. Building using msbuild Open a command prompt and change folder to the root of curlpp tree. set LIBCURL_PATH=/where/curl/is/installed set OPENSSL_PATH=/where/openssl/is/installed (only if you have libcurl with ssl support and ssl installed) msbuild curlpp.sln /t:Rebuild /p:Configuration= where is one of - DynamicLibDebugDynamicRTL - DynamicLibDebugStaticRTL - DynamicLibReleaseDynamicRTL - DynamicLibReleaseStaticRTL - StaticLibDebugDynamicRTL - StaticLibDebugStaticRTL - StaticLibReleaseDynamicRTL - StaticLibReleaseStaticRTL Output files will be placed in a directory set in CURLPP_LIB_PATH. Any of DynamicLib* configurations will build a .dll library file and a .lib library import file. Any of StaticLib* configurations will build the .lib static (inline) library. Any of *Debug* configurations will in addition build a .pdb Program Database file. C. Building using nmake Open a command prompt and change folder to the root of curlpp tree. Run nmake /f makefile with the following parameters BUILD_CFG=[dynamic|static]-[debug|release] RTLIB_CFG=[dynamic|static]-[debug|release] LIBCURL_CFG=[dynamic|static]-[debug|release] All options are optional. Default for BUILD_CFG is dynamic-release. Default for others is the value of BUILD_CFG. Edit the LIBCURL_PATH or set LIBCURL_PATH envvar! NOTES Linking with libcurl All versions of this library need libcurl (c library) include files to compile and lib file to link successfully. To build curlpp you first have to set value of LIBCURL_PATH user macro to your installation of libcurl. This macro is used in the project file for VC9 to find include and lib files of libcurl. Steps to set user macro. Select View/Property Manager, double-click curlpp property sheet, go to Common Properties/User Macros/, double-click name of macro you want to modify, modify it and click OK. Filename of libcurl's lib file should be in the form libcurlX.lib where X denotes build category chosen for curlpp. (see Linking with RTL) If it has different name you have to change .lib filename in Project properties\Librarian\Additional Dependencies (when building static library) or Project properties\Linker\Input\Additional Dependencies (when building dynamic library). Linking with static libcurl If you are not going to use libcurl as a dll and you would like to include it into your library/executable by linking to static version of libcurl you have to define preprocessor symbol CURL_STATICLIB. You can do it in Project/Properties/C/C++/Preprocessor/Preprocessor Definitions. By default all StaticLib* configurations define this symbol. If for some reason you would like to build static curlpp library which links do dynamic libcurl library you have to remove CURL_STATICLIB define. Linking with RTL You have to link with libcurl which uses RTL in the same way as you are going to use RTL in curlpp lib. Refering to build categories defined earlier in section "Choosing configuration" both libcurl and curlpp must have the same build category. If you are going to use dynamic RTL in curlpp (MD[x]), use libcurl which also uses dynamic RTL (MD[x]). If you are going to use static RTL in curlpp (MT[x]), use libcurl which also uses static RTL (MT[x]). You can use debug build of libcurl (MDd or MTd) in the release build of curlpp (MD or MT) and you can use release build of libcurl (MD or MT) in the debug build of curlpp (MDd or MTd). However you shouldn't do this. Building self-contained version of the library curlpp is mostly a template library. For this reason during build of it, only non template entities are placed in the .lib and .dll files. Most of the library's features used in your application causes code generation during compilation of _your project_ and the code is placed in your executable. This is often not desirable. If you want to build the curlpp as self-contained library (one which has all code called by clients in its .lib and .dll files) you can define preprocesor symbol CURL_SELF_CONTAINED. In this case curlpp uses explicit template instantiation (all such instantiantions are placed in separte .ins files) to force generating code into .lib and .dll files. You have to define this preprocesor symbol during build of your application to avoid including templates' definitions as they are not needed in this phase. If you get linker errors connected with curlpp features when using self-contained version of the library it's because there are some missing explicit instantiantions. Please let us know if it happens. Using curlpp in .NET applications If you are going to use curlpp library in a .NET project you have to use dynamic RTL. This is because all .NET applications must use dynamic RTL and if your application uses curlpp, the library itself has to use dynamic RTL as well. Additional dependencies To build examples (and your project as well) you need the following Windows lib files to link successfully WSock32.lib, Wldap32.lib These files comes with WindowsSDK. Macro $(WIN_SDK_DIR) (by default $(WindowsSdkDir)) is used in the properties sheet file curlpp.examples.VC9.vsprops by VC9 solution to find these libraries. Linking with OpenSSL If you have libcurl compiled with OpenSSL support and want to have support for OpenSSL in curlpp as well you have to set value of OPENSSL_PATH user macro to your installation of OpenSSL before building curlpp. This variable is used in the project file for VC9 to find include and lib files of OpenSSL. Steps to set user macro. Select View/Property Manager, double-click curlpp property sheet, go to Common Properties/User Macros/, double-click name of macro you want to modify, modify it and click OK. You have to link with OpenSSL which uses RTL in the same way as you are going to use RTL in curlpp lib. Refering to build categories defined earlier in section "Choosing configuration" both OpenSSL and curlpp must have the same build category. Filenames of OpenSSL lib files should be in the form libeay32X.lib and ssleay32X.lib, where X denotes build category chosen for curlpp. You have to add both this filenames to Project properties\Librarian\Additional Dependencies (when building static library) or Project properties\Linker\Input\Additional Dependencies (when building dynamic library). If you need OpenSSL for Windows platform take a look at http://www.slproweb.com/products/Win32OpenSSL.html If you installed OpenSSL downloaded from the above link you'll find .lib files of all four build categories in the /lib/vc directory. Building with support for Boost curlpp has ability to use some features from the Boost library. If you want to build curlpp with support for Boost you have to set value of BOOST_PATH user macro to your installation of Boost before building curlpp. This variable is used in the project file for VC9 to find include files of Boost. You also have to define preprocessor symbol HAVE_BOOST. You can do it in Project/Properties/C/C++/Preprocessor/Preprocessor Definitions. Project propery sheets All user macros like LIBCURL_PATH, OPENSSL_PATH, BOOST_PATH, CURLPP_INCLUDE_PATH, CURLPP_LIB_PATH, WIN_SDK_DIR, CURLPP_EXAMPLES_OUT_DIR, etc. are defined in project property sheet files named curlpp.common.vsprops - options and macros used during build of library itself and during build of examples curlpp.lib.vsprops - options and macros used during build of library itself curlpp.examples.vsprops - options and macros used during build of examples Compiler warnings There are a few kinds of compiler warnings which we haven't managed to remove. warning C4251: class X needs to have dll-interface to be used by clients of class Y warning C4275: non dll-interface class X used as base for dll-interface class Y warning C4512: X : assignment operator could not be generated warning C4661: methodX : no suitable definition provided for explicit template instantiation request BUILDING CURLPP EXAMPLES Your can either build the examples from MS Visual Studio IDE or from the command line from within examples folder: nmake -f Makefile.msvc all or nmake -f Makefile.msvc exampleXY to build example XY Giuseppe "Cowo" Corbelli, cowo at lugbs dot linux dot it Andrei Korostelev, andrei at korostelev dot net Piotr Dobrogost, pd.curlpp.org (November 2008 - March 2009)curlpp-0.8.1/doc/TODO000066400000000000000000000003131305746442000142640ustar00rootroot00000000000000- Need to fix the OptionList::print function. - Need to put WriteStream and ReadStream to be exception safe. - Need to put WriteStream and ReadStream to be exception safe. - Get rid of example 18 and 20 curlpp-0.8.1/doc/guide.pdf000066400000000000000000002720001305746442000153700ustar00rootroot00000000000000%PDF-1.4 3 0 obj << /Length 1612 /Filter /FlateDecode >> stream xڕWK6WV%}lHPA(l%Cw^caW3p8w7yn*Ro, ˸(7Oi bu<l(Vg;5){48 4פ(l,L}lͰ™.T LSnI%ɶHO@N-ްI0eaYf 4CK5r@,t}:Fth6NcRFu-+c 8{EL~io.*XL*UH@ U x"GhZWO28v|B=䊡a∡=/ٚo4ls"]#ƤFkBQ@ZmNx}DIHH  &<'P0ئINO%ӡ%ߡQ~j'+r;|  }< D߾]gI%2,(Xo/G ୑,0-+жcz9s;})}۷e&%[\Pqz \R@d 1g > endobj 1 0 obj << /Font << /F16 6 0 R /F17 9 0 R /F21 12 0 R /F22 15 0 R >> /ProcSet [ /PDF /Text ] >> endobj 19 0 obj << /Length 1665 /Filter /FlateDecode >> stream xڥَT=_aqݼFF*tR!$f/M9ux=>WRxBJw(o|u4Uǃͷ0Q{ǦjTu?imRҵk¤3ʏ|>z;ܢu (ZT{ոuLpnH6e|صX{[vPl QzvYty,F%ȹ˵rƼ+,1 ů K%aDc/S&F*OKI fxiGi5v'@g2o:vʞb"1˞OelrX #2*KR{#: ֓/v%<x(pQ"EC !OHwj}8n_0bB1E =cr,2xy#r#랽 #4(:؍?MM_/i}7UcZ0A@K$Af9ŅpI BkH oP)pz o "̯˱KRI!~^>4 9!}֚3U&;e8NE@#P5KAo.o(̓ݎn!:J ѸqKZݼ~C[jx:^"P%ŧF+Mҵ 4ݹm '˯/Lj\~ 䶴{;Xv_/#q79No\;=[:͹sV?mV#Hf24R^Q\}yUYE ?5 .Q(LzJVNV_,3`%q0'H|"I`o6HzYŰpia, {tqbr1UΩ;rƙ SavRˏrhgS|Ahwu&4 0,bo/_2bĪ- L)(O*6!jS~ ps?Pi`Oetj2xH"H^qe3 PJo# "G]ecD$O]۝̾T̑](5EJS熣67ut/+C~ ٜW8`OHC.6RڠQIfq+*endstream endobj 18 0 obj << /Type /Page /Contents 19 0 R /Resources 17 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 16 0 R >> endobj 17 0 obj << /Font << /F21 12 0 R /F17 9 0 R /F24 22 0 R /F22 15 0 R /F7 25 0 R /F8 28 0 R >> /ProcSet [ /PDF /Text ] >> endobj 31 0 obj << /Length 2013 /Filter /FlateDecode >> stream x}XێF}W Cn Cb^+")oj 5E쮮:ui{[knLIfovcH&Y|kp5AL?ƦO78OQ?dgߚefkmhda?l$ )hvo8mHb|亽kѱmgv$Ҹ `8p |b<(ۓ^!{|*zAК4 8Xk:U0FGw8U 1^zYh$_e=j9.n*$ /e72r'~l QaX7j4/} (ٻwN#PݱWytGmhlAEO 4Cν9rڡ,Ʉ<{B"?"⥂ՙZI֞I2u>Y~! .xx2>2Fx7o'aєގgB@k; cJ\&$+`t ֿ&u~o9狣?4BSH MbJ02R~Cwm/E6^C 25'{G'm&uɭcH"R'W}TTp<;2muc%C{vcG\3=" Oaq(q>YUxJ1@AW0`"(&00π?n@-xLdCz yèӃڴ0 my^_ ,-fAH&@n9Hl:UbRc4IB ) |(fEa[y$) }Qd^¢ȼUiH^xfj4}JԲ9ISj3|22)3%{5Ym''#Uw/{1䟴ZDvE550]xN褢s^U22/TZT}]tPC=*¸44F;Zzݫ-4endstream endobj 30 0 obj << /Type /Page /Contents 31 0 R /Resources 29 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 16 0 R >> endobj 29 0 obj << /Font << /F21 12 0 R /F17 9 0 R /F22 15 0 R >> /ProcSet [ /PDF /Text ] >> endobj 34 0 obj << /Length 2187 /Filter /FlateDecode >> stream xڭXK۸WLTv!ieg7\V6YPcקn8Tj '~ڽ{"I›F(ɂWQ>ff.ǍffWMco7]. DMt=Nw_.MI@?%$XQ(KkWR+2_[w/WaʘT4IÛ8NrnH5g3TuEe^[FE"+s. 6W[(gvt7.M{E*jJCw)qG9D{A7kC\S{@QM㈲n^( dCbGp-+`'q~;W7PPù"[ .s?fBCd!L| 5g9~FDa>~ײdbh@ɹB¾MNzЖE0vkPi$#n=kF{-ounT*'ti;bZw'Ұȱu5Pȱ䰊m$L`-4 G=JN, ZQ(x0vP -UusZ0sv!pcIĴ  q^m#1w-)ڟ#fL6<\|rZ݈QFгg 5OSWl(pjh&+g3tA QNSˆȐ.ĒZcAF9B!Y2af`K4= uXY”J$Cs,-8l4dSKS3mǹ )!W:;&;'*KUS=$bt2( ՈcGTW@Q)C|ŋM5&`$G߼h2 Nibp-`. WیN͑zMF#Np<:io5MtFB6WQ朓bTʢ? .sfxϮV a|q1>~8gIEC?Jwo?vɊw[ALi>2 A9ư@(G!$=tv¦@Q0HZ: lk%UPRsc]q"ìnmSV$jCEx"G'[[O tPj k$*JYO~џ._37JiUϳ"֜r*:$=›=d>ae/ljK bU᭦*Hz )Hr,ѭ$Ӓ.It E'V4r\쎓]?rU!d$p$6PwҒ*чcm@el+(g}Bayd߼I$u߯w%>L+Hza{!ԏC)=B@QD=l# !yŒq$%K92x:N9Ҁ/(If㘚^]4mv'%[^d5g'w1ۗciM4_FO@dэ}b%lO/KgC{NDb[y=~V"+4r*8Sj\Hܿlݔk$ˡ>bu:N;CXBGB=N}Ft Z2B9Δ`l1Dy Ij_v. {f`y/VqZsb7\CL`eoZJr bj 6&<)=?HCc'*[D(&$`R}֫$֕sS@ƿn]Jg]7uAuKeqħ} 5Q uf°ˡS߁,݁WNkY-XW/53֘{=9S4l^VnKWg(q?8{gO+IkK%R溂V|b"cix$aVfxފ{FpFa4MS/CuB' ΓecW eLғBQL~N}\Wow cendstream endobj 33 0 obj << /Type /Page /Contents 34 0 R /Resources 32 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 16 0 R >> endobj 32 0 obj << /Font << /F17 9 0 R /F22 15 0 R /F21 12 0 R >> /ProcSet [ /PDF /Text ] >> endobj 37 0 obj << /Length 2181 /Filter /FlateDecode >> stream xڕXݏ4_qYM:T ] z/X%mgMr|Nfﱇ ৾uw*]1O8ίaGyԵ4OT~ֿNǛ?§_I)N@E>MGi}יrz#`J{fblvWYq}Ḹ 0ñ@}="ŽmPtlYd~ 3(˂ Qt n2qsa9s-D/ 2L=#pw[Yt=cM#'@y]{ uqLp4(py(NeJ=nF։w4J%|1f҅% HxR :NQAr1cnkTJ4w%8>C~{0Wt0\X&7JVL{0 X5x8ʼn9ZӭwC})6ZI#[! ДcAh DʚDw;(=lkWȲg?" sWCs  ONpz&P BVEK )x9]l\.4~*ѠBX^3mi1@?6ArLbg"ߴ>ro(AejQg혟TzOGqX< l $ (b)N! c=4z8R@(6C:P"çIq`f'Z[VJ 1זGƩ, Sn^BxEij݁h+d_wbL9Wd {}:՗FWM3Kp)ƅ `X4pPhl5.~E IU{r v:=F\55m`15[~a⇙Nwy %'>z~ȏ820y]2r࿷[ű'K}f3; fijCÌ30SHɺx-dHsR6FY&kGHX0a^SYiɇ024'AHUТ%cdnAfIѓEZ^[}˻Bi0P,El vOB7Y.ImFhHʢϕrVr; `[ '"FSzdڋao4HC'I5e΃,3?]zG:q92?QcU$ O{fTQ==W5j?oe$m ;GS!H2_C ـl B4S" g^h FĬJ$tgiƀp1{ցLԗ%EM}iñKBAN]mY &K]2 <#.C u A&O@A.!rx !<)5H{_}Q~%TVbÕBdH ʴ2~=QDYK_"6٥5Z22~GP@F]mUj _2^a≈$BGz{"nJHztqFW+X2׽$Ȑ\>˫ !vRrQMIDoC:H(![#?K~½f٩eLcKL;Okpހ_|ox]ZGorEs졃(ərC߮Xqr#;s]}Mm(@%,Ыn_ ]-^endstream endobj 36 0 obj << /Type /Page /Contents 37 0 R /Resources 35 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 16 0 R >> endobj 35 0 obj << /Font << /F22 15 0 R /F17 9 0 R /F21 12 0 R >> /ProcSet [ /PDF /Text ] >> endobj 40 0 obj << /Length 1561 /Filter /FlateDecode >> stream xWKoFW*,|+pF])Zl)!By"tվ+gJij3S* \Glwst w?ഇ ;/濮\R HG~A06kxV  1_2Eg:q;_D~DTj8PL„e}l" ڶ嚶+3d!K˦y 3' Xxsc?HȎ} LEg5[$VxR Jo9Dx2Сcw]^uf`m*xAS)ljAJ{ceCG 4(g;-˶f09"NuxL|$ ѿ*]ziJ䯦Q5$EFBL+a: 0PRKDW꽰` Aq-[<S>"(t䘇Qл6q؃ѱu̖_g/C"t>㓾ܶl?SIPI*BXn5Mw#b|c"`Vd0Jt>z6r#IX 5 19,`z{ 5*AT% J=qd(nPu?:qĩ `(j-jK\}Ӟ?j~}3 ѥ¬]C.Eތ

ŸRzڼ"$O䢄SZ\{˱ʥ@@&Ce0Te]L6аAWPG EwTyM+ v)x;>R`x&˲۷s"M, I;|"Cx"_4DC7\ Mn bga(&_=st#@[ &ڑR,y!Js#*Q~,T|ܕ`kViF0 4жf h>lӆ$͕-a쏱aI`a (R:.?rZuV!}P3PBi0(Jr LiPkZCRXͅ8NjnyGEΗv 6})"Y^B8=Jdh\Pqaw% Rqɇ`NG!^4U1u*J3PUYOOk G>`_5uZ !:@OߣB.i"H0g.k4|{I0~h:%vF. GLE ?#FΩigpѕ|HX& s/߰cT~b57›OVO>' endstream endobj 39 0 obj << /Type /Page /Contents 40 0 R /Resources 38 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 16 0 R >> endobj 38 0 obj << /Font << /F22 15 0 R /F17 9 0 R /F32 43 0 R /F21 12 0 R >> /ProcSet [ /PDF /Text ] >> endobj 46 0 obj << /Length 829 /Filter /FlateDecode >> stream xڭVj@}WA+nЇRR\(M)FZGRt1ee[mv̙Y}NK5qF2Q{F"Hf:I DY89F( Mrd7WLa$ѯYg@,qawNMfj!SEg08C50Wnkۋ-[J߆WgնѸ m0@ ˝/xY/\TZ#lf4QyeUȍ̆M^>D1a-׋u3[gm զl1|/4J} K{&N|d;(9" )B;!FKM6J,;S֋ iwJ ]n2QLY@!5( FTx;R][n$xδF&]uxO&SOwKÞb!9󚉆 A\߂LDLHf1,i%2}>Mt0^]Ͳl ]xà |;I mݙ5BZ>1ns E5Ä~O_m֣#/}Ҥϻ2[]g>^y:D [wtidHN%Wz]MO ,{AcO[Jb#mŝJH1%x[fwsX%% (MwDWtCW?n]|;J j:* i}&љwF_ĩ内agH_ڮw 7PzoX>g?bzt7 [endstream endobj 45 0 obj << /Type /Page /Contents 46 0 R /Resources 44 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 47 0 R >> endobj 44 0 obj << /Font << /F22 15 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 50 0 obj << /Length 1110 /Filter /FlateDecode >> stream xڽWMo@W\BzIT9Tm6e+׮˿,66Rz=;3t}oŪxL;MAgzw?쾽y".a5l%C1va p\ ̰~_=sNs08 iNY}GPV`l6z|7{xpsqM=qR 2ׁ):كTaX_ȍߨ!(0j,O9Q*<)IL/i4urfAEkp&Wv ]!l'Sǐ;#R Dex*]1Xyb߽*h?&дƉa7NR\\n`~R( ĺ^;jŭa\HON0m!M fX:iyR!܊aQװ*8/^ J\RdϪ^#- IT CQaO,,,S*RQuR{0lSC|oim-Fc+āR*U- 9.16N۽ 5x88J3|],!FB&(^o屰QHTԧޢ{1İ^ .o-)]*%rՄX mxg3)#Q!OO;QOV Jd)Z#9Z\1^yȻ!FODW 9xʫw~)"KstdzWK]Rqc\+lfou8v(ٶ_J#Nj|L6H)C[AޑR6l~JneAA9H}GS ٫G ZQME*d% [5V)A@uC:xJ CU53I#b ׀PFfR(Tvԫ!9p~Aa^p%nSy^knR#라җ 76-]*H$t$:Lh?d2ҋw?endstream endobj 49 0 obj << /Type /Page /Contents 50 0 R /Resources 48 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 47 0 R >> endobj 48 0 obj << /Font << /F22 15 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 53 0 obj << /Length 849 /Filter /FlateDecode >> stream xVKo@W![_KOr@(KNhfv'EE!7]7e Iu2F+x| Xq2gH+qa_иU+X+S7o~ZSܱ8_ptn^NMi=n0L 18'*uv rxJbFF"T7 s, ;DS 1PZ#="3;ВX'~.)Jr8RMqi8_c3`E!3y9p!筋(Vi[Xl֢XO`иflppV\q~s5l{eqKcg{,Kg:eZDNT* lϱld8{ՒIZ.Q.K,}R3gm} &@~DٳlmqVO`ΌK_isÝ^Ԍ놯/W[M@Ӄ@EqoJ(VijM&ԁӠÄh<trAĔ[Д{ue*>!y24zzCTIV42c זxkH#u^Y)LNpHI8g> endobj 51 0 obj << /Font << /F22 15 0 R /F21 12 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 56 0 obj << /Length 1253 /Filter /FlateDecode >> stream xWmOFί@^9^{/R*E|h*d|{϶>g־b"h<3ϬhԓR:xJDZx`(ǣAzZ1%F)r h]3sSnsw !i*zm4Vh%+js3k <+(VQoX h1/M-2OsvoM~׵!t|3 F$|X4'tdG{}h3E[oYyZrIJ5&ICC.#R* _]Oy^ [e6YYXj/P<ό T"r(t\Ox31anΧOm7xi:g F.Icet?/,'WS8%NТ0+i3alKȻd癍'@:Z]:vYQ7&3ALSan**y b1'cwkjiC^,Oi^Z.VK+.kc'xbx6-ti5G_OkBϏ9sn%A` 9IzZ{s1{YS8tBcCi ~CIG?ъʡ&lԤ|WN5;Uό)\g"ut_K^l YW*Xfvu+Z"rY=6`U-P*e97}PY!db̸.0e뮹`B5@U{k`gkIJI10R눫zl~W5ׂ)fI{}ݬ9n_W[%w~5V<ʮӭ'e]Y _ d3jI%qչp0j3q6 E#%ϠI]?ކsٌ>0L .!Z[gڼo8! (cW ?א =0.^nl#ďOp|X`AV :+NŎ'~W1ٜ?ۮ}owm˿Rp|Z/ gONy8aF[N;Ûd?)>w n4/Ic G4/`7@Lg?GETCEţ.twN;>%endstream endobj 55 0 obj << /Type /Page /Contents 56 0 R /Resources 54 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 47 0 R >> endobj 54 0 obj << /Font << /F21 12 0 R /F17 9 0 R /F22 15 0 R >> /ProcSet [ /PDF /Text ] >> endobj 59 0 obj << /Length 817 /Filter /FlateDecode >> stream xWn@}WXʋӪ;BGJUUí( c;g!8qF!î2{f.uE͵,] 'kZvS35a؆ˊP.E BA1kkJE>|`h~*UkFpaji^vGc,Ly f yH0}l$;󑍖|c61oq>uJD8^"̍_5y[N\`@`'.'`9<w9ՍېzIKYs@8ثEp/x?'&G,evq#eQ?ih@.N^P/{y+{[E .ocIMWӅempi* D$#Ua(0l.;a eYMж^r/] X  e޸%-W?n#؊EnԤAp&Fo8)UCh1niP BT4. V ] |o\xnd뚰g\߽+&6pQ߇pN U4}IE~ ,A rH8?9'j(E易CLr|  $3$#<#zbۊ!SB7 jr6¼SnOg/xX&{z >[׻rn Xo _8ؖ,Mk#t6.y@endstream endobj 58 0 obj << /Type /Page /Contents 59 0 R /Resources 57 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 47 0 R >> endobj 57 0 obj << /Font << /F22 15 0 R /F21 12 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 62 0 obj << /Length 755 /Filter /FlateDecode >> stream xW]@}W2|)iDtm5qfk} B &/2{|Ц Ȗa b*bZM2LM/rV'dȠb& c.]?2кd]>܈~08;Q]+}$ʚY˺n4 B `C\f9 _J֘uK11G E)x? )\!I'1 ~w\(κH\R#و ӌVC=fU#-Z{Y(.)DOz6 y@aQ1\*\ey@-vw\Ïh=M)w@'OA3 yJ)}߷j= <mqoꠍN(ϯOyGXXSpW@uѱEG %0Ӿ`4#%9i9;t1 S{}hlbsS5qd}>>6 n4:`Z/"̶:tC$Ȥ\q4G޳~\!z鄼zqRטzD.L_Q\S)*ӴWtr'X˿[Gx~0򝠠zm] :KX5ZTX.+ٔovzp/ޭKպ_LQxϵMݞ/nTz)ޗɡ?,{'qw=jl!+ Dމ Z~ ѐKendstream endobj 61 0 obj << /Type /Page /Contents 62 0 R /Resources 60 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 47 0 R >> endobj 60 0 obj << /Font << /F22 15 0 R /F21 12 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 65 0 obj << /Length 766 /Filter /FlateDecode >> stream xWn@}WXꋩb&NJn0jUE4)w$8@Ye~QGЄ0=)-MI'ұZ1ښҬB]aIRaŰk1&ɼK}եmp5òLмA W )~IOЙN OO zIJ(p0ׄЭ ˴1G;r=P]Whaρ5|?ZSƀ}dZq9ƸSgLvtzbshiL0ae멾l@젿 {MmkKo02 䞲㙖l;=xV:~oנ!  /|K}p X+&3sc2c>> endobj 63 0 obj << /Font << /F21 12 0 R /F22 15 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 69 0 obj << /Length 760 /Filter /FlateDecode >> stream xXn@}W Kl*!qHUUYn# L*;g;JTur20svuDGǾKBeR4f° )|o !z''p@ ш<"6ab K>S>7EADŽ Aj.$E誡jVOX2|-$%I>Nsy{u',>ބ<ޕӏn#ןim,CB/qlI(=9;G\Wj4#>@u7XJޥ7T!/yBUȽGp,޷hvjk11M{yіnu>$!Е O'$ԓY)|pE!ӰR1U%)PE,XjC$%xѴ4+Hr gj6l–]Wm;z^Ha0CЧ}o?К:1%0%P/4.z :Qru"R3"p _K/7(3,tIy [jž]D$> endobj 67 0 obj << /Font << /F22 15 0 R /F21 12 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 72 0 obj << /Length 762 /Filter /FlateDecode >> stream xWn@}WXꋑV)ڋԋ*D"&Ɩ|}Ix;ޙ33;nw+ie  kZv^35f؆§?ɰԠ#TBkH% H!B "z'qvW*R~R}&]HzK\%D|&qqR5]MgT{oJ RݙZ $>@\-iؚ˘]^8 +XDNjrju>tFv2O重;|Y"aohߒ7L׌xPڦTv=_bO/$c xclg7rCD]n[Vܶ2 X-ReAH`T̥\TW Xn@/ܦC5fۇM/`s=T =D hџBcDGm/jQcp@J;%1i {X׆ƴxt nL0'@Pz0wx񯾻w_AGo;8vuZ6K4-YD:O+&/λg=es0r/.j(|[P^fW6ƨ_;9]0!QAjKdbp^ҫW'۽mPv.&RCpMn܀B Kl1؋Q.q,S$oϮ!uxa81Y~7e?h&skfA'endstream endobj 71 0 obj << /Type /Page /Contents 72 0 R /Resources 70 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 66 0 R >> endobj 70 0 obj << /Font << /F22 15 0 R /F21 12 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 75 0 obj << /Length 747 /Filter /FlateDecode >> stream xWn@}WXꋑxUĘ`  QcRKĶ,_93,6  %/<]GU%B0TN%7iXR+D35N~}Y`1 n1<=eaT)Ä2c,|tm'h ͒DWthqa卶1"-(~nNP=[J * 8r?EY=t N}YCʂ|XccNM>Z.VFߝ&'\gͅ ˱Cu {9 3cL.XY3&!Q"(da+;|# tUԌ%`Ga d{}._ā~%ri| 9m#9qOz\9rVy*RCY@s?Q+D;s(%)`*ypp'PyTϝty1* BΣX9[d/]"n.ݓ]ԥ#Z;iVZNZxC芦Z&FL=q:=endstream endobj 74 0 obj << /Type /Page /Contents 75 0 R /Resources 73 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 66 0 R >> endobj 73 0 obj << /Font << /F22 15 0 R /F21 12 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 78 0 obj << /Length 698 /Filter /FlateDecode >> stream xXn@}WX-U1"TUpiR@MwT\!}9 9{vvֹL[axm*Bk)n2t̾NfN0,4:mDlM>Fy&\%I K]xN^(4dCz.,òlzK{x_ 1a8= ?Bd!lx~prwpXhI4] CVn.T(t8jtmuB/A6ڦp5)]tևpÕ (iq x&0>W8'E KX[PF` "mWsypNQ$+Q2\ۂB [Px ;Ld/0Nv2ss> endobj 76 0 obj << /Font << /F22 15 0 R /F21 12 0 R /F17 9 0 R >> /ProcSet [ /PDF /Text ] >> endobj 81 0 obj << /Length 1288 /Filter /FlateDecode >> stream xڍVێF }W-c`h.mIEۤMuVBeɕl!ew!}s!9r^0:: QiBm*+,Sjwc+ƪۏ?vs&au u|<.{"fuJby&HHH_Ԙ'Wwl +hJй8c{Z}{ZL#/o r[1 ozeoNMCc\>V6sk6p,c#֨{H2kDv[-tzۈ&sr_Iare2=G߆sF}L'o~$Skz80K3++: Q58jj\ Uodn1fjS#"u#m}/[qE> yz\QNJ2zoF+FN3;}*SV /mH9%99&< %8 6"EAjn7-e'slXϙ\U0[|l(ZJ<`I"țYyC]w3hy. G_"9Uֲ/C7i`աMṞ'f.LFl1E*i0ιw;&ׁu7(;T+CSM,[,;KxEX/:Qj RV?muz8V¥^`3i/fqyT̏r~=s`ik'c5kF\#JBkj& m'`8'w/ZkUizԇgD."LNx U@4IxWr7a#[pmɡAT@!} ,Rq,5̴H{fU\GBSH"'e.]4>)]4`B8;ՙQm71wә/1`zyJ/{&!ӗ$#ۿA{ EA!*{P v ڄNSf*WgKM5oCTtԆ&Me$&DKb7/éZw><\=RFhpH(!,?h"H־?&v6i,N |JuvjEDendstream endobj 80 0 obj << /Type /Page /Contents 81 0 R /Resources 79 0 R /MediaBox [0 0 595.2756 841.8898] /Parent 66 0 R >> endobj 79 0 obj << /Font << /F21 12 0 R /F22 15 0 R /F17 9 0 R /F24 22 0 R /F7 25 0 R /F8 28 0 R >> /ProcSet [ /PDF /Text ] >> endobj 42 0 obj << /Length1 893 /Length2 2959 /Length3 532 /Length 3583 /Filter /FlateDecode >> stream xi<}dzd[(Bg2RȖ5Ke+i 03DH, e:!BD,Y,QRDz>y9qV6EАD*"Z B@(dEő'QTP @hj"]o,Zp T'yqX7* /C@2"(H{QxƁT%@ $%(`ph*pP؏D&DWgw$SzHYC" Yw$~77-P?_}KA"xzSA2`N€dҳA Λ{ׄкD,Jp?8!Xh7? {~思q07k?V(j ?ӇDp%8A߿̀&apD,Pd2 [)GĀ~GO S"#}2A+ U&3QItBa/p  ]L/H?K 0P{zz$E$BPWM&D_G(h0 }=&(^i#ҴOiiHweUmFF7=_6 dFH;ndO:j8pQ"eӼD rK|bl^D碇uN_D^TN(yNk߃tvnF_ 4ćIYW ?eV#dv U<&pqojZ{t?j۲AZvI 'ƎtTFSz-uǿ#d> SDɲxPGm]EBEQG{''RTzԅڸLE< ZIA_qEMf_dyof;䦐6YϢ=\Zpj6Zma: UZW`} Dޫ/}VݻY(m<be] K\.ӷ5g pL(ݽ3h}̸%8S~ђ<8ߚj3)1}(:H-vEt|3vkl(`)7~P/&`B|뜮O$Wm(Y f ytۋo'DD-S|\:-w_|Ghv]gӢ*3r-oY]Zr٤ GFHk8/7SFہ\g~愘fNu=Zu|7-"zcw4laSU|4>>g%H.-)ܝhj&le3hhB̹ )J6Obt$^KN谽# m)\dt늨?ǹ#sMVdք|+q>fX:EI /P;6jOW"-9 ʅᓓ@) =qƔf^U tlEN͂w&wSb2Y \&.&Y.3(kO v^XTzۄF1'4w[}vK1 ֏*)y9ƍbUl~,kabhlK6=1؅Z =Ӎ $}"3}ʛ $y ]y\b{v;p|`O֛RGd0O6bէ&`^`TZgQdF!G4r5kᴾih~EaT3T-URȸsɆNiYTe 7 w~,]+:)_6f%7pPxgRdNZDt+}ZI)k~y rAxxJ0iMs~23MwնQkRgenX~Pqkmif*KfNa:Z> endobj 41 0 obj << /Ascent 694 /CapHeight 683 /Descent -194 /FontName /VZFYGR+CMTI12 /ItalicAngle -14.04 /StemV 63 /XHeight 431 /FontBBox [-36 -251 1103 750] /Flags 4 /CharSet (/E/c/e/i/n/o/p/s/t/u/x) /FontFile 42 0 R >> endobj 83 0 obj [663 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 450 0 450 0 0 0 300 0 0 0 0 550 500 500 0 0 400 325 525 0 0 450 ] endobj 82 0 obj << /Type /Encoding /Differences [ 0 /.notdef 69/E 70/.notdef 99/c 100/.notdef 101/e 102/.notdef 105/i 106/.notdef 110/n/o/p 113/.notdef 115/s/t/u 118/.notdef 120/x 121/.notdef] >> endobj 27 0 obj << /Length1 1255 /Length2 7098 /Length3 532 /Length 7884 /Filter /FlateDecode >> stream xeX붮+w^X'SBq(ZHCN šEO:^k_I\_i5u8Ζg'wNn.n67`22 Pg'9 w[X_?"|"<Yg"H A,jGx+ vphІA`0&77 rXBlNߖ.^,dM|`5&P> ?+x88[8n;lugGw Y75U%w uSzCPw+[/ xrYj?5g=kM򟮿b 02,y'+g0/,|0N?n @ᆁ\N-x&kgZCk!0 l-@ b_?@+gGG~$ [}!0FnBpO͖gXAp?m@P?S ܄wm8#t6@ ?>@ ?ny6@ bgo?N~n ;HapUi#¿ r o¬h]zSxy|x MsΩ$D!Wzʬg8(4^wnZ ǯ\3fv=w|?Re]~mk8GԘ\.O1,=^"LeЕ& h񺞉V/õMv/{ajB=Q_V8/7Et &dʣTt@&t N.P _L $ZUW:ݐY71ҜWTEHjUJJI]W)acJDyl~z j2uyTOݶ,C~eG#y/h)z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g~7HKU3)kvmA_AP:NtTJ93Fb95K{Z&']|C3Y6EfT(tZb*!eΫqT⠡#  2}̳rvBn~#F]Fĩ9VtY)n5QP  ȼ•1v 0"Dʦi?_{)*>WM5CHxr4*ZG|Fͯx HI`oހfgBS Lh":ěEgnHϬH];HXqRV֮o, X$pv\f* NGȞhݯ-ЇĄ.^!%/ۦi }y1q4wuUj}T 93y&k5oũy4롥QD1J׋=C5Ov8A4TS!$V2Z]g;:`Ä!M& J+/*5{N^ahgskxYϟο*c+n3E\[ݒaIZaFc"ym#a9ޖ3#Z_Snε eG&O Ftfط a%)mtEOC9/(C"gϽFپbI(ȿh9z ]H.?LD*;\̍avu4D2Ke<9tݤ6=+e `-% 3CyGv~V> endobj 26 0 obj << /Ascent 694 /CapHeight 683 /Descent -194 /FontName /RHRTYW+CMR10 /ItalicAngle 0 /StemV 69 /XHeight 431 /FontBBox [-251 -250 1009 969] /Flags 4 /CharSet (/fi/quoteright/parenleft/parenright/comma/hyphen/period/zero/six/T/a/b/c/d/e/f/g/h/i/k/l/m/n/o/p/r/s/t/u/v/w/x/y) /FontFile 27 0 R >> endobj 85 0 obj [556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 278 389 389 0 0 278 333 278 0 500 0 0 0 0 0 500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 722 0 0 0 0 0 0 0 0 0 0 0 0 500 556 444 556 444 306 500 556 278 0 528 278 833 556 500 556 0 392 394 389 556 528 722 528 528 ] endobj 84 0 obj << /Type /Encoding /Differences [ 0 /.notdef 12/fi 13/.notdef 39/quoteright/parenleft/parenright 42/.notdef 44/comma/hyphen/period 47/.notdef 48/zero 49/.notdef 54/six 55/.notdef 84/T 85/.notdef 97/a/b/c/d/e/f/g/h/i 106/.notdef 107/k/l/m/n/o/p 113/.notdef 114/r/s/t/u/v/w/x/y 122/.notdef] >> endobj 24 0 obj << /Length1 751 /Length2 1203 /Length3 532 /Length 1759 /Filter /FlateDecode >> stream xRiXSWQ#j"! Y$hQYR $1 qHEQi-+"";(" H3̯y?l"x"O!6 #¯(DD77"tW7:>H&P`0G/$9l!c `!T^|>;$H q8"pa bxXs+Cc+}j%C$L:"e \.s0P)ق9y,u/G$($~ Rà .,,l>!@X('ıI|rb);]25Y2b22iA-̗y{fGcFT? Pɞl&F f\RQpU@?Vݎ䚺 *-d[:xbI9/Ũ⾶t^eGUYGf#^sp_?4AM=ZYkwZ?CБn 9 ˕bU{}Mn} |-:`9}Q;G[ទ\VoʮH}B<,RNP0l/վu)0ξUZ93cVHޙw󴎷hҷǭ^ "/vsN!Xvk)L&9w=un Rx2;eӌMݭ#mkLR !݌>}ZrڡA^߁?<:aQ3/<}mQg6n+5PyVk6ff6:Q՗e5fS߭e4G=!MO<ҩJe/Z_lf И͕ ovm<0{ӖyMl YMN IV{ _lX^ j˽UeEd;*B遥Gs&c%^l K0eܝ!6(BS eeE|=΃7Hro)}6;OjiuK6-EKMֲ)O,;מ]Ψlue٦Զ4_,#ajv8eÚ{oۃgꧦ+͘d3̥Sk1VTg 7i\p Ѡ7N.&m{P.TElx6zcECڱ=mߴD J͵.͞5tYtb=5,YQˉSNӊT{)|]>ud΄TeаvCx{m̥aiu[8j@T?KzǮڑKJ'S`)Ɯ=p/?!Cl1❸8endstream endobj 25 0 obj << /Type /Font /Subtype /Type1 /Encoding 86 0 R /FirstChar 49 /LastChar 50 /Widths 87 0 R /BaseFont /MHQBXR+CMR7 /FontDescriptor 23 0 R >> endobj 23 0 obj << /Ascent 694 /CapHeight 683 /Descent -194 /FontName /MHQBXR+CMR7 /ItalicAngle 0 /StemV 79 /XHeight 431 /FontBBox [-27 -250 1122 750] /Flags 4 /CharSet (/one/two) /FontFile 24 0 R >> endobj 87 0 obj [569 569 ] endobj 86 0 obj << /Type /Encoding /Differences [ 0 /.notdef 49/one/two 51/.notdef] >> endobj 21 0 obj << /Length1 751 /Length2 1206 /Length3 532 /Length 1758 /Filter /FlateDecode >> stream xR}}~doc 1ThLlQ$}}Gb a ub !@(RncfmcN#ƏP!sd <,`aHM ^+' @PH4l!B`dbc#j!\@;;aH4@\;FN֊;ĝ['2MŃ1_$pq ]K>Zs8*d!0 ~,g8 xBv(ZPZDlL^n. W_sQO4+UL&(OP4H|vkڋ1`A,gE @Q"PPLHD$ᤕ4& W#Urpbؔ ҨT`iA7"[*\"O 9BP&=ymNV$-T%c-%"wGa.Tl40 9γ|qqxAL1;K) ك}#]9:^~Y篊O27ŵ7 LP3j~DEypjNp$!,Yp ,R[(U:D-gq#&\74qi}YAf>ow6E[e3ڢJ]%FzM::r8)_LT-/:.{\"aփ=_8d$u󸧭Ǿ1[6~_J¯ܪ qǼ"HKҮiTu*O[;(wGNڱχT&A4{G*ԾV^;NbF {7rwhS^(`3u:*ϴŷ<]{\j^3B҃ys^Fgsw@CO2IcfǑ:P?73sK37Lh~`&˝?N_*ozcG_<{{:V/SIQf_n[g=áo%viǯ~]& dM([ɦtohHZ*$61jBdVssTǤ.  b'5[msxЭ}q\Vy?k>epʬ(.Њ4*[]kX\24$uW^VrHUj/&Zzg/Rj?Ϯ35$wOĻzlj0թTi)! TVpv%Ueʨu@(S3EA-z}!seDmOJv]I*r1.Dw^~n06xxR}<"eYo;zڜKz'Jߍp.o0{vx∲rSIT .[[ߥx2 TNc(|}H`̇7还-^^pjq͊5癇/4&&ю+;:>iů ߍw/͂{wn /7} mdCYK`6Sz<Ҵ.'…Rendstream endobj 22 0 obj << /Type /Font /Subtype /Type1 /Encoding 88 0 R /FirstChar 49 /LastChar 50 /Widths 89 0 R /BaseFont /WXRMHG+CMR8 /FontDescriptor 20 0 R >> endobj 20 0 obj << /Ascent 694 /CapHeight 683 /Descent -194 /FontName /WXRMHG+CMR8 /ItalicAngle 0 /StemV 76 /XHeight 431 /FontBBox [-36 -250 1070 750] /Flags 4 /CharSet (/one/two) /FontFile 21 0 R >> endobj 89 0 obj [531 531 ] endobj 88 0 obj << /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;5aT{5/?=dwԀt> endobj 13 0 obj << /Ascent 611 /CapHeight 611 /Descent -222 /FontName /LLFQEG+CMTT12 /ItalicAngle 0 /StemV 65 /XHeight 431 /FontBBox [-1 -234 524 695] /Flags 4 /CharSet (/exclam/quotedbl/numbersign/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/eight/colon/semicolon/less/equal/greater/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/braceright) /FontFile 14 0 R >> endobj 91 0 obj [515 515 515 0 0 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 0 0 0 515 0 515 515 515 515 515 0 0 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 0 0 0 0 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 515 0 515 ] endobj 90 0 obj << /Type /Encoding /Differences [ 0 /.notdef 33/exclam/quotedbl/numbersign 36/.notdef 38/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four 53/.notdef 56/eight 57/.notdef 58/colon/semicolon/less/equal/greater 63/.notdef 65/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z 91/.notdef 95/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft 124/.notdef 125/braceright 126/.notdef] >> endobj 11 0 obj << /Length1 1528 /Length2 8949 /Length3 532 /Length 9829 /Filter /FlateDecode >> stream xUX]Ҧqw!"‚ ܓ-g'}eU?zkԨƘL2bE:!S;c3=7@DNXDψ@F&4r5rrB.fF;7 +7+@@)B@hibd 3rڀbYTL,!kk_;@'+Д `ji 0["0H/\N Q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gok&k)B6 &'M'@\D![M`VQewB^epŮ[wwJT>Ҏӫ "%CҚr#4z? 1ZA$\|Y)ͰR~Z],KF *Dzk{ћEJ_UO[֕?3ޏK-@!:Cos(la`%jz8[k]::u셉@nqLe'f"%%j(iv9 Z*bOqgԾ*Y2>x[]B;L+Ś9}&['ue "'eGĮʰw?ʊ' g#|n*CYqVY{0CRL+ T zkpÄ]kF'҅Z k 8WSDuRJS19*!Ӕ0*n,sW*JuN{#,,sqK~1G.(Bݢw (_C\k]uUFTLm#sk .N-~絓Fo5*{x6:^۫׎0 s34|!m}\GT_?JK#2#uR]#(Z Cd| 0d7p<ºtYTضҢ " qܚ2:DI_a^ Ҟ*n-kK ;GC|%1 p$R0|"Gr{pz00a9Y /Hlw]!֏h.Hz.׎uNXoM F'ׇ:(k~EN0|(1KYdL} F'a=m,xfI:V\=KI[H^l6S$uRװl‘\7ɛ`=uo2 00yzObq{2܏P;;{cEXsEQ-˳X9Wl*!~fPU O-WŃ2zw'P|xD%۶]y,zQvɥtu4'OCZ>5#\Bxxl6o؟ǼШZVK JZo\ ۥȤ,q&$,yRlx9@f?!O09:9~B_N}endstream endobj 12 0 obj << /Type /Font /Subtype /Type1 /Encoding 92 0 R /FirstChar 46 /LastChar 121 /Widths 93 0 R /BaseFont /UDYULS+CMBX12 /FontDescriptor 10 0 R >> endobj 10 0 obj << /Ascent 694 /CapHeight 686 /Descent -194 /FontName /UDYULS+CMBX12 /ItalicAngle 0 /StemV 109 /XHeight 444 /FontBBox [-53 -251 1139 750] /Flags 4 /CharSet (/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/A/B/C/D/E/F/G/H/L/N/O/P/R/S/T/U/W/a/b/c/d/e/f/g/h/i/k/l/m/n/o/p/r/s/t/u/v/w/x/y) /FontFile 11 0 R >> endobj 93 0 obj [313 563 563 563 563 563 563 563 563 563 563 563 313 0 0 0 0 0 0 850 800 813 862 738 707 884 880 0 0 0 676 0 880 845 769 0 839 625 782 865 0 1162 0 0 0 0 0 0 0 0 0 547 625 500 625 513 344 563 625 313 0 594 313 938 625 563 625 0 459 444 438 625 594 813 594 594 ] endobj 92 0 obj << /Type /Encoding /Differences [ 0 /.notdef 46/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon 59/.notdef 65/A/B/C/D/E/F/G/H 73/.notdef 76/L 77/.notdef 78/N/O/P 81/.notdef 82/R/S/T/U 86/.notdef 87/W 88/.notdef 97/a/b/c/d/e/f/g/h/i 106/.notdef 107/k/l/m/n/o/p 113/.notdef 114/r/s/t/u/v/w/x/y 122/.notdef] >> endobj 8 0 obj << /Length1 1902 /Length2 12688 /Length3 532 /Length 13736 /Filter /FlateDecode >> stream xUXͶpCpii5H 8C4w !&J/Ϲ:inz̪xgͪREU $vc`H*qp8Qhi%]@n6`)S7 C@ ndp r $]l LH8\lMES7kd sS{ ͛ aoP W`CXؘ@V6`?Br`KG߿N=rqH #`D*9Br &oHeLY"_æ65 PtTmпA6{T\le;d*cPq3Xڻ-nR*RVe~kLU/Ðx9 !;Z؀! 0uq1Ftx nG,]PNȎ-7rBrA? :;,fL]@`{_QɐdNt"<5' y Ot7u}@._G0?u3Qtv58 Sf@t]!ȺH-d "! A\EA\EA\C?ɮ $dC|A?$GBn+H!N ;/ 9!D/x[;n!/H+?+ǿbO!/B_r !V! bBBϿQ߾ueA)1v1r r-7[@.q dh.sKxytt<[x޹/KF坙6t*3p1(`Ƽ˱)/pV\?kl,Oa4uHIPҙy[kܬtҡ ]wP7cǠ$p-fy*ol&H~๞oU&iq82Smw\zs+*) \.GQ`sc鯽Vqu~튌3);8BS(#%|uTH$5;~k.6Mְ 2N}Wp>8etjݞꟙ:1庰h|i*NB0;M> fګcD"Yz=QM`ԹO<52j(b,Abn'璓x1Y\24wY{F6GuIQwoҐ&5`ס\w ~x peruyIb"wGt$KY|=W]%c)e|&WHv5o5a@gNȖ2HR&r&+>s)&f+[\u&c}"F2e/L<3q|b:m!r]GN=M*)* C WEv@ lɽ ?[)d4bQx,_$*g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,; ~' X8=d^"ɁS'4i ׹Έ8F0NTq-|aߣb$O,`n2uqst0uC?.ydendstream endobj 9 0 obj << /Type /Font /Subtype /Type1 /Encoding 94 0 R /FirstChar 11 /LastChar 122 /Widths 95 0 R /BaseFont /OJDQEQ+CMR12 /FontDescriptor 7 0 R >> endobj 7 0 obj << /Ascent 694 /CapHeight 683 /Descent -194 /FontName /OJDQEQ+CMR12 /ItalicAngle 0 /StemV 65 /XHeight 431 /FontBBox [-34 -251 988 750] /Flags 4 /CharSet (/ff/fi/fl/quotedblright/quoteright/parenleft/parenright/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/question/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/R/S/T/U/W/Y/quotedblleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z) /FontFile 8 0 R >> endobj 95 0 obj [571 544 544 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 490 0 0 0 0 272 381 381 0 762 272 326 272 490 490 490 490 490 490 490 490 490 490 490 272 272 0 0 0 462 0 734 693 707 748 666 639 768 734 353 503 761 612 897 734 762 666 0 721 544 707 734 0 1006 0 734 0 0 490 0 0 0 0 490 544 435 544 435 299 490 544 272 299 517 272 816 544 490 544 517 381 386 381 544 517 707 517 517 435 ] endobj 94 0 obj << /Type /Encoding /Differences [ 0 /.notdef 11/ff/fi/fl 14/.notdef 34/quotedblright 35/.notdef 39/quoteright/parenleft/parenright 42/.notdef 43/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon 60/.notdef 63/question 64/.notdef 65/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P 81/.notdef 82/R/S/T/U 86/.notdef 87/W 88/.notdef 89/Y 90/.notdef 92/quotedblleft 93/.notdef 97/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z 123/.notdef] >> endobj 5 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vu2($e@赉bKTr؎yѸ)MߎQxtbH͊RFt fAR=/톋'/pG"duΤq Iя g<!ctI)nTYf,]X+{)>d17x*MOu7> _(tA<ߦoc3`䡰`2u݉/hX9ٻCB|k~vŵ-՛͏^ zKa(9~#6>p1}ORh?zLZ;5((8]g`ضSxnc4Qp.r~TV@٥od3fϜYEhL &;ݿQ5 Bc0Hrpa0y>CɘQS]_!OkOTjhGE"qZ43@۾e{3_W\Bm$4+Y$e #>=?uJ}$;ů8 މcmvu%EHަ|1?oz'w7=oObV1Q^ E^$᭛8AK0uE!3BXTAreV c3-QG7E_ o2[5YX=WMCIň.ճW֘0ǫKb0n݇*ZRŻ-S3E)cO&*Yw6tǔe}YLL& U~Z"d=[s5, Hy3T؀{4A G w$k-]f8^>`5His݆$L BI=ai@/Q"-mwB#KڸcsJzk+(2j. GUUoX'mFZ.>l14)N`YM 5?Ro%al~0bņFYe ѳ"0W.oIrGIrbX5k|˟X/D9=~D n} 0X_B#J^(\'q^oYr5s7֏(UȨnuz5q`Ig'-w]9¼^RVrp (FSĻ'QcÇO8`4mendstream endobj 6 0 obj << /Type /Font /Subtype /Type1 /Encoding 96 0 R /FirstChar 76 /LastChar 119 /Widths 97 0 R /BaseFont /KBWLFW+CMR17 /FontDescriptor 4 0 R >> endobj 4 0 obj << /Ascent 694 /CapHeight 683 /Descent -195 /FontName /KBWLFW+CMR17 /ItalicAngle 0 /StemV 53 /XHeight 430 /FontBBox [-33 -250 945 749] /Flags 4 /CharSet (/L/P/R/U/a/c/g/h/i/m/n/o/p/r/t/w) /FontFile 5 0 R >> endobj 97 0 obj [576 0 0 0 628 0 680 0 0 693 0 0 0 0 0 0 0 0 0 0 0 459 0 406 0 0 0 459 511 250 0 0 0 772 511 459 511 0 354 0 354 0 0 668 ] endobj 96 0 obj << /Type /Encoding /Differences [ 0 /.notdef 76/L 77/.notdef 80/P 81/.notdef 82/R 83/.notdef 85/U 86/.notdef 97/a 98/.notdef 99/c 100/.notdef 103/g/h/i 106/.notdef 109/m/n/o/p 113/.notdef 114/r 115/.notdef 116/t 117/.notdef 119/w 120/.notdef] >> endobj 16 0 obj << /Type /Pages /Count 6 /Parent 98 0 R /Kids [2 0 R 18 0 R 30 0 R 33 0 R 36 0 R 39 0 R] >> endobj 47 0 obj << /Type /Pages /Count 6 /Parent 98 0 R /Kids [45 0 R 49 0 R 52 0 R 55 0 R 58 0 R 61 0 R] >> endobj 66 0 obj << /Type /Pages /Count 6 /Parent 98 0 R /Kids [64 0 R 68 0 R 71 0 R 74 0 R 77 0 R 80 0 R] >> endobj 98 0 obj << /Type /Pages /Count 18 /Kids [16 0 R 47 0 R 66 0 R] >> endobj 99 0 obj << /Type /Catalog /Pages 98 0 R >> endobj 100 0 obj << /Producer (pdfeTeX-1.21a) /Creator (TeX) /CreationDate (D:20060125192723-05'00') /PTEX.Fullbanner (This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) kpathsea version 3.5.4) >> endobj xref 0 101 0000000000 65535 f 0000001814 00000 n 0000001699 00000 n 0000000009 00000 n 0000091774 00000 n 0000087248 00000 n 0000091619 00000 n 0000085906 00000 n 0000071895 00000 n 0000085751 00000 n 0000070928 00000 n 0000060821 00000 n 0000070770 00000 n 0000059458 00000 n 0000045339 00000 n 0000059300 00000 n 0000092397 00000 n 0000003779 00000 n 0000003661 00000 n 0000001917 00000 n 0000045025 00000 n 0000042993 00000 n 0000044870 00000 n 0000042679 00000 n 0000040646 00000 n 0000042524 00000 n 0000039727 00000 n 0000031566 00000 n 0000039570 00000 n 0000006116 00000 n 0000005998 00000 n 0000003906 00000 n 0000008593 00000 n 0000008475 00000 n 0000006209 00000 n 0000011064 00000 n 0000010946 00000 n 0000008686 00000 n 0000012915 00000 n 0000012797 00000 n 0000011157 00000 n 0000031004 00000 n 0000027144 00000 n 0000030846 00000 n 0000014046 00000 n 0000013928 00000 n 0000013020 00000 n 0000092505 00000 n 0000015434 00000 n 0000015316 00000 n 0000014127 00000 n 0000016561 00000 n 0000016443 00000 n 0000015515 00000 n 0000018104 00000 n 0000017986 00000 n 0000016654 00000 n 0000019211 00000 n 0000019093 00000 n 0000018197 00000 n 0000020256 00000 n 0000020138 00000 n 0000019304 00000 n 0000021312 00000 n 0000021194 00000 n 0000020349 00000 n 0000092614 00000 n 0000022362 00000 n 0000022244 00000 n 0000021405 00000 n 0000023414 00000 n 0000023296 00000 n 0000022455 00000 n 0000024451 00000 n 0000024333 00000 n 0000023507 00000 n 0000025439 00000 n 0000025321 00000 n 0000024544 00000 n 0000027017 00000 n 0000026899 00000 n 0000025532 00000 n 0000031370 00000 n 0000031225 00000 n 0000040338 00000 n 0000040033 00000 n 0000042906 00000 n 0000042879 00000 n 0000045252 00000 n 0000045225 00000 n 0000060335 00000 n 0000059970 00000 n 0000071550 00000 n 0000071272 00000 n 0000086758 00000 n 0000086366 00000 n 0000092135 00000 n 0000091996 00000 n 0000092723 00000 n 0000092797 00000 n 0000092848 00000 n trailer << /Size 101 /Root 99 0 R /Info 100 0 R /ID [ ] >> startxref 93052 %%EOF curlpp-0.8.1/doc/guide.tex000066400000000000000000000655051305746442000154310ustar00rootroot00000000000000\LoadClass[12pt,letterpaper]{article} \documentclass{article} \usepackage{verbatim} \author{Jean-Philippe Barrette-LaPierre} \title{Programming with cURLpp} \begin{document} \maketitle \section{About this Document} \newcommand{\Cpp}{C{\tt ++}} This document attempts to describe the general principles and some basic approaches to consider when programming with cURLpp. Don't forget that cURLpp is a \Cpp wrapper of libcurl, so cURLpp needs libcurl to be installed already. This document will refer to 'the user' as the person writing the source code that uses cURLpp. That would probably be you or someone in a similar position. What will be generally refered to as 'the program' will be the collective source code that you write and that is using cURLpp for transfers. The program is outside cURLpp and cURLpp is outside of the program. To get more details on all options and functions described herein, please refer to their respective man pages. You should always have in mind that this is a \Cpp wrapper of libcurl. It would be unproductive to duplicate libcurl's documentation here, so this document will show you how to interact with cURLpp, but you should read the libcurl programming tutorial, which this document is strongly inspired from, and the libcurl man pages. \section{Building} There are many different ways to build C++ programs. This chapter will assume a unix-style build process. If you use a different build system, you can still read this to get general information that may apply to your environment as well. Note that cURLpp need libcurl to be already installed. \subsection{Compiling the Program} Your compiler needs to know where cURLpp's and libcurl's headers are located. Therefore you must set your compiler's include path to point to the directory where you installed them. The 'curlpp-config'\footnote{ The curlpp-config tool, which wraps all functions of curl-config, is generated at build-time (on unix-like systems) and should be installed with the 'make install' or similar instruction that installs the library, header files, man pages etc.} tool can be used to get this information: \begin{verbatim} # curlpp-config --cflags\end{verbatim} If pkg-config is installed, you can use it this way: \begin{verbatim} # pkg-config --cflags curlpp\end{verbatim} But, if you're using \verb+autoconf+ for your project you can use \verb+pkg-config+ macros. See \verb+pkg-config+ man pages for more details. \subsection{Linking the Program with cURLpp} When having compiled the program, you need to link your object files to create a single executable. For that to succeed, you need to link with cURLpp and possibly also with other libraries that cURLpp itself depends on (such as libcurl). This may include OpenSSL libraries and even some standard OS libraries may be needed on the command line. To figure out which flags to use, the 'curlpp-config' tool comes to the rescue once again: \begin{verbatim} # curlpp-config --libs\end{verbatim} Again, if pkg-config is installed, you can use it this way: \begin{verbatim} # pkg-config --libs curlpp\end{verbatim} \subsection{SSL or Not} cURLpp, like libcurl, can be built and customized in many ways. One of the things that varies between different libraries and builds is the support for SSL-based transfers, like HTTPS and FTPS. If OpenSSL was detected properly by libcurl at build-time, cURLpp will be built with SSL support. To figure out if an installed cURLpp has been built with SSL support enabled, use 'curlpp-config' like this: \begin{verbatim} # curlpp-config --feature\end{verbatim} If SSL is supported, the keyword 'SSL' will be written to stdout, possibly together with a few other features that can be on and off on different cURLpps. \subsection{Portable Code in a Portable World} The people behind libcurl have put a considerable effort to make libcurl work on a large number of different operating systems and environments. You program cURLpp the same way on all platforms that cURLpp runs on. There are only very few minor considerations that differ. If you make sure just to write your code portably enough, you may very well create yourself a very portable program. cURLpp shouldn't stop you from that. \section{Global Preparation} The program must initialize some of the cURLpp functionality globally. That means it should be done exactly once, no matter how many times you intend to use the library. Once for your program's entire lifetime. This is done using \begin{verbatim} cURLpp::initialize( long flags = cURLpp::CURL_GLOBAL_ALL ) \end{verbatim} and it takes one parameter which is a bit pattern that tells cURLpp what to intialize. Check the man page of \verb+curl_global_init+ for more details on flags. When the program no longer uses cURLpp, it should call \verb+cURLpp::terminate()+, which is the opposite of the init call. It will then do the operations needed to cleanup the resources that the \verb+cURLpp::initialize()+ call initialized. Repeated calls to \verb+cURLpp::initialize()+ and \verb+cURLpp::terminate()+ must not be made. They must only be called once each. The cURLpp::Cleanup class can be used to do this. It will call the \verb+cURLpp::initialize()+ function in its constructor and \verb+cURLpp::terminate()+ in its destructor. Check example01.cpp in the examples/ directory of the source distribution for an example. \section{Handle the Easy cURLpp} To use the easy interface, you must first create yourself an easy handle. You need one handle for each easy session you want to perform. Basically, you should use one handle for every thread you plan to use for transferring. You must never share the same handle in multiple threads. Get an easy handle with \begin{verbatim} cURLpp::Easy easyhandle;\end{verbatim} This creates an easy handle. Using that you proceed to the next step: setting up your preferred actions. A handle is just a logic entity for the upcoming transfer or series of transfers. You can use it to do HTTP or FTP requests. You set properties and options for this handle using \verb+cURLpp::Options+, or \verb+cURLpp::OptionList+ classes; we will discuss \verb+cURLpp::OptionList+ later. They control how the subsequent transfer or transfers will be made. Options remain set in the handle until set again to something different. Alas, multiple requests using the same handle will use the same options. Many of the informationals you set in cURLpp are \Cpp standard library strings. Keep in mind that when you set strings with member functions, cURLpp will copy the data. It will not merely point to the data. You don't need to make sure that the data remains available for cURLpp. One of the most basic properties to set in the handle is the URL. You set your preferred URL to transfer with a \verb+void cURLpp::Options::Url(const char *link)+ option class, in a manner similar to: \begin{verbatim} easyhandle.setOpt(cURLpp::Options::Url("http://example.com/")); \end{verbatim} There are of course many more options you can set, and we'll get back to a few of them later. Let's instead continue to the actual transfer: \begin{verbatim} easyhandle.perform(); \end{verbatim} The \verb+cURLpp::Easy::perform()+ will connect to the remote site, do the necessary commands and receive the transfer. Whenever it receives data, it calls the trait function we previously set. The function may get one byte at a time, or it may get many kilobytes at once. cURLpp delivers as much as possible as often as possible. Your trait function should return the number of bytes it "took care of". If that is not the exact same amount of bytes that was passed to it, cURLpp will abort the operation and throw an exception. When the transfer is complete, the function throws a \verb+cURLpp::Exception+ if it doesn't succeed in its mission. the \verb+const char *cURLpp::Exception::what()+ will return the human readable reason of failure. \section{Wrapping libcurl} As previously said, \verb+cURLpp+ is just a \Cpp libcurl wrapper. It wouldn't be a good idea to reproduce here, in this project, all the libcurl documentation. This means that when you will be programming with \verb+cURLpp+, you will refer more to libcurl's documentation than to \verb+cURLpp+'s. We will explain here how \verb+cURLpp+ wraps libcurl, so you will able to use it, without constantly refering to its manual. First, you must know that there are two main things that constitute \verb+cURLpp+: There are its options value setting/retrieving behavior and its utilities that helps you to use libcurl's options more easily. \subsection{Option setting/retrieving} The main feature of \verb+cURLpp+ is that you can retrieve options previously set on handles. \verb+cURLpp+ gives you the opportunity to retrieve options values that were previously set on a specific handle and then use them again for other handles. But first, let's show you how to set an option on a handle, in comparison to libcurl's way of setting an option. libcurl sets options on handles with this function: \begin{verbatim} curl_easy_setopt(CURL *handle, CURLoption option, parameter) \end{verbatim} Here's a part of the documentation taken from the man pages: \begin{quote} \verb+curl_easy_setopt()+ is used to tell libcurl how to behave. By using the appropriate options to \verb+curl_easy_setopt()+, you can change libcurl's behavior. All options are set with the option followed by a parameter. That parameter can be a long, a function pointer or an object pointer, all depending on what the specific option expects. \end{quote} Lets code a simple example: \begin{verbatim} CURL *handle = curl_easy_init(); if(handle == NULL) { //something went wrong. } CURLcode code = curl_easy_setopt(handle, CURLOPT_URL, ``http://www.example.com''); if(code != CURLE_OK) { //something went wrong } \end{verbatim} The code below does the same thing but with \verb+cURLpp+: \begin{verbatim} cURLpp::Easy handle; handle.setOpt(cURLpp::Options::Url(``http://www.example.com''); \end{verbatim} If a problem occur, \verb+cURLpp+ will throw an exception, for more detail on this subject, see the next section named \textit{Exception issues}. As you see, the equivalent of the \verb+curl_easy_setopt+ function is the cURLpp::Easy::setOpt member function. \subsubsection{cURLpp::Options} The question that you might ask you at this moment is: ``what exactly is the \verb+cURLpp::Options::Url+ class mentioned in the previous example?'' In fact, this class is used to store values of options, but also to retrieve them, as shown below: \begin{verbatim} cURLpp::Easy handle; handle.setOpt(cURLpp::Options::Url(``http://www.example.com''); cURLpp::Options::Url myUrl; handle.getOpt(myUrl); std::cout << myUrl.getValue() << std::endl; \end{verbatim} This piece of code should print the URL on the standard output. Here's the code of the \verb+examples/example01.cpp+ file. \begin{verbatim} #include #include #include #include #define MY_PORT 8080 /** * This example is made to show you how you can use the Options. */ int main() { try { cURLpp::Cleanup myCleanup; // Creation of the URL option. cURLpp::Options::Url myUrl( std::string("http://example.com")); // Copy construct from the other URL. cURLpp::Options::Url myUrl2(myUrl); // Creation of the port option. cURLpp::Options::Port myPort(MY_PORT); // Creation of the request. cURLpp::Easy myRequest; // Creation of an option that contain a copy // of the URL option. cURLpp::OptionBase *mytest = myUrl.clone(); myRequest.setOpt(*mytest); // You can reuse the base option for other type of option // and set the option to the request. but first, don't forget // to delete the previous memory. You can delete it since the // option is internally duplicated for the request. delete mytest; mytest = myPort.clone(); myRequest.setOpt(*mytest); delete mytest; // You can clone an option directly to the same type of // option. cURLpp::Options::Url *myUrl3 = myUrl.clone(); myRequest.setOpt(myUrl3); // Now myUrl3 is owned by the request we will NOT use // it anymore. // You don't need to declare an option if you just want // to use it once. myRequest.setOpt(cURLpp::Options::Url("example.com")); // Note that the previous line wasn't really efficient // because we create the option, this option is duplicated // for the request and then the option destructor is called. // You can use this instead: myRequest.setOpt(new cURLpp::Options::Url("example.com")); // Note that with this the request will use directly this // instance we just created. Be aware that if you pass an // Option pointer to the setOpt function, it will consider // the instance has its own instance. The Option instance // will be deleted when the request will be deleted, so // don't use the instance further in your code. // Doing the previous line is efficient as this: myRequest.setOpt(myUrl.clone()); // You can retrieve the value of a specific option. std::cout << myUrl2.getValue() << std::endl; // You can see what are the options set for a request // with this function. This function will print the option // to the stdout. myRequest.print(); // Perform the transaction with the options set. myRequest.perform(); } catch( cURLpp::RuntimeError &e ) { std::cout << e.what() << std::endl; } catch( cURLpp::LogicError &e ) { std::cout << e.what() << std::endl; } return 0; } \end{verbatim} \subsection{cURLpp::Option types} This section will explain the use of the types that we use for some options that differ from types that libcurl uses for the same option. \subsubsection{The bool type} A true value is binded to a non-zero long value, a false value is binded to a zero long value. \subsubsection{The std::string type} The \verb+std::string::c_str()+ function is passed to libcurl. \subsubsection{The std::list template of std::string type} This type is used when libcurl's option need a \verb+curl_slist+. Instead of using this homemade struct, cURLpp allow you to use a known type, the \verb+std::list+. cURLpp this transform internally the \verb+std::list+ to a \verb+curl_slist+. \subsection{cURLpp::Options} This section just list how each libcurl's option is binded by cURLpp. Some options might not be there, if it's the case and you want to use them, see the ``how to enhance cURLpp'' section. \subsubsection{Behavior options} \begin{verbatim} typedef cURLpp::OptionTrait< bool, CURLOPT_VERBOSE > Verbose; typedef cURLpp::OptionTrait< bool, CURLOPT_HEADER > Header; typedef cURLpp::OptionTrait< bool, CURLOPT_NOSIGNAL > NoSignal; typedef cURLpp::OptionTrait< bool, CURLOPT_NOPROGRESS > NoProgress; \end{verbatim} \subsubsection{Callback options} \begin{verbatim} typedef cURLpp::OptionTrait< cURL::curl_write_callback, CURLOPT_WRITEFUNCTION > WriteFunction; typedef cURLpp::OptionTrait< void *, CURLOPT_WRITEDATA > WriteData; typedef cURLpp::OptionTrait< cURL::curl_read_callback, CURLOPT_READFUNCTION > ReadFunction; typedef cURLpp::OptionTrait< void *, CURLOPT_READDATA > ReadData; typedef cURLpp::OptionTrait< cURL::curl_progress_callback, CURLOPT_PROGRESSFUNCTION > ProgressFunction; typedef cURLpp::OptionTrait< void *, CURLOPT_PROGRESSDATA > ProgressData; typedef cURLpp::OptionTrait< cURL::curl_write_callback, CURLOPT_HEADERFUNCTION > HeaderFunction; typedef cURLpp::OptionTrait< void *, CURLOPT_HEADERDATA > HeaderData; typedef cURLpp::OptionTrait< cURL::curl_debug_callback, CURLOPT_DEBUGFUNCTION > DebugFunction; typedef cURLpp::OptionTrait< void *, CURLOPT_DEBUGDATA > DebugData; #ifdef CURLOPT_SSL_CTX_FUNCTION typedef cURLpp::OptionTrait< cURL::curl_ssl_ctx_callback, CURLOPT_SSL_CTX_FUNCTION > SslCtxFunction; typedef cURLpp::OptionTrait< void *, cURL::CURLOPT_SSL_CTX_DATA > SslCtxData; #endif \end{verbatim} \subsubsection{Error options} \begin{verbatim} typedef cURLpp::OptionTrait< char *, cURL::CURLOPT_ERRORBUFFER > ErrorBuffer; typedef cURLpp::OptionTrait< FILE *, cURL::CURLOPT_STDERR > StdErr; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FAILONERROR > FailOnError; \end{verbatim} \subsubsection{Network options} \begin{verbatim} typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_URL > Url; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_PROXY > Proxy; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_PROXYPORT > ProxyPort; typedef cURLpp::OptionTrait< curl_proxytype, cURL::CURLOPT_PROXYTYPE > ProxyType; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_HTTPPROXYTUNNEL > HttpProxyTunnel; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_INTERFACE > Interface; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_DNS_CACHE_TIMEOUT > DnsCacheTimeout; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_DNS_USE_GLOBAL_CACHE > DnsUseGlobalCache; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_BUFFERSIZE > BufferSize; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_PORT > Port; #ifdef cURL::CURLOPT_TCP_NODELAY typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_TCP_NODELAY > TcpNoDelay; #endif \end{verbatim} \subsubsection{Names and passwords options} \begin{verbatim} typedef cURLpp::OptionTrait< long, cURL::CURLOPT_NETRC > Netrc; #ifdef cURL::CURLOPT_NETRC_FILE typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_NETRC_FILE > NetrcFile; #endif typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_USERPWD > UserPwd; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_PROXYUSERPWD > ProxyUserPwd; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_HTTPAUTH > HttpAuth; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_PROXYAUTH > ProxyAuth; \end{verbatim} \subsubsection{HTTP options} \begin{verbatim} typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_AUTOREFERER > AutoReferer; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_ENCODING > Encoding; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FOLLOWLOCATION > FollowLocation; #ifdef cURL::CURLOPT_UNRESTRICTED_AUTH typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_UNRESTRICTED_AUTH > UnrestrictedAuth; #endif typedef cURLpp::OptionTrait< long, cURL::CURLOPT_MAXREDIRS > MaxRedirs; #ifndef cURL::CURLOPT_UPLOAD typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_PUT > Put; #else typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_UPLOAD > Put; #endif typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_POST > Post; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_POSTFIELDS > PostFields; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_POSTFIELDSIZE > PostFieldSize; #ifdef cURL::CURLOPT_POSTFIELDSIZE_LARGE typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_POSTFIELDSIZE_LARGE > PostFieldSizeLarge; #endif typedef cURLpp::OptionTrait< struct cURLpp::cURL::HttpPost *, cURL::CURLOPT_HTTPPOST > HttpPost; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_REFERER > Referer; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_USERAGENT > UserAgent; typedef cURLpp::OptionTrait< std::list< std::string >, cURL::CURLOPT_HTTPHEADER > HttpHeader; typedef cURLpp::OptionTrait< std::list< std::string >, cURL::CURLOPT_HTTP200ALIASES > Http200Aliases; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_COOKIE > Cookie; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_COOKIEFILE > CookieFile; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_COOKIEJAR > CookieJar; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_COOKIESESSION > CookieSession; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_HTTPGET > HttpGet; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_HTTP_VERSION > HttpVersion; \end{verbatim} \subsubsection{FTP options} \begin{verbatim} typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_FTPPORT > FtpPort; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_QUOTE > Quote; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_POSTQUOTE > PostQuote; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_PREQUOTE > PreQuote; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FTPLISTONLY > FtpListOnly; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FTPAPPEND > FtpAppend; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FTP_USE_EPSV > FtpUseEpsv; #ifdef cURL::CURLOPT_FTP_CREATE_MISSING_DIRS typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FTP_CREATE_MISSING_DIRS > FtpCreateMissingDirs; #endif #ifdef cURL::CURLOPT_FTP_RESPONSE_TIMEOUT typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FTP_RESPONSE_TIMEOUT > FtpResponseTimeout; #endif #ifdef cURL::CURLOPT_FTP_SSL typedef cURLpp::OptionTrait< cURLpp::curl_ftpssl, cURL::CURLOPT_FTP_SSL > FtpSsl; #endif #ifdef cURL::CURLOPT_FTP_AUTH typedef cURLpp::OptionTrait< cURLpp::curl_ftpauth, cURL::CURLOPT_FTP_AUTH > FtpAuth; #endif \end{verbatim} \subsubsection{Protocol options} \begin{verbatim} typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_TRANSFERTEXT > TransferText; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_CRLF > Crlf; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_RANGE > Range; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_RESUME_FROM > ResumeFrom; #ifdef cURL::CURLOPT_RESUME_FROM_LARGE typedef cURLpp::OptionTrait< curl_off_t, cURL::CURLOPT_RESUME_FROM_LARGE > ResumeFromLarge; #endif typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_CUSTOMREQUEST > CustomRequest; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FILETIME > FileTime; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_NOBODY > NoBody; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_INFILESIZE > InfileSize; #ifdef cURL::CURLOPT_INFILESIZE_LARGE typedef cURLpp::OptionTrait< cURL::curl_off_t, cURL::CURLOPT_INFILESIZE_LARGE > InfileSizeLarge; #endif #ifdef cURL::CURLOPT_UPLOAD typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_UPLOAD > Upload; #else typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_PUT > Upload; #endif #ifdef cURL::CURLOPT_MAXFILESIZE typedef cURLpp::OptionTrait< long, cURL::CURLOPT_MAXFILESIZE > MaxFileSize; #endif #ifdef cURL::CURLOPT_MAXFILESIZE_LARGE typedef cURLpp::OptionTrait< cURL::curl_off_t, cURL::CURLOPT_MAXFILESIZE_LARGE > MaxFileSizeLarge; #endif typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_TIMECONDITION > TimeCondition; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_TIMECONDITION > TimeValue; \end{verbatim} \subsubsection{Connection options} \begin{verbatim} typedef cURLpp::OptionTrait< long, cURL::CURLOPT_TIMEOUT > Timeout; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_LOW_SPEED_LIMIT > LowSpeedLimit; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_LOW_SPEED_TIME > LowSpeedTime; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_MAXCONNECTS > MaxConnects; typedef cURLpp::OptionTrait< cURL::curl_closepolicy, cURL::CURLOPT_CLOSEPOLICY > ClosePolicy; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FRESH_CONNECT > FreshConnect; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_FORBID_REUSE > ForbidReuse; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_CONNECTTIMEOUT > ConnectTimeout; #ifdef cURL::CURLOPT_IPRESOLVE typedef cURLpp::OptionTrait< long, cURL::CURLOPT_IPRESOLVE > IpResolve; #endif \end{verbatim} \subsubsection{SSL and security options} \begin{verbatim} typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_SSLCERT > SslCert; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_SSLCERTTYPE > SslCertType; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_SSLCERTPASSWD > SslCertPasswd; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_SSLKEY > SslKey; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_SSLKEYTYPE > SslKeyType; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_SSLKEYPASSWD > SslKeyPasswd; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_SSLENGINE > SslEngine; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_SSLVERSION > SslVersion; typedef cURLpp::OptionTrait< bool, cURL::CURLOPT_SSL_VERIFYPEER > SslVerifyPeer; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_CAINFO > CaInfo; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_CAPATH > CaPath; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_RANDOM_FILE > RandomFile; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_EGDSOCKET > EgdSocket; typedef cURLpp::OptionTrait< long, cURL::CURLOPT_SSL_VERIFYHOST > SslVerifyHost; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_SSL_CIPHER_LIST > SslCipherList; typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_KRB4LEVEL > Krb4Level; \end{verbatim} \subsubsection{Others options} \begin{verbatim} typedef cURLpp::OptionTrait< std::string, cURL::CURLOPT_KRB4LEVEL > Krb4Level; \end{verbatim} \section{How the enhance cURLpp} Need to be written. \section{Exceptions issues} As previously said, cURLpp (libcurl in fact) offer the possibility to reimplement the data writing/reading functions. Those functions called from within libcurl might raise exceptions. Raising an exception in C code might cause problems. cURLpp protect you from doing so\footnote{This feature will be added only in the 0.6.0 version}. All exceptions are caught by cURLpp before they could cause damage to libcurl. If you want to raise an exception within traits, you need to do this: \begin{verbatim} cURLpp::raiseException(MyException(``Exception Raised''); \end{verbatim} Then, the \verb+cURLpp::Easy::perform()+ will raise your exception at the end of the process. If an exception is raised but not by this mechanism, a \verb+cURLpp::UnknownExceptionError+ will be raised. \end{document} curlpp-0.8.1/examples/000077500000000000000000000000001305746442000146505ustar00rootroot00000000000000curlpp-0.8.1/examples/CMakeLists.txt000066400000000000000000000017461305746442000174200ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.0) include(FindPkgConfig) pkg_check_modules(CURLPP REQUIRED curlpp) set(CMAKE_CXX_STANDARD 11) # C++11... set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required... set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11 file(GLOB ExamplesFileList "*.cpp") # Create a meta target to create examples add_custom_target(build_all_examples COMMENT A target that requires all the examples.) message(STATUS "Creating build rules for Examples:") foreach(Example ${ExamplesFileList}) message(STATUS "\tCreating build rule for ${Example}") # Get the name without extension or directory get_filename_component(ExampleName ${Example} NAME_WE) # Define example executable add_executable(${ExampleName} ${Example}) # Link example against curlpp target_link_libraries(${ExampleName} ${CURLPP_LDFLAGS}) # make the meta target depend on this example. add_dependencies(build_all_examples ${ExampleName}) endforeach(Example ${ExamplesFileList}) curlpp-0.8.1/examples/README000066400000000000000000000032251305746442000155320ustar00rootroot00000000000000configure.in is a good example to add curlpp to your project Note that example 22 is contains the easiest and shorter examples of cURLpp usage. Example 01: This example is made to show you how you can use the Options. Example 02: an upload example. Example 03: verbose callback example. Example 04: GetInfo example. Example 05: Function functor for WriteFunction example. Example 06: Method functor for WriteFunction example. Example 07: Cookie interface example via getInfo. Demonstrates usage of Infos::CookieList which example04 did not. Example 08: verbose callback example, with exception safe handling. Example 09: verbose callback example, with exception safe handling, but without raiseException function. Example 10: Binded function functor for WriteFunction example. Example 11: Plain write function example. Example 12: HTTP POST example. Example 13: Simple Multi interface example. Example 14: Multi interface example with info function example. Example 15: Simple example for demonstrating the NoValueOptionTrait. (SslEngineDefault) Example 16: HTTP POST example with HTTP Authentification. Example 17: Binded method functor for WriteFunction example. Example 18: No longer available. This used to be a boost usage example, but it's no longer relevant since c++11. Example 19: Multipart/formdata HTTP POST example. Example 20: std::ostream usage. Example 21: upload example with std::istream. Example 22: Real easy and quick examples. Example 23: Setting request options using iterators to custom container of curlpp options. Example 24: Binded method functor for DebugFunction example. curlpp-0.8.1/examples/example00.cpp000066400000000000000000000013151305746442000171470ustar00rootroot00000000000000/** * \file * The most simple example. * */ #include #include #include using namespace curlpp::options; int main(int, char **) { try { // That's all that is needed to do cleanup of used resources (RAII style). curlpp::Cleanup myCleanup; // Our request to be sent. curlpp::Easy myRequest; // Set the URL. myRequest.setOpt("http://example.com"); // Send request and get a result. // By default the result goes to standard output. myRequest.perform(); } catch(curlpp::RuntimeError & e) { std::cout << e.what() << std::endl; } catch(curlpp::LogicError & e) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example01.cpp000066400000000000000000000124541305746442000171560ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Setting and copying options. * */ #include #include #include #include #include #include namespace { const long MyPort = 80; } /** * This example is made to show you how you can use the Options. */ int main(int, char **) { try { curlpp::Cleanup myCleanup; // First easy example. { // The first easiest example is to retreive the content of // a web page and put it in a stream. std::cout << curlpp::options::Url("http://example.com"); // You don't need to use just the standard outputs. You // can use any stream: std::ostringstream os; os << curlpp::options::Url("http://example.com"); } // More elaborate example. { // What the previous example done there was simply // to create a curlpp::Easy class, which is the basic // object in cURLpp, and then set the Url option. // curlpp::options classes are the primitives that allow to specify // values to the requests. curlpp::options::Url myUrl(std::string("http://example.com")); curlpp::Easy myRequest; myRequest.setOpt(myUrl); // Now that all the options we wanted to set are there, we need to // actually do the request. the "perform" method does actually that. // With that call, the request will be done and the content of that URL // will be printed in std::cout (which is the default). myRequest.perform(); // If we wanted to put the content of the URL within a string stream // (or any type of std::ostream, for that matter), like the first example, // we would use the WriteStrem option like this: std::ostringstream os; curlpp::options::WriteStream ws(&os); myRequest.setOpt(ws); myRequest.perform(); // There is some shorcut within curlpp that allow you to write shorter code // like this: os << myRequest; // That would do exactly what the previous code was doing. } // Creation of the URL option. curlpp::options::Url myUrl(std::string("http://example.com")); // Copy construct from the other URL. curlpp::options::Url myUrl2(myUrl); // Creation of the port option. curlpp::options::Port myPort(MyPort); // Creation of the request. curlpp::Easy myRequest; // Creation of an option that contain a copy of the URL option. curlpp::OptionBase *mytest = myUrl.clone(); myRequest.setOpt(*mytest); // You can reuse the base option for other type of option // and set the option to the request. but first, don't forget // to delete the previous memory. You can delete it since the // option is internally duplicated for the request. delete mytest; mytest = myPort.clone(); myRequest.setOpt(*mytest); delete mytest; // You can clone an option directly to the same type of // option. curlpp::options::Url *myUrl3 = myUrl.clone(); myRequest.setOpt(myUrl3); // Now myUrl3 is owned by the request we will NOT use // it anymore. // You don't need to declare an option if you just want // to use it once. myRequest.setOpt(curlpp::options::Url("example.com")); // Note that the previous line wasn't really efficient // because we create the option, this option is duplicated // for the request and then the option destructor is called. // You can use this instead: myRequest.setOpt(new curlpp::options::Url("example.com")); // Note that with this the request will use directly this // instance we just created. Be aware that if you pass an // Option pointer to the setOpt function, it will consider // the instance has its own instance. The Option instance // will be deleted when the request will be deleted, so // don't use the instance further in your code. // Doing the previous line is efficient as this: myRequest.setOpt(myUrl.clone()); // You can retreive the value of a specific option. std::cout << myUrl2.getValue() << std::endl; // Perform the transaction with the options set. myRequest.perform(); } catch( curlpp::RuntimeError &e ) { std::cout << e.what() << std::endl; } catch( curlpp::LogicError &e ) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example02.cpp000066400000000000000000000053611305746442000171560ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Uploading of string. * ReadFunction option using functor. * Setting custom headers. */ #include #include #include #include #include #include #include /* anonymous namespace to prevent name clash in case other examples using the same global entities would be compiled in the same project */ namespace { char *data = NULL; size_t readData(char *buffer, size_t size, size_t nitems) { strncpy(buffer, data, size * nitems); return size * nitems; } } // namespace int main(int argc, char *argv[]) { if(argc != 3) { std::cerr << "Example 2: Missing argument" << std::endl << "Example 2: Usage: example02 url string-to-send" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; data = argv[2]; int size = strlen(data); char buf[50]; try { curlpp::Cleanup cleaner; curlpp::Easy request; std::list headers; headers.push_back("Content-Type: text/*"); sprintf(buf, "Content-Length: %d", size); headers.push_back(buf); using namespace curlpp::Options; request.setOpt(new Verbose(true)); request.setOpt(new ReadFunction(curlpp::types::ReadFunctionFunctor(readData))); request.setOpt(new InfileSize(size)); request.setOpt(new Upload(true)); request.setOpt(new HttpHeader(headers)); request.setOpt(new Url(url)); request.perform(); } catch (curlpp::LogicError & e) { std::cout << e.what() << std::endl; } catch (curlpp::RuntimeError & e) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example03.cpp000066400000000000000000000044041305746442000171540ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * DebugFunction option using functor as a callback. */ #include #include #include #include #include class MyWindow { public: int writeDebug(curl_infotype, char *data, size_t size) { fprintf(stderr, "Debug: "); fwrite(data, size, 1, stderr); return size; } }; int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << "Example 3: Wrong number of arguments" << std::endl << "Example 3: Usage: example3 url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; MyWindow myWindow; try { curlpp::Cleanup cleaner; curlpp::Easy request; using namespace curlpp::Options; request.setOpt(Verbose(true)); using namespace std::placeholders; request.setOpt(DebugFunction(std::bind(&MyWindow::writeDebug, &myWindow, _1, _2, _3))); request.setOpt(Url(url)); request.perform(); } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example04.cpp000066400000000000000000000047021305746442000171560ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Getting options using curlpp::infos. * */ #include #include #include #include #include #include int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << "Example 04: Wrong number of arguments" << std::endl << "Example 04: Usage: example04 url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; using namespace curlpp::Options; request.setOpt(Verbose(true)); request.setOpt(Url(url)); request.perform(); std::string effURL; curlpp::infos::EffectiveUrl::get(request, effURL); std::cout << "Effective URL: " << effURL << std::endl; //other way to retreive URL std::cout << std::endl << "Effective URL: " << curlpp::infos::EffectiveUrl::get(request) << std::endl; std::cout << "Response code: " << curlpp::infos::ResponseCode::get(request) << std::endl; std::cout << "SSL engines: " << curlpp::infos::SslEngines::get(request) << std::endl; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example05.cpp000066400000000000000000000063251305746442000171620ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Write function using free function as a callback. * */ #include #include #include #include #include #include #define MAX_FILE_LENGTH 20000 char *m_pBuffer = NULL; size_t m_Size = 0; void* Realloc(void* ptr, size_t size) { if(ptr) return realloc(ptr, size); else return malloc(size); }; // Callback must be declared static, otherwise it won't link... size_t WriteMemoryCallback(char* ptr, size_t size, size_t nmemb) { // Calculate the real size of the incoming buffer size_t realsize = size * nmemb; // (Re)Allocate memory for the buffer m_pBuffer = (char*) Realloc(m_pBuffer, m_Size + realsize); // Test if Buffer is initialized correctly & copy memory if (m_pBuffer == NULL) { realsize = 0; } memcpy(&(m_pBuffer[m_Size]), ptr, realsize); m_Size += realsize; // return the real size of the buffer... return realsize; }; void print() { std::cout << "Size: " << m_Size << std::endl; std::cout << "Content: " << std::endl << m_pBuffer << std::endl; } int main(int argc, char *argv[]) { m_pBuffer = (char*) malloc(MAX_FILE_LENGTH * sizeof(char)); if(argc != 2) { std::cerr << "Example 05: Wrong number of arguments" << std::endl << "Example 05: Usage: example05 url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; // Set the writer callback to enable cURL // to write result in a memory area curlpp::types::WriteFunctionFunctor functor(WriteMemoryCallback); curlpp::options::WriteFunction *test = new curlpp::options::WriteFunction(functor); request.setOpt(test); // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); request.setOpt(new curlpp::options::Verbose(true)); request.perform(); print(); } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } } curlpp-0.8.1/examples/example06.cpp000066400000000000000000000071641305746442000171650ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * WriteFunction option using functor as a callback. * */ #include #include #include #include #include #include #define MAX_FILE_LENGTH 20000 class WriterMemoryClass { public: // Helper Class for reading result from remote host WriterMemoryClass() { this->m_pBuffer = NULL; this->m_pBuffer = (char*) malloc(MAX_FILE_LENGTH * sizeof(char)); this->m_Size = 0; }; ~WriterMemoryClass() { if (this->m_pBuffer) free(this->m_pBuffer); }; void* Realloc(void* ptr, size_t size) { if(ptr) return realloc(ptr, size); else return malloc(size); }; // Callback must be declared static, otherwise it won't link... size_t WriteMemoryCallback(char* ptr, size_t size, size_t nmemb) { // Calculate the real size of the incoming buffer size_t realsize = size * nmemb; // (Re)Allocate memory for the buffer m_pBuffer = (char*) Realloc(m_pBuffer, m_Size + realsize); // Test if Buffer is initialized correctly & copy memory if (m_pBuffer == NULL) { realsize = 0; } memcpy(&(m_pBuffer[m_Size]), ptr, realsize); m_Size += realsize; // return the real size of the buffer... return realsize; }; void print() { std::cout << "Size: " << m_Size << std::endl; std::cout << "Content: " << std::endl << m_pBuffer << std::endl; } // Public member vars char* m_pBuffer; size_t m_Size; }; int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << "Example 06: Wrong number of arguments" << std::endl << "Example 06: Usage: example06 url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; WriterMemoryClass mWriterChunk; // Set the writer callback to enable cURL // to write result in a memory area using namespace std::placeholders; curlpp::types::WriteFunctionFunctor functor = std::bind(&WriterMemoryClass::WriteMemoryCallback, &mWriterChunk, _1, _2, _3); curlpp::options::WriteFunction *test = new curlpp::options::WriteFunction(functor); request.setOpt(test); // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); request.setOpt(new curlpp::options::Verbose(true)); request.perform(); mWriterChunk.print(); } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } } curlpp-0.8.1/examples/example07.cpp000066400000000000000000000071731305746442000171660ustar00rootroot00000000000000/** * \file * Cookies. * */ #include #include #include #include #include #include #include #include #define CURLPP_ALLOW_NOT_AVAILABLE #include #include class YesNo { public: explicit YesNo(bool yn) : yesno(yn) {} std::string operator()() const { return yesno ? "Yes" : "No"; } friend std::ostream &operator<<(std::ostream &strm, const YesNo &yn) { strm << yn(); return strm; } private: bool yesno; }; struct MyCookie { std::string name; std::string value; std::string domain; std::string path; time_t expires; bool tail; bool secure; }; std::ostream & operator<<(std::ostream &strm, const MyCookie &cook) { strm << "Cookie: '" << cook.name << "' (secure: " << YesNo(cook.secure) << ", tail: " << YesNo(cook.tail) << ") for domain: '" << cook.domain << "', " << "path: '" << cook.path << "'.\n"; strm << "Value: '" << cook.value << "'.\n"; strm << "Expires: '" << ctime(&cook.expires) << "'.\n"; return strm; } std::vector & split_cookie_str(const std::string &str, std::vector &in) { std::string part; std::istringstream strm(str); while (getline(strm, part, '\t')) in.push_back(part); return in; } std::vector splitCookieStr(const std::string &str) { std::vector split; split_cookie_str(str, split); return split; } std::vector & splitCookieStr(const std::string &str, std::vector &in) { return split_cookie_str(str, in); } int StrToInt(const std::string &str) { std::istringstream strm(str); int i = 0; if (!(strm >> i)) { throw curlpp::RuntimeError("Unable to convert string '" + str + "' to integer!"); } return i; } MyCookie MakeCookie(const std::string &str_cookie) { std::vector vC = splitCookieStr(str_cookie); MyCookie cook; cook.domain = vC[0]; cook.tail = vC[1] == "TRUE"; cook.path = vC[2]; cook.secure = vC[3] == "TRUE"; cook.expires = StrToInt(vC[4]); cook.name = vC[5]; cook.value = vC[6]; return cook; } int main(void) { try { curlpp::Cleanup myCleanup; curlpp::Easy exEasy; std::vector cookieList; // a cookie as in HTTP header cookieList.push_back("Set-Cookie: GMAIL_AT=EXPIRED;expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com"); // a Netscape style cookie with \t cookieList.push_back(".google.com\tTRUE\t/\tFALSE\t2147483647\tLSID\tI like you GOOGLE"); // a Netscape style cookie with tabs in string cookieList.push_back(".yahoo.com TRUE / FALSE 0 YAHOO_COOKIE I like you yahoo, too"); exEasy.setOpt(new curlpp::options::Url("http://www.google.com")); exEasy.setOpt(new curlpp::options::FileTime(true)); exEasy.setOpt(new curlpp::options::Verbose(true)); // loop throught the cookies and add one by one // for (std::vector::iterator it = cookieList.begin(); it != cookieList.end(); ++it) { exEasy.setOpt(curlpp::options::CookieList(*it)); } exEasy.perform(); // see what cookies we got // std::cout << "\nCookies from cookie engine:" << std::endl; std::list cookies; curlpp::infos::CookieList::get(exEasy, cookies); int i = 1; for (std::list::const_iterator it = cookies.begin(); it != cookies.end(); ++it, i++) { std::cout << "[" << i << "]: " << MakeCookie(*it) << std::endl; } exit(EXIT_SUCCESS); } catch(curlpp::RuntimeError &e) { std::cerr << e.what() << std::endl; exit(EXIT_FAILURE); } catch(curlpp::LogicError &e) { std::cout << e.what() << std::endl; exit(EXIT_FAILURE); } } curlpp-0.8.1/examples/example08.cpp000066400000000000000000000045701305746442000171650ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * DebugFunction option using functor. * */ #include #include #include #include #include class MyWindow { public: int writeDebug(curl_infotype, char *, size_t) { curlpp::raiseException(std::runtime_error("This is our exception.")); std::cout << "We never reach this line." << std::endl; return 0; } }; int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << "Example 8: Wrong number of arguments" << std::endl << "Example 8: Usage: example8 url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; MyWindow myWindow; try { curlpp::Cleanup cleaner; curlpp::Easy request; using namespace curlpp::Options; request.setOpt(Verbose(true)); using namespace std::placeholders; request.setOpt(DebugFunction(std::bind(&MyWindow::writeDebug, &myWindow, _1, _2, _3))); request.setOpt(Url(url)); request.perform(); } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } catch ( std::runtime_error &e ) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example09.cpp000066400000000000000000000047011305746442000171620ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * DebugFunction option using functor. * */ #include #include #include #include #include class MyWindow { public: int writeDebug(curl_infotype, char *, size_t) { throw std::runtime_error("This is the unknown exception."); std::cout << "We never reach this line." << std::endl; return 0; } }; int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << "Example 9: Wrong number of arguments" << std::endl << "Example 9: Usage: example9 url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; MyWindow myWindow; try { curlpp::Cleanup cleaner; curlpp::Easy request; using namespace curlpp::Options; request.setOpt(Verbose(true)); using namespace std::placeholders; request.setOpt(DebugFunction(std::bind(&MyWindow::writeDebug, &myWindow, _1, _2, _3))); request.setOpt(Url(url)); request.perform(); } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } catch ( std::runtime_error &e ) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example10.cpp000066400000000000000000000052061305746442000171530ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * WriteFunction option using functor. * Writing to FILE* * */ #include #include #include #include #include #include #include #define MAX_FILE_LENGTH 20000 size_t FileCallback(FILE *f, char* ptr, size_t size, size_t nmemb) { return fwrite(ptr, size, nmemb, f); }; int main(int argc, char *argv[]) { if(argc != 3) { std::cerr << argv[0] << ": Wrong number of arguments" << std::endl << argv[0] << ": Usage: " << " url file" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; char *filename = argv[2]; FILE * file = fopen(filename, "w"); if (!file) { std::cerr << "Error opening " << filename << std::endl; return EXIT_FAILURE; } try { curlpp::Cleanup cleaner; curlpp::Easy request; // Set the writer callback to enable cURL to write result in a memory area using namespace std::placeholders; curlpp::options::WriteFunction *test = new curlpp::options::WriteFunction(std::bind(&FileCallback, file, _1, _2, _3)); request.setOpt(test); // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); request.setOpt(new curlpp::options::Verbose(true)); request.perform(); return EXIT_SUCCESS; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_FAILURE; } curlpp-0.8.1/examples/example11.cpp000066400000000000000000000054351305746442000171600ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * WriteFunction option using free function. * Writing to FILE* * */ #include #include #include #include #include #include #include #include /// Callback must be declared static, otherwise it won't link... size_t WriteCallback(char* ptr, size_t size, size_t nmemb, void *f) { FILE *file = (FILE *)f; return fwrite(ptr, size, nmemb, file); }; int main(int argc, char *argv[]) { if(argc < 2) { std::cerr << "Example 11: Wrong number of arguments" << std::endl << "Example 11: Usage: example11 url [file]" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; char *filename = NULL; if(argc >= 3) { filename = argv[2]; } try { curlpp::Cleanup cleaner; curlpp::Easy request; /// Set the writer callback to enable cURL to write result in a memory area curlpp::options::WriteFunctionCurlFunction myFunction(WriteCallback); FILE *file = stdout; if(filename != NULL) { file = fopen(filename, "wb"); if(file == NULL) { fprintf(stderr, "%s/n", strerror(errno)); return EXIT_FAILURE; } } curlpp::OptionTrait myData(file); request.setOpt(myFunction); request.setOpt(myData); /// Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); request.setOpt(new curlpp::options::Verbose(true)); request.perform(); } catch (curlpp::LogicError & e) { std::cout << e.what() << std::endl; } catch (curlpp::RuntimeError & e) { std::cout << e.what() << std::endl; } } curlpp-0.8.1/examples/example12.cpp000066400000000000000000000044611305746442000171570ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Simple POST demo. * */ #include #include #include #include #include #include int main(int argc, char *argv[]) { if(argc < 2) { std::cerr << "Example 11: Wrong number of arguments" << std::endl << "Example 11: Usage: example12 url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; request.setOpt(new curlpp::options::Url(url)); request.setOpt(new curlpp::options::Verbose(true)); std::list header; header.push_back("Content-Type: application/octet-stream"); request.setOpt(new curlpp::options::HttpHeader(header)); request.setOpt(new curlpp::options::PostFields("abcd")); request.setOpt(new curlpp::options::PostFieldSize(5)); request.perform(); } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_SUCCESS; } curlpp-0.8.1/examples/example13.cpp000066400000000000000000000066231305746442000171620ustar00rootroot00000000000000/* * Copyright (c) <2002-2006> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Simple Multi demo. * */ #include #include #include #include #include #include #include #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) #pragma comment(lib, "Ws2_32.lib") #endif // WIN32 int main(int argc, char *argv[]) { if(argc < 3) { std::cerr << "Example 13: Wrong number of arguments" << std::endl << "Example 13: Usage: example13 url1 url2" << std::endl; return EXIT_FAILURE; } char *url1 = argv[1]; char *url2 = argv[2]; try { curlpp::Cleanup cleaner; curlpp::Easy request1; curlpp::Easy request2; request1.setOpt(new curlpp::options::Url(url1)); request1.setOpt(new curlpp::options::Verbose(true)); request2.setOpt(new curlpp::options::Url(url2)); request2.setOpt(new curlpp::options::Verbose(true)); int nbLeft; curlpp::Multi requests; requests.add(&request1); requests.add(&request2); /* we start some action by calling perform right away */ while(!requests.perform(&nbLeft)) {}; while(nbLeft) { struct timeval timeout; int rc; /* select() return code */ fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd; FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; /* get file descriptors from the transfers */ requests.fdset(&fdread, &fdwrite, &fdexcep, &maxfd); rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); switch(rc) { case -1: /* select error */ nbLeft = 0; printf("select() returns error, this is badness\n"); break; case 0: default: /* timeout or readable/writable sockets */ while(!requests.perform(&nbLeft)) {}; break; } } std::cout << "NB lefts: " << nbLeft << std::endl; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_SUCCESS; } curlpp-0.8.1/examples/example14.cpp000066400000000000000000000100711305746442000171530ustar00rootroot00000000000000/* * Copyright (c) <2002-2006> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Multi demo. * */ #include #include #include #include #include #include #include #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) #pragma comment(lib, "Ws2_32.lib") #endif // WIN32 int main(int argc, char *argv[]) { if(argc < 3) { std::cerr << "Example 13: Wrong number of arguments" << std::endl << "Example 13: Usage: example13 url1 url2" << std::endl; return EXIT_FAILURE; } char *url1 = argv[1]; char *url2 = argv[2]; try { curlpp::Cleanup cleaner; curlpp::Easy request1; curlpp::Easy request2; request1.setOpt(new curlpp::options::Url(url1)); request1.setOpt(new curlpp::options::Verbose(true)); request2.setOpt(new curlpp::options::Url(url2)); request2.setOpt(new curlpp::options::Verbose(true)); int nbLeft; curlpp::Multi requests; requests.add(&request1); requests.add(&request2); /* we start some action by calling perform right away */ while(!requests.perform(&nbLeft)) {}; while(nbLeft) { struct timeval timeout; int rc; /* select() return code */ fd_set fdread; fd_set fdwrite; fd_set fdexcep; int maxfd; FD_ZERO(&fdread); FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); /* set a suitable timeout to play around with */ timeout.tv_sec = 1; timeout.tv_usec = 0; /* get file descriptors from the transfers */ requests.fdset(&fdread, &fdwrite, &fdexcep, &maxfd); rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout); switch(rc) { case -1: /* select error */ nbLeft = 0; printf("select() returns error, this is badness\n"); break; case 0: /* timeout, do something else */ break; default: /* one or more of curl's file descriptors say there's data to read or write */ while(!requests.perform(&nbLeft)) {}; break; } } std::cout << "NB lefts: " << nbLeft << std::endl; /* See how the transfers went */ /* Multi::info returns a list of: std::pair< curlpp::Easy, curlpp::Multi::Info > */ curlpp::Multi::Msgs msgs = requests.info(); for(curlpp::Multi::Msgs::iterator pos = msgs.begin(); pos != msgs.end(); pos++) { if(pos->second.msg == CURLMSG_DONE) { /* Find out which handle this message is about */ if(pos->first == &request1) { printf("First request completed with status %d\n", pos->second.code); } else if(pos->first == &request2) { printf("Second request completed with status %d\n", pos->second.code); } } } } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_SUCCESS; } curlpp-0.8.1/examples/example15.cpp000066400000000000000000000035471305746442000171660ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Using options. * */ #include #include #include #include #include int main(int, char **) { try { curlpp::Cleanup myCleanup; // Creation of the URL option. curlpp::Easy myRequest; myRequest.setOpt(new curlpp::options::Url(std::string("https://example.com"))); myRequest.setOpt(new curlpp::options::SslEngineDefault()); myRequest.perform(); } catch( curlpp::RuntimeError &e ) { std::cout << e.what() << std::endl; } catch( curlpp::LogicError &e ) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example16.cpp000066400000000000000000000045621305746442000171650ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Simple POST demo. * */ #include #include #include #include #include #include int main(int argc, char *argv[]) { if(argc < 2) { std::cerr << argv[0] << ": Wrong number of arguments" << std::endl << "Usage: " << argv[0] << " url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; request.setOpt(new curlpp::options::Url(url)); request.setOpt(new curlpp::options::Verbose(true)); std::list header; header.push_back("Content-Type: application/octet-stream"); request.setOpt(new curlpp::options::HttpHeader(header)); request.setOpt(new curlpp::options::PostFields("abcd")); request.setOpt(new curlpp::options::PostFieldSize(5)); request.setOpt(new curlpp::options::UserPwd("user:password")); request.perform(); } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_SUCCESS; } curlpp-0.8.1/examples/example17.cpp000066400000000000000000000061511305746442000171620ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include struct MethodClass { private: MethodClass(); public: MethodClass(std::ostream * stream) : mStream(stream) , writeRound(0) {} // Helper Class for reading result from remote host size_t write(curlpp::Easy *handle, char* ptr, size_t size, size_t nmemb) { ++writeRound; curlpp::options::Url url; handle->getOpt(url); // Calculate the real size of the incoming buffer size_t realsize = size * nmemb; std::cerr << "write round: " << writeRound << ", url: " << url.getValue() << std::endl; mStream->write(ptr, realsize); // return the real size of the buffer... return realsize; }; // Public member vars std::ostream * mStream; unsigned writeRound; }; int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << argv[0] << ": Wrong number of arguments" << std::endl << argv[0] << ": Usage: " << " url " << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; MethodClass mObject(&std::cout); // Set the writer callback to enable cURL // to write result in a memory area using namespace std::placeholders; curlpp::options::WriteFunction *test = new curlpp::options::WriteFunction(std::bind(&MethodClass::write, &mObject, &request, _1, _2, _3)); request.setOpt(test); // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); request.perform(); return EXIT_SUCCESS; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_FAILURE; } curlpp-0.8.1/examples/example18.cpp000066400000000000000000000063561305746442000171720ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * WriteFunction using streams. * */ #include #include #include #include #include #include #include struct MethodClass { private: MethodClass(); public: MethodClass(std::ostream * stream) : mStream(stream) , writeRound(0) {} // Helper Class for reading result from remote host size_t write(curlpp::Easy *handle, char* ptr, size_t size, size_t nmemb) { ++writeRound; curlpp::options::Url url; handle->getOpt(url); // Calculate the real size of the incoming buffer size_t realsize = size * nmemb; std::cerr << "write round: " << writeRound << ", url: " << url.getValue() << std::endl; mStream->write(ptr, realsize); // return the real size of the buffer... return realsize; }; // Public member vars std::ostream * mStream; unsigned writeRound; }; int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << argv[0] << ": Wrong number of arguments" << std::endl << argv[0] << ": Usage: " << " url " << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; std::ostringstream myStream; MethodClass mObject(&myStream); // Set the writer callback to enable cURL // to write result in a memory area #ifdef HAVE_BOOST curlpp::options::BoostWriteFunction *test = new curlpp::options::BoostWriteFunction(boost::bind(&MethodClass::write, &mObject, &request, _1, _2, _3)); request.setOpt(test); #endif /* HAVE_BOOST */ // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); request.perform(); return EXIT_SUCCESS; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_FAILURE; } curlpp-0.8.1/examples/example19.cpp000066400000000000000000000047771305746442000172000ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Forms demo. * */ #include #include #include #include #include #include #include int main(int argc, char *argv[]) { if(argc < 2) { std::cerr << argv[0] << ": Wrong number of arguments" << std::endl << "Usage: " << argv[0] << " url" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; request.setOpt(new curlpp::options::Url(url)); //request.setOpt(new curlpp::options::Verbose(true)); { // Forms takes ownership of pointers! curlpp::Forms formParts; formParts.push_back(new curlpp::FormParts::Content("name1", "value1")); formParts.push_back(new curlpp::FormParts::Content("name2", "value2")); request.setOpt(new curlpp::options::HttpPost(formParts)); } // The forms have been cloned and are valid for the request, even // if the original forms are out of scope. std::ofstream myfile("/dev/null"); myfile << request << std::endl << request << std::endl; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_SUCCESS; } curlpp-0.8.1/examples/example20.cpp000066400000000000000000000043621305746442000171560ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Using WriteStream option. * */ #include #include #include #include #include #include int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << argv[0] << ": Wrong number of arguments" << std::endl << argv[0] << ": Usage: " << " url " << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; // Set the writer callback to enable cURL // to write result in a memory area request.setOpt(new curlpp::options::WriteStream(&std::cout)); // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); request.perform(); return EXIT_SUCCESS; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_FAILURE; } curlpp-0.8.1/examples/example21.cpp000066400000000000000000000050111305746442000171470ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Using ReadStream option. * */ #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { if(argc != 3) { std::cerr << "Example 2: Missing argument" << std::endl << "Example 2: Usage: example02 url string-to-send" << std::endl; return EXIT_FAILURE; } char *url = argv[1]; std::istringstream myStream(argv[2]); int size = myStream.str().size(); char buf[50]; try { curlpp::Cleanup cleaner; curlpp::Easy request; std::list< std::string > headers; headers.push_back("Content-Type: text/*"); sprintf(buf, "Content-Length: %d", size); headers.push_back(buf); using namespace curlpp::Options; request.setOpt(new Verbose(true)); request.setOpt(new ReadStream(&myStream)); request.setOpt(new InfileSize(size)); request.setOpt(new Upload(true)); request.setOpt(new HttpHeader(headers)); request.setOpt(new Url(url)); request.perform(); } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example22.cpp000066400000000000000000000043531305746442000171600ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * \file * Using options::Url as stream input. * */ #include #include #include #include #include #include int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << argv[0] << ": Wrong number of arguments" << std::endl << argv[0] << ": Usage: " << " url " << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); std::cout << request << std::endl; // Even easier version. It does the same thing // but if you need to download only an url, // this is the easiest way to do it. std::cout << curlpp::options::Url(url) << std::endl; return EXIT_SUCCESS; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_FAILURE; } curlpp-0.8.1/examples/example23.cpp000066400000000000000000000020031305746442000171470ustar00rootroot00000000000000/** * \file * Setting request options using iterators to custom container of curlpp options. * */ #include #include #include #include using namespace curlpp::options; int main(int, char **) { try { // That's all that is needed to do cleanup of used resources (RAII style). curlpp::Cleanup myCleanup; // Our request to be sent. curlpp::Easy myRequest; // Container of our choice with pointers to curlpp options. std::vector options; options.push_back(new Url("http://example.com")); options.push_back(new Port(80)); // Set all options in range to the Easy handle. myRequest.setOpt(options.begin(), options.end()); // Send request and get a result. // By default the result goes to standard output. myRequest.perform(); } catch(curlpp::RuntimeError & e) { std::cout << e.what() << std::endl; } catch(curlpp::LogicError & e) { std::cout << e.what() << std::endl; } return 0; } curlpp-0.8.1/examples/example24.cpp000066400000000000000000000062201305746442000171550ustar00rootroot00000000000000/* * Copyright (c) <2002-2005> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include struct MethodClass { private: MethodClass(); public: MethodClass(std::ostream * stream) : mStream(stream) , writeRound(0) {} // Helper Class for reading result from remote host size_t debug(curlpp::Easy *handle, curl_infotype type, char* ptr, size_t size) { ++writeRound; curlpp::options::Url url; handle->getOpt(url); // Calculate the real size of the incoming buffer std::cerr << "write round: " << writeRound << ", url: " << url.getValue() << ", type: " << type << std::endl; mStream->write(ptr, size); // return the real size of the buffer... return size; }; // Public member vars std::ostream * mStream; unsigned writeRound; }; int main(int argc, char *argv[]) { if(argc != 2) { std::cerr << argv[0] << ": Wrong number of arguments" << std::endl << argv[0] << ": Usage: " << " url " << std::endl; return EXIT_FAILURE; } char *url = argv[1]; try { curlpp::Cleanup cleaner; curlpp::Easy request; MethodClass mObject(&std::cerr); // Set the debug callback to enable cURL // to write result in a stream using namespace std::placeholders; curlpp::options::DebugFunction * test = new curlpp::options::DebugFunction(std::bind(&MethodClass::debug, &mObject, &request, _1, _2, _3)); request.setOpt(test); // Setting the URL to retrive. request.setOpt(new curlpp::options::Url(url)); request.setOpt(new curlpp::options::Verbose(true)); request.perform(); return EXIT_SUCCESS; } catch ( curlpp::LogicError & e ) { std::cout << e.what() << std::endl; } catch ( curlpp::RuntimeError & e ) { std::cout << e.what() << std::endl; } return EXIT_FAILURE; } curlpp-0.8.1/extras/000077500000000000000000000000001305746442000143405ustar00rootroot00000000000000curlpp-0.8.1/extras/CMakeLists.txt000066400000000000000000000032471305746442000171060ustar00rootroot00000000000000# extracting curlpp version text + version num file (READ ${CMAKE_CURRENT_SOURCE_DIR}/../include/curlpp/cURLpp.hpp CURLPP_VERSION_H_CONTENTS) string (REGEX MATCH "#define LIBCURLPP_VERSION \"[^\"]*" CURLPP_VERSION ${CURLPP_VERSION_H_CONTENTS}) string (REGEX REPLACE "[^\"]+\"" "" CURLPP_VERSION ${CURLPP_VERSION}) string (REGEX MATCH "#define LIBCURLPP_VERSION_NUM 0x[0-9a-fA-F]+" CURLPP_VERSION_NUM ${CURLPP_VERSION_H_CONTENTS}) string (REGEX REPLACE "[^0]+0x" "" CURLPP_VERSION_NUM ${CURLPP_VERSION_NUM}) message(STATUS "curlpp version=[${CURLPP_VERSION}]") message(STATUS "curlpp version num=[${CURLPP_VERSION_NUM}]") # curlpp-config needs the following options to be set. string(REPLACE "." "" libext "${CMAKE_STATIC_LIBRARY_SUFFIX}") set(CC "${CMAKE_C_COMPILER}") set(libdir "${CMAKE_INSTALL_LIBDIR}") set(libdir_static "${CMAKE_INSTALL_LIBDIR}") set(includedir "${CMAKE_INSTALL_INCLUDEDIR}") set(prefix "${CMAKE_INSTALL_PREFIX}") set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") # Finally generate a "curl-config" matching this config configure_file("${CMAKE_CURRENT_SOURCE_DIR}/curlpp-config.in" "${CMAKE_CURRENT_BINARY_DIR}/curlpp-config" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/curlpp-config" DESTINATION ${CMAKE_INSTALL_BINDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # Finally generate a pkg-config file matching this config configure_file("${CMAKE_CURRENT_SOURCE_DIR}/curlpp.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/curlpp.pc" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/curlpp.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) curlpp-0.8.1/extras/curlpp-config.in000066400000000000000000000032011305746442000174340ustar00rootroot00000000000000#! /bin/sh # # The idea to this kind of setup info script was stolen from numerous # other packages, such as neon, libxml and gnome. # # $Id: curlpp-config.in,v 1.4 2004/10/05 01:48:40 jpbl Exp $ # prefix=@prefix@ includedir=@includedir@ usage() { cat < Jun-21-2005 # # Checks for libcurl. DEFAULT-ACTION is the string yes or no to # specify whether to default to --with-libcurl or --without-libcurl. # If not supplied, DEFAULT-ACTION is yes. MINIMUM-VERSION is the # minimum version of libcurl to accept. Pass the version as a regular # version number like 7.10.1. If not supplied, any version is # accepted. ACTION-IF-YES is a list of shell commands to run if # libcurl was successfully found and passed the various tests. # ACTION-IF-NO is a list of shell commands that are run otherwise. # Note that using --without-libcurl does run ACTION-IF-NO. # # This macro defines HAVE_LIBCURL if a working libcurl setup is found, # and sets @LIBCURL@ and @LIBCURL_CPPFLAGS@ to the necessary values. # Other useful defines are LIBCURL_FEATURE_xxx where xxx are the # various features supported by libcurl, and LIBCURL_PROTOCOL_yyy # where yyy are the various protocols supported by libcurl. Both xxx # and yyy are capitalized. See the list of AH_TEMPLATEs at the top of # the macro for the complete list of possible defines. Shell # variables $libcurl_feature_xxx and $libcurl_protocol_yyy are also # defined to 'yes' for those features and protocols that were found. # Note that xxx and yyy keep the same capitalization as in the # curl-config list (e.g. it's "HTTP" and not "http"). # # Users may override the detected values by doing something like: # LIBCURL="-lcurl" LIBCURL_CPPFLAGS="-I/usr/myinclude" ./configure # # For the sake of sanity, this macro assumes that any libcurl that is # found is after version 7.7.2, the first version that included the # curl-config script. Note that it is very important for people # packaging binary versions of libcurl to include this script! # Without curl-config, we can only guess what protocols are available. AC_DEFUN([CURLPP_CHECK_CONFIG], [ LIBCURL_CHECK_CONFIG if test x"$LIBCURL" != "x" ; then AC_ARG_WITH(curlpp, AC_HELP_STRING([--with-curlpp=DIR],[look for the curlpp library in DIR]), [_curlpp_with=$withval],[_curlpp_with=ifelse([$1],,[yes],[$1])]) if test "$_curlpp_with" != "no" ; then AC_PROG_AWK _curlpp_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[[1]]+256*A[[2]]+A[[3]]; print X;}'" _curlpp_try_link=yes if test -d "$_curlpp_with" ; then CPPFLAGS="${CPPFLAGS} -I$withval/include" LDFLAGS="${LDFLAGS} -L$withval/lib" fi AC_PATH_PROG([_curlpp_config],[curlpp-config]) if test x$_curlpp_config != "x" ; then AC_CACHE_CHECK([for the version of curlpp], [curlpp_cv_lib_curlpp_version], [curlpp_cv_lib_curlpp_version=`$_curlpp_config --version | $AWK '{print $[]2}'`]) _curlpp_version=`echo $curlpp_cv_lib_curlpp_version | $_curlpp_version_parse` _curlpp_wanted=`echo ifelse([$2],,[0],[$2]) | $_curlpp_version_parse` if test $_curlpp_wanted -gt 0 ; then AC_CACHE_CHECK([for curlpp >= version $2], [curlpp_cv_lib_version_ok], [ if test $_curlpp_version -ge $_curlpp_wanted ; then curlpp_cv_lib_version_ok=yes else curlpp_cv_lib_version_ok=no fi ]) fi if test $_curlpp_wanted -eq 0 || test x$curlpp_cv_lib_version_ok = xyes ; then if test x"$CURLPP_CPPFLAGS" = "x" ; then CURLPP_CPPFLAGS=`$_curlpp_config --cflags` fi if test x"$CURLPP" = "x" ; then CURLPP=`$_curlpp_config --libs` fi else _curlpp_try_link=no fi unset _curlpp_wanted fi if test $_curlpp_try_link = yes ; then # we didn't find curl-config, so let's see if the user-supplied # link line (or failing that, "-lcurl") is enough. CURLPP=${CURLPP-"-lcurl"} AC_CACHE_CHECK([whether curlpp is usable], [curlpp_cv_lib_curlpp_usable], [ _curlpp_save_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $CURLPP_CPPFLAGS" _libcurl_save_libs=$LIBS LIBS="$LIBS $CURLPP" AC_LINK_IFELSE(AC_LANG_PROGRAM([#include ],[ /* Try and use a few common options to force a failure if we are missing symbols or can't link. */ int x; cURLpp::initialize(); ]),curlpp_cv_lib_curlpp_usable=yes,curlpp_cv_lib_curlpp_usable=no) CPPFLAGS=$_curlpp_save_cppflags LIBS=$_curlpp_save_libs unset _curlpp_save_cppflags unset _curlpp_save_libs ]) if test $curlpp_cv_lib_curlpp_usable = yes ; then AC_DEFINE(HAVE_CURLPP,1, [Define to 1 if you have a functional curlpp library.]) AC_SUBST(CURLPP_CPPFLAGS) AC_SUBST(CURLPP) fi fi unset _curlpp_try_link unset _curlpp_version_parse unset _curlpp_config unset _curlpp_feature unset _curlpp_features unset _curlpp_protocol unset _curlpp_protocols unset _curlpp_version fi if test x$_curlpp_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then # This is the IF-NO path ifelse([$4],,:,[$4]) else # This is the IF-YES path ifelse([$3],,:,[$3]) fi unset _curlpp_with fi ])dnl curlpp-0.8.1/extras/curlpp.pc.in000066400000000000000000000005651305746442000166040ustar00rootroot00000000000000# This is a comment prefix=@prefix@ exec_prefix=@prefix@ includedir=@includedir@ Name: curlpp Description: cURLpp is a libcurl C++ wrapper Version: @VERSION@ Libs: -L@libdir@ -lcurlpp @LDFLAGS@ @LIBS@ Cflags: -I@includedir@ @CURLPP_CXXFLAGS@ # libcurl is required as non-private because CurlHandle.inl uses curl_easy_setopt. Requires: libcurl curlpp-0.8.1/extras/curlpp.spec.in000066400000000000000000000054031305746442000171300ustar00rootroot00000000000000Summary: cURLpp is a libcurl C++ wrapper Name: cURLpp Version: @RPM_VERSION@ Release: 1 License: MIT Group: Development/Libraries URL: http://rrette.com/curlpp.html Source0: curlpp-@VERSION@.tar.gz BuildRoot: %{_tmppath}/curlpp-@VERSION@-%{release}-buildroot Requires: curl >= 7.10.0 %package devel Summary: The includes and libs to develop with cURLpp Group: Development/Libraries Requires: curl >= 7.10.0 Provides: curlpp-devel %description cURLpp is a libcurl C++ wrapper. There is the libcurl description: "libcurl is a free and easy-to-use client-side URL transfer library, supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and more! libcurl is highly portable, it builds and works identically on numerous platforms, including Solaris, Net/Free/Open BSD, Darwin, HPUX, IRIX, AIX, Tru64, Linux, Windows, Amiga, OS/2, BeOs, Mac OS X, Ultrix, QNX, OpenVMS, RISC OS and more... " %description devel This packages contains all the libs and headers to develop applications using cURLpp. %prep %setup -qn curlpp-@VERSION@ %build %configure make %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} make DESTDIR=%{buildroot} install %clean rm -rf %{buildroot} %post /sbin/ldconfig %postun /sbin/ldconfig %files %defattr(-,root,root) %{_libdir}/libcurlpp.so* %files devel %defattr(-,root,root) %attr(0755,root,root) %{_bindir}/curlpp-config %dir %{_includedir}/curlpp %{_includedir}/curlpp/*.hpp %{_includedir}/curlpp/*.inl %{_includedir}/curlpp/*.h %dir %{_includedir}/curlpp/utilspp %dir %{_includedir}/curlpp/utilspp/singleton %{_includedir}/curlpp/utilspp/singleton/*.hpp %{_includedir}/curlpp/utilspp/singleton/*.inl %dir %{_includedir}/utilspp %{_includedir}/utilspp/*.hpp %{_includedir}/utilspp/*.inl %dir %{_includedir}/utilspp/functor %{_includedir}/utilspp/functor/*.hpp %{_libdir}/libcurlpp.la %{_libdir}/libcurlpp.a %{_libdir}/pkgconfig/curlpp.pc %dir %changelog * Sun Jul 17 2005 Jean-Philippe Barrette-LaPierre - 0.5.1-1 - removed {%name} use * Wed Jan 5 2005 Jean-Philippe Barrette-LaPierre - 0.3.2-rc1-1 - Version depends now on configure script * Thu Sep 30 2004 Jean-Philippe Barrette-LaPierre 0.3.1-1 - Removed any utilspp reference. (Not used anymore) * Thu Jun 17 2004 Jean-Philippe Barrette-LaPierre 0.3.1-1 - Removed the unusefull BuildRequires * Mon Oct 20 2003 Jean-Philippe Barrette-LaPierre - 0.3.0-2 - Added the devel package * Wed Oct 15 2003 Jean-Philippe Barrette-LaPierre - 0.3.0-1 - Initial build. curlpp-0.8.1/include/000077500000000000000000000000001305746442000144555ustar00rootroot00000000000000curlpp-0.8.1/include/curlpp/000077500000000000000000000000001305746442000157625ustar00rootroot00000000000000curlpp-0.8.1/include/curlpp/Easy.hpp000066400000000000000000000107621305746442000174020ustar00rootroot00000000000000/* * Copyright (c) <2002-2009> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_EASY_HPP #define CURLPP_EASY_HPP #include "internal/CurlHandle.hpp" #include "internal/OptionList.hpp" #include "Option.hpp" #include namespace curlpp { /** * Easy class. * Detailed description. */ class Easy { public: friend struct InfoGetter; Easy(); /** * This allow to have a handle, which might have * some option set, but we don't care about them. */ Easy(std::unique_ptr handle); virtual ~Easy(); /** * it will call the curl_easy_perform function will all the options * previously set for this handle. */ void perform(); /** * This function will set the option value of the OptionBase * to the handle. */ virtual void setOpt(const OptionBase & option); /** * This function will set the option value of the OptionBase to the * handle. */ virtual void setOpt(std::unique_ptr option); /** * This function will set the option value of the OptionBase to the * handle. * * Note: be carefull when using this function, see * curlpp::OptionList::setOpt(OptionBase * option) function for more * details. */ virtual void setOpt(OptionBase * option); /** * This function will create OptionTrait class with the value given and call * virtual void setOpt(const OptionBase & option) with it. */ template void setOpt(typename OptionTrait::ParamType); /** * Setting options from custom container with curlpp options. */ template void setOpt(InputIterator first, InputIterator last); /** * This function will get the current option value of the corresponding * OptionBase. Note that if the option is not set, the option passed in * parameter will be cleared. (See Option::getOpt for more details) */ void getOpt(OptionBase * option) const; /** * This function will get the current option value of the corresponding * OptionBase. Note that if the option is not set, the option passed in * parameter will be cleared. (See Option::getOpt for more details) */ void getOpt(OptionBase & option) const; /** * Get all options. */ //template //void getOptions(OutputIterator out); /* * This function empties the option collection and reset all options * to their default value */ virtual void reset (); /** * This function will return the cURL * handle. * DO NOT use this, unless you REALLY know what you * are doing. */ CURL * getHandle() const; internal::CurlHandle & getCurlHandle() { return *mCurl; } const internal::CurlHandle & getCurlHandle() const { return *mCurl; } private: /** * This function will call the setOpt on each options * contained by * the option list passed in argument. */ virtual void setOpt(const internal::OptionList & options); /** * This is the function that curlpp::InfoGetter will call * to retreive option. */ template void getInfo(CURLINFO info, T & value) const; std::unique_ptr mCurl; internal::OptionList mOptions; }; } // namespace curlpp namespace cURLpp = curlpp; #include "Easy.inl" // Not quite sure if we shouldn't pass a const handle and clone it instead. std::ostream & operator<<(std::ostream & stream, const curlpp::Easy & handle); #endif // #ifndef CURLPP_EASY_HPP curlpp-0.8.1/include/curlpp/Easy.inl000066400000000000000000000032431305746442000173710ustar00rootroot00000000000000/* * Copyright (c) <2002-2006> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ template void curlpp::Easy::getInfo(CURLINFO info, T & value) const { mCurl->getInfo(info, value); } template void curlpp::Easy::setOpt(typename OptionTrait::ParamType value) { setOpt(curlpp::OptionTrait(value)); } template void curlpp::Easy::setOpt(InputIterator first, InputIterator last) { for(InputIterator it=first; it != last; ++it) { setOpt(*it); } } curlpp-0.8.1/include/curlpp/Exception.hpp000066400000000000000000000160501305746442000204330ustar00rootroot00000000000000/* * Copyright (c) <2002-2009> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_EXCEPTION_HPP #define CURLPP_EXCEPTION_HPP #include #include #include namespace curlpp { /** * This class is a parent to all curlpp's RuntimeErrors. * * This class takes a const std::string & as argument for it's parent: std::runtime_errors. * This class is thrown when curlpp is encountering an error, but for runtime * considerations, "unpredictable" by the library user. */ class RuntimeError : public std::runtime_error { public: RuntimeError(const char * reason); RuntimeError(const std::string & string); virtual ~RuntimeError() throw(); }; /** * This class is a parent to all curlpp's RuntimeErrors. * * This class takes a const std::string & as argument for it's parent: std::runtime_errors. * This class is thrown when curlpp is encountering an error, but for logic * considerations, "predictable" by the library user. Predictable means * that the library user is missusing the library. */ class LogicError : public std::logic_error { public: LogicError(const char * reason); LogicError(const std::string & string); virtual ~LogicError() throw(); }; /** * This is a class derived from curlpp::RuntimeError. * * It takes a const char * and a CURLcode as arguments. This class is thrown when libcurl is * returning an error with a CURLcode, but for runtime considerations, * "unpredictable" by the library user. */ class LibcurlRuntimeError : public curlpp::RuntimeError { public: LibcurlRuntimeError(const std::string & reason, CURLcode code); LibcurlRuntimeError(const char * reason, CURLcode code); /** * Returns the CURLcode that libcurl returned. */ CURLcode whatCode() const throw(); private: CURLcode mCode; }; /* * This is a class derived from curlpp::LogicError, that takes a const * char * and a CURLcode as arguments. This class is thrown when libcurl is * returning an error with a CURLcode, but for logic considerations, * "predictable" by the library user. Predictable means that the library * user is missusing the library. */ class LibcurlLogicError : public curlpp::LogicError { public: LibcurlLogicError(const std::string & reason, CURLcode code); LibcurlLogicError(const char * reason, CURLcode code); /* * return the CURLcode that libcurl returned */ CURLcode whatCode() const throw(); private: CURLcode mCode; }; /** * This exception is thrown when you try to retreive a value for an * unset option. */ class UnsetOption : public curlpp::RuntimeError { public: UnsetOption(const std::string & reason); UnsetOption(const char * reason); }; /** * This exception is thrown when you try to instantiate an option * that isn't available for your current libcURL version. */ class NotAvailable : public curlpp::LogicError { public: NotAvailable(); }; /** * This exception is thrown when an exception is thrown within * a callback without the curlpp::raiseException function. */ class UnknowException : public curlpp::RuntimeError { public: UnknowException(); }; /** * This exception is thrown by the curlpp::raiseException function. * It's used to throw exceptions within callbacks */ class CallbackExceptionBase : public curlpp::RuntimeError { protected: CallbackExceptionBase(); CallbackExceptionBase(const CallbackExceptionBase & other); public: virtual void throwMe() = 0; virtual CallbackExceptionBase * clone() = 0; }; /** * This exception is thrown by the curlpp::raiseException function. * It's used to throw exceptions within callbacks */ template class CallbackException : public CallbackExceptionBase { public: typedef CallbackException _CE; CallbackException(const ExceptionType & e) : mException(e) {} virtual void throwMe() { throw mException; } virtual _CE * clone() { return new _CE(*this); } private: ExceptionType mException; }; /** * This function is the function to be called within callbacks * if you want an exception to be thrown at the * curlpp::Easy::perform function call level. */ template void raiseException(const T & e) { throw (CallbackExceptionBase *)(new CallbackException(e)); } template CallbackException * createCallbackException(const T & e) { return CallbackException(e); } /** * if CURLcode is not equal to CURLE_OK, it throws a * curlpp::LibcurlRuntimeError with the reason and the code. It's used * in inline function, because throwing an exception is heavy in binary * code, something we don't want in inline functions. */ void libcurlRuntimeAssert(const std::string & reason, CURLcode code); void libcurlRuntimeAssert(const char * reason, CURLcode code); /** * if CURLcode is not equal to CURLE_OK, it throws a * curlpp::LibcurlLogicError with the reason and the code. It's used * in inline function, because throwing an exception is heavy in binary * code, something we don't want in inline functions. */ void libcurlLogicAssert(const std::string & reason, CURLcode code); void libcurlLogicAssert(const char * reason, CURLcode code); /** * if isOkay is false, it throws a curlpp::RuntimeError * with the reason. It's used in inline function, because throwing * an exception is heavy in binary code, something we don't want in * an inline function. */ void runtimeAssert(const std::string & reason, bool isOkay); void runtimeAssert(const char * reason, bool isOkay); /** * if is_true is false, it throws a curlpp::LogicError with * the reason. It's used in inline function, because throwing * an exception is heavy in binary code, something we don't * want in an inline function. */ void logicAssert(const std::string & reason, bool isOkay); void logicAssert(const char * reason, bool isOkay); } // namespace curlpp namespace cURLpp = curlpp; #endif // #ifndef CURLPP_EXCEPTION_HPP curlpp-0.8.1/include/curlpp/Form.hpp000066400000000000000000000131341305746442000174000ustar00rootroot00000000000000/* * Copyright (c) <2002-2009> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_FORM_HPP #define CURLPP_FORM_HPP #include #include #include #include namespace curlpp { class FormPart; typedef std::list > Forms; /** * This class is used internally to wrap over curl_httppost * class. */ class HttpPost { public: HttpPost(const Forms & posts); HttpPost(); ~HttpPost(); /** * initialize the HTTP post with the list of forms. The Forms * will be cloned. */ HttpPost & operator=(const Forms & posts); operator Forms() { return getList(); } /** * return the curl_httppost representation of this HTTP Post. * Be aware that the memory return is owned by the current * instance, so don't try to delete it. */ ::curl_httppost * cHttpPost() const; /** * Free all HTTP posts. */ void clear(); /** * Get the list. */ Forms getList(); private: ::curl_httppost * mFirst; ::curl_httppost * mLast; Forms mForms; }; /** * This class is the base representation of a post. You need * to inherit from it to define a type of post. */ class FormPart { friend class HttpPost; public: /** * initialize the FormPart. "name" is the name of the field. */ FormPart(const char * name); /** * initialize the FormPart. "name" is the name of the field. */ FormPart(const std::string & name); virtual ~FormPart(); virtual FormPart * clone() const = 0; protected: /** * it will add himself to the curl_httppost * first. */ virtual void add(::curl_httppost ** first, ::curl_httppost ** last) = 0; /** * Contain the name of the field. */ const std::string mName; }; namespace FormParts { /** * This class is a file post. It will send a file in the * HTTP post. */ class File : public FormPart { public: /** * initialize a File part. "name" is the name of the field. * "filename" is the string that holds the filename. */ File(const char * name, const char * filename); /** * initialize a File part. "name" is the name of the field. * "filename" is the string that holds the filename. * "contentType" is the MIME type of the file. */ File(const char * name, const char * filename, const char * contentType); /** * initialize a File part. "name" is the name of the field. * "filename" is the string that holds the filename. */ File(const std::string & name, const std::string & filename); /** * initialize a File part. "name" is the name of the field. * "filename" is the string that holds the filename. * "contentType" is the MIME type of the file. */ File(const std::string & name, const std::string & filename, const std::string & contentType); virtual ~File(); /** * This function will return a copy of the instance. */ virtual File * clone() const; private: void add(::curl_httppost ** first, ::curl_httppost ** last); private: const std::string mFilename; const std::string mContentType; }; /** * This class is a file post. It will send a file in the * HTTP post. */ class Content : public FormPart { public: /** * initialize a Content part. "name" is the name of the field. * "content" is the string that holds the filename. */ Content(const char * name, const char * content); /** * initialize a Content part. "name" is the name of the field. * "content" is the string that holds the filename. * "contentType" is the MIME type of the file. */ Content(const char * name, const char * content, const char * contentType); /** * initialize a Content part. "name" is the name of the field. * "content" is the string that holds the content. */ Content(const std::string & name, const std::string & content); /** * initialize a Content part. "name" is the name of the field. * "content" is the string that holds the content. * "content_type" is the MIME type of the file. */ Content(const std::string & name, const std::string & content, const std::string & content_type); virtual ~Content(); /** * This function will return a copy of the instance. */ virtual Content * clone() const; private: void add(::curl_httppost ** first, ::curl_httppost ** last); private: const std::string mContent; const std::string mContentType; }; } // namespace FormParts } // namespace curlpp namespace cURLpp = curlpp; #endif //CURLPP_FORM_HPP curlpp-0.8.1/include/curlpp/Info.hpp000066400000000000000000000063331305746442000173730ustar00rootroot00000000000000/* * Copyright (c) <2002-2009> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_INFO_HPP #define CURLPP_INFO_HPP #include "Easy.hpp" namespace curlpp { /** * This class is responsible of retreiving the Info from * a handle. This is the class you use when you want to do * so. */ template struct Info { static void get(const curlpp::Easy & handle, T & value); static T get(const curlpp::Easy & handle); }; /** * This class is used when an info is not available for the * current libcURL version. */ template struct NotAvailableInfo : Info { static void get(const curlpp::Easy & handle, T & value); static T get(const curlpp::Easy & handle); }; /** * This is the class you need to specialize if you use * a special type that libcURL is not aware of. This class * need to call curlpp::InfoGetter::get function. See * curlpp::InfoGetter for more information. */ template struct InfoTypeConverter { static void get(const curlpp::Easy & handle, CURLINFO info, T & value); }; template<> void InfoTypeConverter ::get(const curlpp::Easy & handle, CURLINFO info, std::string & value); template<> void InfoTypeConverter > ::get(const curlpp::Easy & handle, CURLINFO info, std::list & value); template<> void InfoTypeConverter ::get(const curlpp::Easy & handle, CURLINFO info, long & value); template<> void InfoTypeConverter ::get(const curlpp::Easy & handle, CURLINFO info, double & value); /** * This is the only class that is authorized to retreive * info from a curlpp::Easy class. So, this is the class * you need to use when you specialize the class * curlpp::InfoTypeConverter. This class is in fact used * as a proxy, just to be sure that nobody access curlpp::Easy's * private data. */ struct InfoGetter { template static void get(const curlpp::Easy & handle, CURLINFO info, T & value); }; } // namespace curlpp namespace cURLpp = curlpp; #include "Info.inl" #endif // #ifndef CURLPP_INFO_HPP curlpp-0.8.1/include/curlpp/Info.inl000066400000000000000000000043071305746442000173650ustar00rootroot00000000000000/* * Copyright (c) <2002-2006> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_INFO_INL #define CURLPP_INFO_INL template void curlpp::Info::get(const curlpp::Easy & handle, T & value) { curlpp::InfoTypeConverter::get(handle, info, value); } template T curlpp::Info::get(const curlpp::Easy & handle) { T value; curlpp::InfoTypeConverter::get(handle, info, value); return value; } template void curlpp::NotAvailableInfo::get(const curlpp::Easy &, T &) { throw curlpp::NotAvailable(); } template T curlpp::NotAvailableInfo::get(const curlpp::Easy &) { throw curlpp::NotAvailable(); } template void curlpp::InfoGetter::get(const curlpp::Easy & handle, CURLINFO info, T & value) { handle.getInfo(info, value); } template void curlpp::InfoTypeConverter::get(const curlpp::Easy & handle, CURLINFO info, T & value) { InfoGetter::get(handle, info, value); } #endif curlpp-0.8.1/include/curlpp/Infos.hpp000066400000000000000000000073331305746442000175570ustar00rootroot00000000000000/* * Copyright (c) <2002-2009> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_INFOS_HPP #define CURLPP_INFOS_HPP #include "Info.hpp" #include #include namespace curlpp { namespace infos { typedef curlpp::Info EffectiveUrl; typedef curlpp::Info ResponseCode; typedef curlpp::Info HttpConnectCode; typedef curlpp::Info FileTime; typedef curlpp::Info TotalTime; typedef curlpp::Info NameLookupTime; typedef curlpp::Info ConnectTime; typedef curlpp::Info PreTransferTime; typedef curlpp::Info StartTransferTime; typedef curlpp::Info RedirectTime; typedef curlpp::Info RedirectCount; typedef curlpp::Info SizeUpload; typedef curlpp::Info SizeDownload; typedef curlpp::Info SpeedDownload; typedef curlpp::Info SpeedUpload; typedef curlpp::Info HeaderSize; typedef curlpp::Info RequestSize; typedef curlpp::Info SslVerifyResult; #if LIBCURL_VERSION_NUM >= 0x070c03 typedef curlpp::Info > SslEngines; #endif typedef curlpp::Info ContentLengthDownload; typedef curlpp::Info ContentLengthUpload; typedef curlpp::Info ContentType; typedef curlpp::Info HttpAuthAvail; typedef curlpp::Info ProxyAuthAvail; #if LIBCURL_VERSION_NUM >= 0x070c02 typedef curlpp::Info OsErrno; #endif #if LIBCURL_VERSION_NUM >= 0x070c03 typedef curlpp::Info NumConnects; #endif #if LIBCURL_VERSION_NUM >= 0x070e01 typedef curlpp::Info > CookieList; #else #ifdef CURLPP_ALLOW_NOT_AVAILABLE // This curlinfo text must be specified, so we specify something // that we know will be there. typedef curlpp::NotAvailableInfo > CookieList; #endif #endif } // namespace infos namespace Infos = infos; } // namespace curlpp namespace cURLpp = curlpp; #endif // #ifndef CURLPP_INFOS_HPP curlpp-0.8.1/include/curlpp/Multi.hpp000066400000000000000000000037031305746442000175700ustar00rootroot00000000000000/* * Copyright (c) <2002-2009> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_MULTI_HPP #define CURLPP_MULTI_HPP #include #include #include namespace curlpp { class Easy; class Multi { public: struct Info { CURLcode code; CURLMSG msg; }; public: Multi(); ~Multi(); void add(const curlpp::Easy * handle); void remove(const curlpp::Easy * handle); bool perform(int * nbHandles); void fdset(fd_set * read_fd_set, fd_set * write_fd_set, fd_set * exc_fd_set, int * max_fd); typedef std::list > Msgs; Msgs info(); private: CURLM * mMultiHandle; std::map mHandles; }; } // namespace curlpp namespace cURLpp = curlpp; #endif // #ifndef CURLPP_MULTI_HPP curlpp-0.8.1/include/curlpp/Option.hpp000066400000000000000000000152411305746442000177460ustar00rootroot00000000000000/* * Copyright (c) <2002-2009> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_OPTION_HPP #define CURLPP_OPTION_HPP #include "internal/OptionContainer.hpp" #include "OptionBase.hpp" namespace curlpp { class Easy; /** * This class is representing an option that you set on a class. * * We use utilspp::pointer_on_member_function and utilspp::type_trait to simplify * the declaration of an option object. */ template class Option : public curlpp::OptionBase { public: typedef OT OptionType; typedef typename internal::OptionContainer::ParamType ParamType; typedef typename internal::OptionContainer::ValueType ValueType; typedef typename internal::OptionContainer::ReturnType ReturnType; typedef typename internal::OptionContainer::HandleOptionType HandleOptionType; protected: /** * The constructor takes the a value to set a handle. */ Option(CURLoption option, typename Option::ParamType value); /** * The construction will copy the value of the Option passed in argument. */ Option(const Option & other); /** * The constructor will contain an unset option value. * Note that if you try to retreive the value of this option * before calling the curlpp::Option::setValue function it will * throw a UnsetOption exception. */ Option(CURLoption option); public: /** * What can I say? Everyone is dying one time or another... */ virtual ~Option(); /** * This function will set the value that will be set on handle when we * will call the "update" function on a handle. */ void setValue(typename Option::ParamType value); /** * This function will return the value that this option was set to. * * Note: if you didn't set any value by the curlpp::Option::setValue function, * or the handle option value, retreived by the curlpp::Option::updateMeToHandle * function, is a unset value, it will throw a UnsetOption exception. */ typename Option::ReturnType getValue() const; /** * This function will reset the option value. That means that if you try to * retreive the value of this option, or if you try to set this option to a * handle, it will throw an UnsetOption exception. */ virtual void clear(); /** * Will update the value of the option with the value of the * option passed is argument. */ virtual void updateMeToOption(const OptionBase & other); private: /** * This function will update the given handle to the value previously set, * by the curlpp::Option::setValue function. */ void setOpt(curlpp::Easy * handle) const; /** * This function will update the current value of the option to the handle * option value. */ void getOpt(curlpp::Easy * handle); protected: /** * the class that actually have the value. */ typename curlpp::internal::OptionContainer * mContainer; }; /** * This class is just a wrapper around curlpp::Option, in order to * be able to typedef Options. */ template class OptionTrait : public Option { friend class Easy; public: static const CURLoption option = opt; /** * The constructor takes the a value to set a handle. */ OptionTrait(typename Option::ParamType value); /** * The constructor will contain an unset option value. * Note that if you try to retreive the value of this option * before calling the curlpp::Option::setValue function it will * throw a UnsetOption exception. */ OptionTrait(); /** * Return a copy of the current option. * Note that the option value is copied too. */ virtual OptionTrait * clone() const; private: /** * will call the actual libcurl option function with the value we got * on the handle. */ virtual void updateHandleToMe(internal::CurlHandle * handle) const; }; /** * This class is just a wrapper around curlpp::OptionTrait, in order to * be able to have "No value" option, like SslDefaultEngine. */ template class NoValueOptionTrait : public OptionTrait { public: NoValueOptionTrait(); /** * Return a copy of the current option. * Note that the option value is copied too. */ virtual NoValueOptionTrait * clone() const; }; /** * This class is used when the option is not implemented. */ template class NotAvailableOptionTrait : public Option { public: /** * The constructor takes the a value to set a handle. */ NotAvailableOptionTrait(typename Option::ParamType value); /** * The constructor will contain an unset option value. * Note that if you try to retreive the value of this option * before calling the curlpp::Option::setValue function it will * throw a UnsetOption exception. */ NotAvailableOptionTrait(); /** * Return a copy of the current option. * Note that the option value is copied too. */ virtual NotAvailableOptionTrait * clone() const; private: /** * will call the actual libcurl option function with the value we got * on the handle. */ virtual void updateHandleToMe(internal::CurlHandle * handle) const; }; } // namespace curlpp namespace cURLpp = curlpp; #include "Option.inl" #endif // #ifndef CURLPP_OPTION_HPP curlpp-0.8.1/include/curlpp/Option.inl000066400000000000000000000113501305746442000177360ustar00rootroot00000000000000/* * Copyright (c) <2002-2006> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (curlpp), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CURLPP_OPTION_INL #define CURLPP_OPTION_INL #include "internal/OptionSetter.hpp" #include "Exception.hpp" #include namespace curlpp { // Option template Option::Option(CURLoption option, typename Option::ParamType value) : OptionBase(option), mContainer(NULL) { setValue(value); } template Option::Option(CURLoption option) : OptionBase(option), mContainer(NULL) {} template Option::Option(const Option & other) : OptionBase(other) , mContainer(NULL) { if(other.mContainer != NULL) { setValue(other.getValue()); } } template Option::~Option() { delete mContainer; mContainer = NULL; } template void Option::setValue(typename Option::ParamType value) { if(mContainer == NULL) { mContainer = new internal::OptionContainer(value); } else { mContainer->setValue(value); } } template void Option::updateMeToOption(const OptionBase & other) { const Option * option = dynamic_cast *>(&other); if(option == NULL) { throw UnsetOption("You are trying to update an option to an incompatible option"); } setValue(option->getValue()); } template void Option::clear() { delete mContainer; mContainer = NULL; } template typename Option::ReturnType Option::getValue() const { if(mContainer == NULL) throw UnsetOption("You are trying to retreive the value of an unset option"); return mContainer->getValue(); } // OptionTrait template OptionTrait::OptionTrait(typename Option::ParamType value) : Option(option, value) {} template OptionTrait::OptionTrait() : Option(option) {} template OptionTrait * OptionTrait::clone() const { return new OptionTrait(this->getValue()); } template void OptionTrait::updateHandleToMe(internal::CurlHandle * handle) const { if(this->mContainer == NULL) { throw UnsetOption("You are trying to set an unset option to a handle"); } internal::OptionSetter::setOpt(handle, this->mContainer->getHandleOptionValue()); } // NoValueOptionTrait template NoValueOptionTrait