diff --git a/.gitignore b/.gitignore index 58b65e8..4bfae4e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,29 +7,11 @@ *.dylib *.lai Makefile -Makefile.in +*~ +build/ m4/ -aclocal.m4 -aclocal.m4.bak -autom4te.cache/ -compile -configure -config.guess -config.log -config.status -config.sub -curlpp-config -curlpp.pc -curlpp.spec -depcomp -include/curlpp/config.h -include/curlpp/config.h.in -include/curlpp/stamp-h1 -install-sh -libtool -ltmain.sh -missing +CMakeFiles/ examples/example01 examples/example02 @@ -57,5 +39,6 @@ examples/example23 examples/example24 examples/example25 - -*.exe \ No newline at end of file +*.exe +CMakeCache.txt + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7550648 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,54 @@ +language: 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 \ No newline at end of file diff --git a/CHANGES b/CHANGES deleted file mode 100644 index 3ce952e..0000000 --- a/CHANGES +++ /dev/null @@ -1,186 +0,0 @@ -Changes from version 0.7.2 to 0.7.3 -- We now release exception handler after throwing the exeception (no more memory leak) -- Added binded method functor for DebugFuntion example -- gcc-4.3 compilation fixes -- Massive work has been done on MS Visual Studio project files -- File structure has been changed - -Changes from version 0.7.1 to 0.7.2 -- Added utility functions. (operator<< overloading for std::ostreams) -- Added global.h to distribution -- Removed config.h usage -- Took Jeff Ye changes for the curlpp.spec -- Namespace semicolon fix provided by Joerg. -- mErrorBuffer memset problem fixed - (Thanks to Graziano Giuliani) -- Fixed HttpPost problem (https://www.rrette.com/pipermail/curlpp/2007-February/000273.html) - (Thanks to Gazi Alankus) -- Fixed utilspp::clone_ptr bug (Thanks to Piotr Niemcunowicz) -- Fixed cURLpp::Multi bug (Thanks to Piotr Niemcunowicz) -- Fixed missing entry in utilspp/Makefile.am. -- Fixed Forms (HttpPost) memory leak. -- Fixed missing specialization declaration in InfoTypeConverter. - (Thanks to Ryan Allen for bug report) -- Fixed possible memory corruption for Easy::operator<< function. - -Changes from version 0.7.0 to 0.7.1-pre1 -- Fixed Functor arguments binding. -- Enabled example 10. -- Added make_functor function (see example10). -- WriteData is now called WriteFile. -- Disabled buggy WriteStream. -- Added boost.function (http://www.boost.org) feature. -- Added example17 (binded method functor). -- Added example18 (boost binded method function). - -Changes from version 0.7.0-pre2 to 0.7.0 -- Added some missing options (some unavailable CURLOPT) (thanks to Armel Asselin) -- Fixed Options for Quote/PreQuote/PostQuote (was long, now is std::list). (thanks to Armel Asselin) -- Added cURLpp::Easy::reset. (thanks to Armel Asselin) -- Fixed wrong cURLpp::Easy::InfoGetter declaration (struct/class mix). (thanks to Armel Asselin) -- Added implementation for long and double Info. (thanks to Armel Asselin) -- cURLpp::Multi removes the easy handles remaining inside itself when destroyed (allows nice handling of exceptions when a Multi is involved). (thanks to Armel Asselin) -- Added example 16. - -Changes from version 0.7.0-pre1 to 0.7.0-pre2 -- Added the NotAvailable feature. If CURLPP_ALLOW_NOT_AVAILABLE is - defined, it allow us to compile code not available for the current - libcURL version. -- Added the NoValueOptionTrait. This will allow options with no values, - as CURLOPT_SSLENGINE_DEFAULT, for instance. -- Fixed the missing msvc makefiles in source distribution. -- Fixed some gcc 3.2 compilation fixes (MaHo) -- Updated MSVC makefiles for new examples and for Multi integration. -- Better Multi interface error handling. - -Changes from version 0.6.1 to 0.7.0-pre1 -- Added Multi interface - -Changes from version 0.6.0 to 0.6.1 -- automake-1.9 is now required for the AMD64 aclocal changes -- Some libcURL version check added for Infos.hpp - -Changes from version 0.6.0-pre5 to 0.6.0 -- SList bug fixed. - -Changes from version 0.6.0-pre4 to 0.6.0-pre5 -- CookieList is no longer experimental code. -- Added example 12 (HTTP POST). -- Fixed example 11 binary file "bug". -- Added win32 examples's Makefile for VC++. -- Added README.win32. - -Changes from version 0.6.0-pre3 to 0.6.0-pre4 -- Added some patches for MS VC++ compiling. (Giuseppe "Cowo" Corbelli) -- Changed year of copyright -- Added examples 10 and 11 - -Changes from version 0.6.0-pre2 to 0.6.0-pre3 -- Fixed the missing utilspp files in the source distribution. - -Changes from version 0.6.0-pre1 to 0.6.0-pre2 -- Fixed the missing files in the Makefile.am - -Changes from version 0.5.2 to 0.6.0-pre1 -- Added Functor feature. -- Removed the Easy::print function. -- Added GetInfo feature. -- Removed the cURL namespace. -- Updated the copyright year. -- Added the CURLOPT_COOKIELIST patch from Peter Krumins. - This patch need to be enabled by the --enable-maintener. - -Changes from version 0.5.1 to 0.5.2 -- RPM fixes. -- Updated the documentation related to the exception safe feature. -- cURLpp::Options::PostFieldSize is now a long, and - cURLpp::Options::PostFieldSizeLarge is now a cURL::curl_off_t - (thanks to Nicolas Le Goff) -- Now we can build with MinGW. -- Improved libcURL test. -- Added the BUILDING_CURLPP Define (DLL building). - -Changes from version 0.5.0 to 0.5.1 -- cURLpp::Options::HttpGet and cURLpp::Options::CookieSession are now - using bool values. (thanks to Peteris Krumins) - -Changes from version 0.5.0-rc7 to 0.5.0 -- Removed the "string" way to handle memory. -- Another patch to be able to compile on Sun's WorkShop C - and C++ compilers, version 6. (Thanks to Ben Golding - ) - -Changes from version 0.5.0-rc6 to 0.5.0-rc7 -- Removed the AC_DISABLE_STATIC in configure script. -- Added the example05.cpp -- Now we can compile it with GCC-2.95 -- Added the cURLpp::Easy::getHandle function. - -Changes from version 0.5.0-rc5 to 0.5.0-rc6 -- Updated namespace problems in example04.cpp. -- Fixed the VC++ "Release (dynamic)" configuration. -- Patch to be able to compile on Sun's WorkShop C - and C++ compilers, version 6. (Thanks to Ben Golding - ) -- Added an option to disable gcc warnings option. - -Changes from version 0.5.0-rc4 to 0.5.0-rc5 -- Compilation fix for OptionSetter specialization of HTTPPOST. - (Thanks to Glenn ) -- Compilation fix for CXXFLAGS (-0 option glitch). - (Thanks to Glenn ) -- Fixed some presentation errors in the guide. -- The Visual Studio .NET 2003 project is now available. -- The MingGW cross-compiling scripts are now updated to - work on debian. - -Changes from version 0.5.0-rc3 to 0.5.0-rc4 -- Added cross-compiling scripts for mingw. -- Fixed a compilation error for VC++ .NET - (Thanks to Hoef Jan ) - -Changes from version 0.5.0-rc2 to 0.5.0-rc3 -- Fixed a gcc 3.4 compilation error. - (see http://www.dis.com/gnu/gcc/Name-lookup.html for more details). - (Thanks to Gisle Vanem) - -Changes from version 0.5.0-rc1 to 0.5.0-rc2 -- Added missing EXTRA_DIST files. -- Fixed a namespace problem in Form.hpp. -- Added VC++ project files - -Changes from version 0.3.1(branch point) to 0.5.0-rc1 -- Took the curlpp.spec.in from the 0.3.x versions. -- Added HttpPost specialization class. -- Moved source files from "src/curlpp/" to "curlpp/". -- The libcurl interface is now included in the - cURL namespace. -- Renamed the class Curl to CurlHandle. -- Removed CurlFactory system because it wasn't thread safe. -- Fixed the latex bug in the guide. -- Text formating in the guide. -- Added cURL.hpp -- Fixed a bug in OptionList.cpp that caused and endless loop. -- Added StorageOption class. -- Added example04 in maintener examples. -- Added TypeTrait.hpp -- Patched a minor grammatical error and a spelling error in the - documentation. Thanks to: - Jonathan Wakely -- Patched documentation's spelling errors. Thanks to: - Paul Lacy , - Jonathan Wakely -- Removed broken examples. -- Added example03.cpp (for verbose callback) -- Applied a patch from Glenn Washburn - for configure.ac -- example02.cpp doesn't refer to example18 anymore. -- Worked on the guide. -- Changed the OptionContainerType policy for the std::string. - It could eventually cause a memory corruption. -- Fixed a memory leak in SList. -- Slist is now usable for std::list< std::string > options. -- Added some missing simple options. -- Started to work on the new guide. -- Added the SList class (C++ wrapper over curl_slist). -- non_copyable class now respect naming conventions. diff --git a/CMakeLists.txt b/CMakeLists.txt index fa5b625..6754ed3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,21 @@ project(curlpp) -cmake_minimum_required(VERSION 3.0) + +if(WIN32) + # cmake 3.4 is required for CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS + cmake_minimum_required(VERSION 3.4) +else() + cmake_minimum_required(VERSION 3.0) +endif() + +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) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin") +set(CURLPP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(CURLPP_BINARY_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + ######################################################################################### # Root folders @@ -19,6 +35,8 @@ message(STATUS "\tInputs of type .h and .hpp at: ${IncludeFolder}") set(ExamplesFolder ${ProjectRootDir}examples/) message(STATUS "\tInputs to be built as standalone examples are at: ${ExamplesFolder}") +add_subdirectory(extras) + ######################################################################################### # For more verbose displays function(DisplayList Header ListToShow) @@ -30,103 +48,14 @@ endfunction(DisplayList) ######################################################################################### # File Lists -set(HeaderFileList - ${IncludeFolder}utilspp/EmptyType.hpp - ${IncludeFolder}utilspp/singleton/LifetimeWithLongevity.hpp - ${IncludeFolder}utilspp/singleton/SingletonHolder.hpp - ${IncludeFolder}utilspp/singleton/LifetimeLibrary.hpp - ${IncludeFolder}utilspp/singleton/CreationStatic.hpp - ${IncludeFolder}utilspp/singleton/CreationUsingNew.hpp - ${IncludeFolder}utilspp/singleton/LifetimeDefault.hpp - ${IncludeFolder}utilspp/singleton/PrivateMembers.hpp - ${IncludeFolder}utilspp/NullType.hpp - ${IncludeFolder}utilspp/ThreadingSingle.hpp - ${IncludeFolder}utilspp/Singleton.hpp - ${IncludeFolder}utilspp/TypeTrait.hpp - ${IncludeFolder}utilspp/clone_ptr.hpp - ${IncludeFolder}utilspp/functor/MemFunHandler.hpp - ${IncludeFolder}utilspp/functor/FunctorHandler.hpp - ${IncludeFolder}utilspp/functor/Binder.hpp - ${IncludeFolder}utilspp/functor/FunctorImpl.hpp - ${IncludeFolder}utilspp/functor/Functor.hpp - ${IncludeFolder}utilspp/TypeList.hpp - ${IncludeFolder}utilspp/NonCopyable.hpp - ${IncludeFolder}utilspp/SmartPtr.hpp - ${IncludeFolder}utilspp/ThreadingFactoryMutex.hpp - ${IncludeFolder}utilspp/Functors.hpp - ${IncludeFolder}curlpp/Exception.hpp - ${IncludeFolder}curlpp/Option.hpp - ${IncludeFolder}curlpp/Info.hpp - ${IncludeFolder}curlpp/Easy.hpp - ${IncludeFolder}curlpp/Form.hpp - ${IncludeFolder}curlpp/Types.hpp - ${IncludeFolder}curlpp/OptionBase.hpp - ${IncludeFolder}curlpp/Infos.hpp - ${IncludeFolder}curlpp/Options.hpp - ${IncludeFolder}curlpp/Multi.hpp - ${IncludeFolder}curlpp/internal/OptionContainerType.hpp - ${IncludeFolder}curlpp/internal/global.h - ${IncludeFolder}curlpp/internal/buildconfig.h - ${IncludeFolder}curlpp/internal/OptionContainer.hpp - ${IncludeFolder}curlpp/internal/SList.hpp - ${IncludeFolder}curlpp/internal/CurlHandle.hpp - ${IncludeFolder}curlpp/internal/OptionSetter.hpp - ${IncludeFolder}curlpp/internal/OptionList.hpp - ${IncludeFolder}curlpp/cURLpp.hpp - ${SrcFolder}curlpp/autolink.h -) +file(GLOB_RECURSE HeaderFileList "${IncludeFolder}*") +install(DIRECTORY include/utilspp/ DESTINATION "include/utilspp") +install(DIRECTORY include/curlpp/ DESTINATION "include/curlpp") DisplayList("Using Header Files:" "${HeaderFileList}") -set(SourceFileList - ${SrcFolder}utilspp/PrivateMembers.cpp - ${SrcFolder}utilspp/LifetimeLibrary.cpp - ${SrcFolder}curlpp/Form.cpp - ${SrcFolder}curlpp/Exception.cpp - ${SrcFolder}curlpp/Options.cpp - ${SrcFolder}curlpp/Option.cpp - ${SrcFolder}curlpp/Options.custom.ins - ${SrcFolder}curlpp/Info.cpp - ${SrcFolder}curlpp/Multi.cpp - ${SrcFolder}curlpp/OptionBase.cpp - ${SrcFolder}curlpp/internal/SList.cpp - ${SrcFolder}curlpp/internal/OptionSetter.cpp - ${SrcFolder}curlpp/internal/OptionList.cpp - ${SrcFolder}curlpp/internal/CurlHandle.cpp - ${SrcFolder}curlpp/Infos.cpp - ${SrcFolder}curlpp/Easy.cpp - ${SrcFolder}curlpp/cURLpp.cpp -) +file(GLOB_RECURSE SourceFileList "${SrcFolder}*") DisplayList("Using Source Files:" "${SourceFileList}") -set(ExamplesFileList - ${ExamplesFolder}example00.cpp - ${ExamplesFolder}example01.cpp - ${ExamplesFolder}example02.cpp - ${ExamplesFolder}example03.cpp - ${ExamplesFolder}example04.cpp - ${ExamplesFolder}example05.cpp - ${ExamplesFolder}example06.cpp - ${ExamplesFolder}example07.cpp - ${ExamplesFolder}example08.cpp - ${ExamplesFolder}example09.cpp - ${ExamplesFolder}example10.cpp - ${ExamplesFolder}example11.cpp - ${ExamplesFolder}example12.cpp - ${ExamplesFolder}example13.cpp - ${ExamplesFolder}example14.cpp - ${ExamplesFolder}example16.cpp - ${ExamplesFolder}example15.cpp - ${ExamplesFolder}example17.cpp - ${ExamplesFolder}example18.cpp - ${ExamplesFolder}example19.cpp - ${ExamplesFolder}example20.cpp - ${ExamplesFolder}example21.cpp - ${ExamplesFolder}example22.cpp - ${ExamplesFolder}example23.cpp - ${ExamplesFolder}example24.cpp -) -DisplayList("Using Example Files:" "${ExamplesFileList}") - ######################################################################################### # Look for dependencies @@ -135,6 +64,7 @@ DisplayList("Using Example Files:" "${ExamplesFileList}") message(STATUS "Looking for CURL") include(FindCURL) +cmake_minimum_required(VERSION 3.0) find_package(CURL REQUIRED) if(${CURL_FOUND}) @@ -159,22 +89,15 @@ message(STATUS "Defining the shared library for ${PROJECT_NAME} including " "all source and header files not in examples." ) + add_library(${PROJECT_NAME} SHARED ${HeaderFileList} ${SourceFileList}) target_link_libraries(${PROJECT_NAME} ${CURL_LIBRARIES}) -# 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} ${PROJECT_NAME}) - # make the meta target depend on this example. - add_dependencies(build_all_examples ${ExampleName}) -endforeach(Example ${ExamplesFileList}) +add_library(${PROJECT_NAME}_static STATIC ${HeaderFileList} ${SourceFileList}) +target_link_libraries(${PROJECT_NAME}_static ${CURL_LIBRARIES}) + +install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_static + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 9fc2688..0000000 --- a/ChangeLog +++ /dev/null @@ -1 +0,0 @@ -For ChangeLog, check look at curlpp's source repository. diff --git a/Doxyfile b/Doxyfile deleted file mode 100644 index 02650f4..0000000 --- a/Doxyfile +++ /dev/null @@ -1,293 +0,0 @@ -# Doxyfile 1.5.7.1 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = cURLpp -PROJECT_NUMBER = 0.7.2 -OUTPUT_DIRECTORY = D:/projects/curlpp/doc/doxygen -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = NO -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = C:/Windows/system32/ -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = YES -QT_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 2 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -OPTIMIZE_FOR_FORTRAN = NO -OPTIMIZE_OUTPUT_VHDL = NO -BUILTIN_STL_SUPPORT = NO -CPP_CLI_SUPPORT = NO -SIP_SUPPORT = NO -IDL_PROPERTY_SUPPORT = YES -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -TYPEDEF_HIDES_STRUCT = NO -SYMBOL_CACHE_SIZE = 0 -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = YES -EXTRACT_ANON_NSPACES = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = NO -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_GROUP_NAMES = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -SHOW_FILES = YES -SHOW_NAMESPACES = YES -FILE_VERSION_FILTER = -LAYOUT_FILE = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = D:/projects/curlpp -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.vhd \ - *.vhdl -RECURSIVE = YES -EXCLUDE = */examples/* -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -HTML_DYNAMIC_SECTIONS = YES -GENERATE_DOCSET = NO -DOCSET_FEEDNAME = "Doxygen generated docs" -DOCSET_BUNDLE_ID = org.doxygen.Project -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -CHM_INDEX_ENCODING = -BINARY_TOC = NO -TOC_EXPAND = NO -GENERATE_QHP = NO -QCH_FILE = -QHP_NAMESPACE = org.doxygen.Project -QHP_VIRTUAL_FOLDER = doc -QHG_LOCATION = -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = ALL -TREEVIEW_WIDTH = 250 -FORMULA_FONTSIZE = 10 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -MSCGEN_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = YES -DOT_FONTNAME = FreeSans -DOT_FONTSIZE = 10 -DOT_FONTPATH = -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = YES -CALLER_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = "C:/Program Files (x86)/Graphviz/bin" -DOTFILE_DIRS = -DOT_GRAPH_MAX_NODES = 50 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/FEATURES b/FEATURES deleted file mode 100644 index c5f0917..0000000 --- a/FEATURES +++ /dev/null @@ -1,4 +0,0 @@ -- pkg-config support. -- option value retreiving. -- exception safe. - diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 02a4a07..0000000 --- a/INSTALL +++ /dev/null @@ -1,167 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes a while. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Type `make install' to install the programs and any data files and - documentation. - - 4. You can remove the program binaries and object files from the - source code directory by typing `make clean'. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. - diff --git a/KNOWN_BUGS b/KNOWN_BUGS deleted file mode 100644 index 8854454..0000000 --- a/KNOWN_BUGS +++ /dev/null @@ -1 +0,0 @@ -autogen.sh doesn't work properly on Mac OS X. It creates invalid Makefiles that can't compile utilspp. \ No newline at end of file diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 3cfef81..0000000 --- a/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -SUBDIRS = src include examples doc -EXTRA_DIST = curlpp.VC8.vcproj curlpp.VC8.sln CHANGES curlpp.spec README.win32 win32/* - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = curlpp.pc - -bin_SCRIPTS = curlpp-config - diff --git a/Makefile.msvc b/Makefile.msvc deleted file mode 100644 index e3f322a..0000000 --- a/Makefile.msvc +++ /dev/null @@ -1,281 +0,0 @@ -# Makefile for building curlpp with MSVC -# Giuseppe "Cowo" Corbelli - cowo.lugbs.linux.it -# Piotr Dobrogost - pd.curlpp.org (February 2009 - March 2009) -# -# Usage: -# nmake /f makefile.msvc 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 -# -# Should be invoked from curlpp directory -# Edit the LIBCURL_PATH or set LIBCURL_PATH envvar ! - - -# DEFAULTS SECTION - default values of some variables -##################################################### - -LIB_NAME = curlpp -LIBCURL_NAME = libcurl -DEFAULT_DIR_OUT = .\out\$(BUILD_CFG) -DEFAULT_LIBCURL_PATH= c:\program files (x86)\libcurl - -DEFAULT_SELF_CONTAINED = yes - -DEFAULT_BUILD_TYPE = dynamic -DEFAULT_BUILD_MODE = release - - -!IFNDEF SELF_CONTAINED -SELF_CONTAINED = $(DEFAULT_SELF_CONTAINED) -!ENDIF - - -!IFNDEF BUILD_CFG -BUILD_CFG = $(DEFAULT_BUILD_TYPE)-$(DEFAULT_BUILD_MODE) -!ENDIF - -!IFNDEF RTLIB_CFG -RTLIB_CFG = $(BUILD_CFG) -!ENDIF - -!IFNDEF LIBCURL_CFG -LIBCURL_CFG = $(BUILD_CFG) -!ENDIF - - -!IFNDEF LIBCURL_PATH -LIBCURL_PATH = $(DEFAULT_LIBCURL_PATH) -!ENDIF - -!IFNDEF DIR_OUT -DIR_OUT = $(DEFAULT_DIR_OUT) -!ENDIF -DIR_OBJ = $(DIR_OUT)\obj -TARGET = $(LIB_NAME)$(TARGET_SUFFIX) - - -# GLOBAL SECTION - common options needed for DEBUG/RELEASE and DYNAMIC/STATIC variants of builds -################################################################################################ - -# BASE entity - -# definitions to be used in following compiler part - -COMPILER = cl.exe - -C_DEFS = /DWIN32 /DBUILDING_CURLPP -!IF "$(SELF_CONTAINED)" == "yes" -C_DEFS = $(C_DEFS) /DCURLPP_SELF_CONTAINED -!ENDIF -C_INCLUDES = /I "./include" -CFLAGS_STD = $(C_INCLUDES) $(C_DEFS) /nologo /W0 /EHsc /FD /c - -CFLAGS_DYNAMIC = /UCURLPP_STATICLIB -CFLAGS_STATIC = /DCURLPP_STATICLIB - -CFLAGS_DEBUG = /D_DEBUG /Od /Gm /Zi /RTC1 /GR -CFLAGS_RELEASE = /DNDEBUG /O2 /GR - -CFLAGS = - -# compiler part - -!IF "$(BUILD_CFG)" == "dynamic-release" -CFLAGS = $(CFLAGS) $(CFLAGS_DYNAMIC) $(CFLAGS_RELEASE) -!ENDIF -!IF "$(BUILD_CFG)" == "dynamic-debug" -CFLAGS = $(CFLAGS) $(CFLAGS_DYNAMIC) $(CFLAGS_DEBUG) -!ENDIF -!IF "$(BUILD_CFG)" == "static-release" -CFLAGS = $(CFLAGS) $(CFLAGS_STATIC) $(CFLAGS_RELEASE) -!ENDIF -!IF "$(BUILD_CFG)" == "static-debug" -CFLAGS = $(CFLAGS) $(CFLAGS_STATIC) $(CFLAGS_DEBUG) -!ENDIF - -# definitions to be used in following linker part - -LINKER = link.exe - -LFLAGS_STD = /nologo /libpath:"$(LIBCURL_PATH)/lib" - -LFLAGS_DYNAMIC = /dll /release /debug /incremental:no /opt:noref -LFLAGS_STATIC = /lib - -LFLAGS = - -# linker part - -!IF "$(BUILD_CFG)" == "dynamic-release" -LFLAGS = $(LFLAGS) $(LFLAGS_DYNAMIC) -!ENDIF -!IF "$(BUILD_CFG)" == "dynamic-debug" -LFLAGS = $(LFLAGS) $(LFLAGS_DYNAMIC) -!ENDIF -!IF "$(BUILD_CFG)" == "static-release" -LFLAGS = $(LFLAGS) $(LFLAGS_STATIC) -!ENDIF -!IF "$(BUILD_CFG)" == "static-debug" -LFLAGS = $(LFLAGS) $(LFLAGS_STATIC) -!ENDIF - -# RUN-TIME entity - -# compiler part - -!IF "$(RTLIB_CFG)" == "dynamic-release" -CFLAGS = /MD $(CFLAGS) -!ENDIF -!IF "$(RTLIB_CFG)" == "dynamic-debug" -CFLAGS = /MDd $(CFLAGS) -!ENDIF -!IF "$(RTLIB_CFG)" == "static-release" -CFLAGS = /MT $(CFLAGS) -!ENDIF -!IF "$(RTLIB_CFG)" == "static-debug" -CFLAGS = /MTd $(CFLAGS) -!ENDIF - -# linker part -# none - - -# DEPENDENCIES SECTION -###################### - -CFLAGS_DEPENDENCIES = -LFLAGS_DEPENDENCIES = - -# LIBCURL - -# definitions to be used in following compiler part -CFLAGS_LIBCURL = /I "$(LIBCURL_PATH)/include" - -# compiler part -!IF "$(LIBCURL_CFG)" == "dynamic-release" -CFLAGS = $(CFLAGS) $(CFLAGS_LIBCURL) -!ENDIF -!IF "$(LIBCURL_CFG)" == "dynamic-debug" -CFLAGS = $(CFLAGS) $(CFLAGS_LIBCURL) -!ENDIF -!IF "$(LIBCURL_CFG)" == "static-release" -CFLAGS = $(CFLAGS) $(CFLAGS_LIBCURL) -!ENDIF -!IF "$(LIBCURL_CFG)" == "static-debug" -CFLAGS = $(CFLAGS) $(CFLAGS_LIBCURL) -!ENDIF - - -# libcurl configuration - linker part -!IF "$(LIBCURL_CFG)" == "dynamic-release" -LFLAGS_DEPENDENCIES = $(LFLAGS_DEPENDENCIES) $(LIBCURL_NAME)$(TARGET_SUFFIX).lib -!ENDIF -!IF "$(LIBCURL_CFG)" == "dynamic-debug" -LFLAGS_DEPENDENCIES = $(LFLAGS_DEPENDENCIES) $(LIBCURL_NAME)$(TARGET_SUFFIX).lib -!ENDIF -!IF "$(LIBCURL_CFG)" == "static-release" -LFLAGS_DEPENDENCIES = $(LFLAGS_DEPENDENCIES) $(LIBCURL_NAME)$(TARGET_SUFFIX).lib -!ENDIF -!IF "$(LIBCURL_CFG)" == "static-debug" -LFLAGS_DEPENDENCIES = $(LFLAGS_DEPENDENCIES) $(LIBCURL_NAME)$(TARGET_SUFFIX).lib -!ENDIF - -# TARGET - -# compiler part -# none - -# definitions to be uses in following linker part - -LNK_OUT = /out:$(DIR_OUT)\$(TARGET) -LNK_OUT_IMP = /implib:$(DIR_OUT)\$(TARGET).lib -LNK_OUT_PDB = /pdb:$(DIR_OUT)\$(TARGET).pdb - -# linker part -!IF "$(BUILD_CFG)" == "dynamic-release" -LFLAGS = $(LFLAGS) $(LNK_OUT).dll $(LNK_OUT_IMP) $(LNK_OUT_PDB) -!ENDIF -!IF "$(BUILD_CFG)" == "dynamic-debug" -LFLAGS = $(LFLAGS) $(LNK_OUT).dll $(LNK_OUT_IMP) $(LNK_OUT_PDB) -!ENDIF -!IF "$(BUILD_CFG)" == "static-release" -LFLAGS = $(LFLAGS) $(LNK_OUT).lib -!ENDIF -!IF "$(BUILD_CFG)" == "static-debug" -LFLAGS = $(LFLAGS) $(LNK_OUT).lib -!ENDIF - -!IF "$(BUILD_CFG)" == "dynamic-release" -TARGET_SUFFIX = MD -!ENDIF -!IF "$(BUILD_CFG)" == "dynamic-debug" -TARGET_SUFFIX = MDd -!ENDIF -!IF "$(BUILD_CFG)" == "static-release" -TARGET_SUFFIX = MT -!ENDIF -!IF "$(BUILD_CFG)" == "static-debug" -TARGET_SUFFIX = MTd -!ENDIF - -CC = $(COMPILER) $(CFLAGS) $(CFLAGS_STD) -LNK = $(LINKER) $(LFLAGS) $(LFLAGS_DEPENDENCIES) $(LFLAGS_STD) - -X_OBJS= \ - $(DIR_OBJ)/CurlHandle.o \ - $(DIR_OBJ)/cURLpp.o \ - $(DIR_OBJ)/Exception.o \ - $(DIR_OBJ)/Easy.o \ - $(DIR_OBJ)/Form.o \ - $(DIR_OBJ)/Info.o \ - $(DIR_OBJ)/Multi.o \ - $(DIR_OBJ)/OptionBase.o \ - $(DIR_OBJ)/OptionList.o \ - $(DIR_OBJ)/OptionSetter.o \ - $(DIR_OBJ)/SList.o \ - -all : $(DIR_OUT)$(TARGET) - -$(DIR_OUT)$(TARGET): $(X_OBJS) - $(LNK) $(X_OBJS) - -$(X_OBJS): $(DIR_OBJ) $(DIR_OUT) - -$(DIR_OBJ): - @if not exist "$(DIR_OBJ)" mkdir $(DIR_OBJ) - -$(DIR_OUT): - @if not exist "$(DIR_OUT)" mkdir $(DIR_OUT) - - -.SUFFIXES: .cpp .obj - -{.\src\curlpp}.cpp{$(DIR_OBJ)\}.o: - $(CC) $(CFLAGS) /Fo"$@" $< - -{.\src\curlpp\internal}.cpp{$(DIR_OBJ)\}.o: - $(CC) $(CFLAGS) /Fo"$@" $< - -clean: - @-erase /s $(DIR_OUT)\*.dll 2> NUL - @-erase /s $(DIR_OUT)\*.exp 2> NUL - @-erase /s $(DIR_OUT)\*.idb 2> NUL - @-erase /s $(DIR_OUT)\*.lib 2> NUL - @-erase /s $(DIR_OUT)\*.o 2> NUL - @-erase /s $(DIR_OUT)\*.pch 2> NUL - @-erase /s $(DIR_OUT)\*.pdb 2> NUL - @-erase /s $(DIR_OUT)\*.res 2> NUL - @-erase /s $(DIR_OUT)\*.manifest 2> NUL - -help options usage : - @echo "Usage: nmake /f makefile.msvc \ - 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" diff --git a/NEWS b/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/PACKAGE b/PACKAGE deleted file mode 100644 index e69de29..0000000 diff --git a/Readme.md b/Readme.md index f2a0015..bc37944 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -[![Beerpay](https://beerpay.io/jpbarrette/curlpp/badge.svg?style=beer-square)](https://beerpay.io/jpbarrette/curlpp) [![Beerpay](https://beerpay.io/jpbarrette/curlpp/make-wish.svg?style=flat-square)](https://beerpay.io/jpbarrette/curlpp?focus=wish) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Beerpay](https://beerpay.io/jpbarrette/curlpp/badge.svg?style=beer-square)](https://beerpay.io/jpbarrette/curlpp) [![Beerpay](https://beerpay.io/jpbarrette/curlpp/make-wish.svg?style=flat-square)](https://beerpay.io/jpbarrette/curlpp?focus=wish) [![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) # Description diff --git a/VERSION b/VERSION deleted file mode 100644 index d5cc44d..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.7.2 \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..72eb6fd --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,33 @@ +version: '0.7.4.{build}' + +environment: + matrix: + - PRJ_GEN: "Visual Studio 11 2012 Win64" + BDIR: msvc2012 + PRJ_CFG: Release + - PRJ_GEN: "Visual Studio 12 2013 Win64" + BDIR: msvc2013 + PRJ_CFG: Release + - PRJ_GEN: "Visual Studio 14 2015 Win64" + BDIR: msvc2015 + PRJ_CFG: Release + - PRJ_GEN: "Visual Studio 11 2012 Win64" + BDIR: msvc2012 + PRJ_CFG: Release + - PRJ_GEN: "Visual Studio 12 2013 Win64" + BDIR: msvc2013 + PRJ_CFG: Release + - PRJ_GEN: "Visual Studio 14 2015 Win64" + BDIR: msvc2015 + PRJ_CFG: Release + +install: + - cinst curl + +build_script: + - mkdir build.%BDIR% + - cd build.%BDIR% + - cmake .. -G"%PRJ_GEN%" + - cmake --build . --config %PRJ_CFG% --clean-first + + diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 833eaf3..0000000 --- a/autogen.sh +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/sh - -die(){ - echo "$@" - exit -} - -# this works as 'which' but we use a different name to make it more obvious we -# aren't using 'which'! ;-) -findtool(){ - file="$1" - - IFS=":" - for path in $PATH - do - if test -r "$path/$file"; then - echo "$path/$file" - return - fi - done -} - -#-------------------------------------------------------------------------- -# autoconf 2.57 or newer -# -need_autoconf="2.57" -ac_version=`${AUTOCONF:-autoconf} --version 2>/dev/null|head -1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ac_version"; then - echo "buildconf: autoconf not found." - echo " You need autoconf version $need_autoconf or newer installed." - exit 1 -fi -IFS=.; set $ac_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "57" || test "$1" -lt "2"; then - echo "buildconf: autoconf version $ac_version found." - echo " You need autoconf version $need_autoconf or newer installed." - echo " If you have a sufficient autoconf installed, but it" - echo " is not named 'autoconf', then try setting the" - echo " AUTOCONF environment variable." - exit 1 -fi - -echo "buildconf: autoconf version $ac_version (ok)" - -#-------------------------------------------------------------------------- -# autoheader 2.50 or newer -# -ah_version=`${AUTOHEADER:-autoheader} --version 2>/dev/null|head -1| sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'` -if test -z "$ah_version"; then - echo "buildconf: autoheader not found." - echo " You need autoheader version 2.50 or newer installed." - exit 1 -fi -IFS=.; set $ah_version; IFS=' ' -if test "$1" = "2" -a "$2" -lt "50" || test "$1" -lt "2"; then - echo "buildconf: autoheader version $ah_version found." - echo " You need autoheader version 2.50 or newer installed." - echo " If you have a sufficient autoheader installed, but it" - echo " is not named 'autoheader', then try setting the" - echo " AUTOHEADER environment variable." - exit 1 -fi - -echo "buildconf: autoheader version $ah_version (ok)" - -#-------------------------------------------------------------------------- -# automake 1.9 or newer -# -need_automake="1.9" -am_version=`${AUTOMAKE:-automake} --version 2>/dev/null|head -1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'` -if test -z "$am_version"; then - echo "buildconf: automake not found." - echo " You need automake version $need_automake or newer installed." - exit 1 -fi -IFS=.; set $am_version; IFS=' ' -if test "$1" = "1" -a "$2" -lt "9" || test "$1" -lt "1"; then - echo "buildconf: automake version $am_version found." - echo " You need automake version $need_automake or newer installed." - echo " If you have a sufficient automake installed, but it" - echo " is not named 'automake', then try setting the" - echo " AUTOMAKE environment variable." - exit 1 -fi - -echo "buildconf: automake version $am_version (ok)" - - -#-------------------------------------------------------------------------- -# libtool check -# -LIBTOOL_WANTED_MAJOR=1 -LIBTOOL_WANTED_MINOR=4 -LIBTOOL_WANTED_PATCH=2 -LIBTOOL_WANTED_VERSION=1.4.2 - -# this approach that tries 'glibtool' first is some kind of work-around for -# some BSD-systems I believe that use to provide the GNU libtool named -# glibtool, with 'libtool' being something completely different. -libtool=`findtool glibtool 2>/dev/null` -if test ! -x "$libtool"; then - libtool=`findtool libtool` -fi - -LIBTOOLIZE="${libtool}ize" - -lt_pversion=`$libtool --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'` -if test -z "$lt_pversion"; then - echo "buildconf: libtool not found." - echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed" - exit 1 -fi -lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$//'` -IFS=.; set $lt_version; IFS=' ' -lt_status="good" - -major=$1 -minor=$2 -patch=$3 - -if test "$major" = "$LIBTOOL_WANTED_MAJOR"; then - if test "$minor" -lt "$LIBTOOL_WANTED_MINOR"; then - lt_status="bad" - elif test -n "$LIBTOOL_WANTED_PATCH"; then - if test "$minor" -gt "$LIBTOOL_WANTED_MINOR"; then - lt_status="good" - elif test -n "$patch"; then - if test "$patch" -lt "$LIBTOOL_WANTED_PATCH"; then - lt_status="bad" - fi - else - lt_status="bad" - fi - fi -fi -if test $lt_status != "good"; then - echo "buildconf: libtool version $lt_pversion found." - echo " You need libtool version $LIBTOOL_WANTED_VERSION or newer installed" - exit 1 -fi - -echo "buildconf: libtool version $lt_version (ok)" - -#-------------------------------------------------------------------------- -# m4 check -# -m4=`${M4:-m4} --version 2>/dev/null|head -1`; -m4_version=`echo $m4 | sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//'` - -if { echo $m4 | grep "GNU" >/dev/null 2>&1; } then - echo "buildconf: GNU m4 version $m4_version (ok)" -else - echo "buildconf: m4 version $m4 found. You need a GNU m4 installed!" - exit 1 -fi - - -# ------------------------------------------------------------ - -# run the correct scripts now -aclocalinclude="-I m4 $ACLOCAL_FLAGS" - -echo "buildconf: running libtoolize" -${LIBTOOLIZE:-libtoolize} --copy --automake --force || die "The libtool command failed" -echo "buildconf: running aclocal" -${ACLOCAL:-aclocal} $ACLOCAL_FLAGS $aclocalinclude || die "The aclocal command line failed" -echo "buildconf: running aclocal hack to convert all mv to mv -f" -perl -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4 -echo "buildconf: running autoconf" -${AUTOCONF:-autoconf} || die "The command '${AUTOCONF:-autoconf}' failed" -echo "buildconf: running autoheader" -${AUTOHEADER:-autoheader} || die "The autoheader command failed" -echo "buildconf: running automake" -${AUTOMAKE:-automake} -a || die "The automake command failed" - -echo "buildconf: OK" -exit 0 diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 8bddf9e..0000000 --- a/configure.ac +++ /dev/null @@ -1,216 +0,0 @@ -AC_PREREQ([2.59]) -dnl -dnl figure out the libcurl version -AC_INIT([curlpp], m4_esyscmd_s([sed -ne 's/^#define LIBCURLPP_VERSION "\(.*\)"/\1/p' include/curlpp/cURLpp.hpp])) - -AC_CONFIG_SRCDIR(src/curlpp/cURLpp.cpp) -dnl AC_CONFIG_AUX_DIR(config) -AM_CONFIG_HEADER(include/curlpp/config.h) - -AM_INIT_AUTOMAKE(foreign) - -RPM_VERSION=$VERSION -AC_SUBST(RPM_VERSION) - -LIBS="$LIBS -lstdc++" -dnl -dnl we extract the numerical version for curl-config only -VERSIONNUM=`sed -ne 's/^#define LIBCURLPP_VERSION_NUM 0x\(\\d\)/\1/p' ${srcdir}/include/curlpp/cURLpp.hpp` -AC_SUBST(VERSIONNUM) - -dnl -dnl Solaris pkgadd support definitions -PKGADD_PKG="cURLpp" -PKGADD_NAME="cURLpp - a client that groks URLs++" -PKGADD_VENDOR="http://rrette.com/curlpp.html" -AC_SUBST(PKGADD_PKG) -AC_SUBST(PKGADD_NAME) -AC_SUBST(PKGADD_VENDOR) - -AC_PROG_LN_S -AC_PROG_MAKE_SET - -AC_LANG_CPLUSPLUS - -AC_PROG_CC -AC_PROG_CPP -AC_PROG_CXX -AC_PROG_INSTALL - -AX_CXX_COMPILE_STDCXX_11() - - -dnl AC_DISABLE_STATIC -AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL - -LIBTOOL="$LIBTOOL --silent" - -CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`" -CURLPP_CXXFLAGS="" - -case $host in - *-*-cygwin | *-*-mingw* | *-*-pw32*) - need_no_undefined=yes - ;; - *) - need_no_undefined=no - ;; -esac - -AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes) - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS( \ -curl/curl.h \ -ostream -) -if test $ac_cv_header_curl_curl_h = no; then - AC_MSG_ERROR([*** curl/curl.h. You need a working libcurl installation.]) -fi - - -dnl ------- -dnl set my_cv_curl_vers to the version of libcurl or NONE -dnl if libcurl is not found or is too old - -AC_DEFUN([MY_CURL],[ - AC_CACHE_VAL(my_cv_curl_vers,[ - my_cv_curl_vers=NONE - dnl check is the plain-text version of the required version - check="7.10.0" - dnl check_hex must be UPPERCASE if any hex letters are present - check_hex="070A00" - - AC_MSG_CHECKING([for curl >= $check]) - - if eval curl-config --version 2>/dev/null >/dev/null; then - ver=`curl-config --version | sed -e "s/libcurl //g"` - hex_ver=`curl-config --vernum | tr 'a-f' 'A-F'` - ok=`echo "ibase=16; if($hex_ver>=$check_hex) $hex_ver else 0" | bc` - - if test x$ok != x0; then - my_cv_curl_vers="$ver" - AC_MSG_RESULT([$my_cv_curl_vers]) - CURL_LIBS=`curl-config --libs` - CURL_CFLAGS=`curl-config --cflags` - CURLPP_CXXFLAGS="$CURLPP_CXXFLAGS $CURL_CFLAGS" - LIBS="$LIBS $CURL_LIBS" - else - AC_MSG_RESULT(FAILED) - AC_MSG_WARN([$ver is too old. Need version $check or higher.]) - fi - else - AC_MSG_RESULT(FAILED) - AC_MSG_WARN([curl-config was not found]) - fi - ]) -]) - - -MY_CURL - - -AC_MSG_CHECKING([enable gcc warnings]) -AC_ARG_ENABLE(warnings, -[ --enable-warnings Enable warnings on compilation [default=yes]], -[ -AC_MSG_RESULT(no) -], -[ -AC_MSG_RESULT(yes) -CXXFLAGS="$CXXFLAGS -W -Wall" -] -) - - -AC_MSG_CHECKING([warning make an error on compilation]) -AC_ARG_ENABLE(ewarning, -[ --enable-ewarning Enable error on compilation warning [default=yes]], -[ -AC_MSG_RESULT(no) -], -[ -AC_MSG_RESULT(yes) -CXXFLAGS="$CXXFLAGS -Werror " -] -) - - - -AC_MSG_CHECKING([whether to enable the maintener code]) -AC_ARG_ENABLE(maintener, -[ --enable-maintener Enable maintener code [default=no]], -[ -CXXFLAGS="$CXXFLAGS -DENABLE_MAINTENER" -AC_MSG_RESULT(yes) -maintener="yes" -], -[ -AC_MSG_RESULT(no) -maintener="no" -] -) -AM_CONDITIONAL(MAINTENER_CODE, test x$maintener = xyes) - - -AC_MSG_CHECKING([whether to enable Debug symbols support options]) -AC_ARG_ENABLE(debug, -[ --enable-debug Enable Debug symbols support [default=no]], -[ -AC_MSG_RESULT(yes) -CXXFLAGS="$CXXFLAGS -ggdb3 -DCURLPP_DEBUG" -], -[ -AC_MSG_RESULT(no) -] -) - -AC_MSG_CHECKING([if we need BUILDING_CURLPP]) -case $host in - *-*-mingw*) - AC_DEFINE(BUILDING_CURLPP, 1, [when building cURLpp itself]) - AC_MSG_RESULT(yes) - AC_MSG_CHECKING([if we need CURLPP_STATICLIB]) - if test "X$enable_shared" = "Xno" - then - AC_DEFINE(CURLPP_STATICLIB, 1, [when not building a shared library]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - ;; - *) - AC_MSG_RESULT(no) - ;; -esac - -dnl BOOST_REQUIRE -AX_BOOST_BASE([1.33.1]) -AM_CONDITIONAL(HAVE_BOOST, test x$want_boost = xyes) - - -CURLPP_CXXFLAGS="$CURLPP_CXXFLAGS $BOOST_CPPFLAGS" -AC_SUBST(CURLPP_CXXFLAGS) -CXXFLAGS="$CXXFLAGS $CURLPP_CXXFLAGS" - -dnl AC_CONFIG_FILES( -AC_OUTPUT( -curlpp-config \ -curlpp.spec \ -curlpp.pc \ -Makefile \ -examples/Makefile \ -src/Makefile \ -src/curlpp/Makefile \ -src/curlpp/internal/Makefile \ -src/utilspp/Makefile \ -include/Makefile \ -include/curlpp/Makefile \ -include/curlpp/internal/Makefile \ -include/utilspp/Makefile \ -include/utilspp/functor/Makefile \ -include/utilspp/singleton/Makefile \ -doc/Makefile -) diff --git a/cross-configure.sh b/cross-configure.sh deleted file mode 100644 index 5232dd3..0000000 --- a/cross-configure.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -CONFIG_SHELL=/bin/sh -export CONFIG_SHELL -PREFIX=/usr/i586-mingw32msvc -TARGET=i586-mingw32msvc -PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH" -export PATH -cache=cross-config.cache -sh configure --cache-file="$cache" --prefix=$PREFIX \ - --target=$TARGET --host=$TARGET --build=i386-linux \ - $* -status=$? -rm -f "$cache" -exit $status diff --git a/cross-make.sh b/cross-make.sh deleted file mode 100644 index d9386b1..0000000 --- a/cross-make.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec make $* diff --git a/cscope.files b/cscope.files deleted file mode 100644 index e54d86c..0000000 --- a/cscope.files +++ /dev/null @@ -1,22 +0,0 @@ -./curlpp/CurlHandle.hpp -./curlpp/Easy.hpp -./curlpp/Exception.hpp -./curlpp/FileTrait.hpp -./curlpp/Form.hpp -./curlpp/Handle.hpp -./curlpp/NonCopyable.hpp -./curlpp/Option.hpp -./curlpp/OptionBase.hpp -./curlpp/OptionContainer.hpp -./curlpp/OptionContainerType.hpp -./curlpp/OptionList.hpp -./curlpp/OptionSetter.hpp -./curlpp/Options.hpp -./curlpp/SList.hpp -./curlpp/Storage.hpp -./curlpp/StorageOptions.hpp -./curlpp/StorageTrait.hpp -./curlpp/StreamTrait.hpp -./curlpp/TypeTrait.hpp -./curlpp/cURL.hpp -./curlpp/cURLpp.hpp diff --git a/curlpp-0.7.4-beta.tar.gz b/curlpp-0.7.4-beta.tar.gz deleted file mode 100644 index 4f81882..0000000 Binary files a/curlpp-0.7.4-beta.tar.gz and /dev/null differ diff --git a/curlpp-0.7.4-beta.zip b/curlpp-0.7.4-beta.zip deleted file mode 100644 index b3017d2..0000000 Binary files a/curlpp-0.7.4-beta.zip and /dev/null differ diff --git a/curlpp.VC8.sln b/curlpp.VC8.sln deleted file mode 100644 index 8f10b11..0000000 --- a/curlpp.VC8.sln +++ /dev/null @@ -1,38 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curlpp", "curlpp.VC8.vcproj", "{DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curlpp.examples", "examples\curlpp.examples.VC8.vcproj", "{47B20498-1AC3-4C23-A168-C2E40610D170}" - ProjectSection(ProjectDependencies) = postProject - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087} = {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DebugDynamic|Win32 = DebugDynamic|Win32 - DebugStatic|Win32 = DebugStatic|Win32 - ReleaseDynamic|Win32 = ReleaseDynamic|Win32 - ReleaseStatic|Win32 = ReleaseStatic|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DebugDynamic|Win32.ActiveCfg = DebugDynamic|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DebugDynamic|Win32.Build.0 = DebugDynamic|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DebugStatic|Win32.ActiveCfg = DebugStatic|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DebugStatic|Win32.Build.0 = DebugStatic|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.ReleaseDynamic|Win32.ActiveCfg = ReleaseDynamic|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.ReleaseDynamic|Win32.Build.0 = ReleaseDynamic|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.ReleaseStatic|Win32.ActiveCfg = ReleaseStatic|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.ReleaseStatic|Win32.Build.0 = ReleaseStatic|Win32 - {47B20498-1AC3-4C23-A168-C2E40610D170}.DebugDynamic|Win32.ActiveCfg = DebugDynamic|Win32 - {47B20498-1AC3-4C23-A168-C2E40610D170}.DebugDynamic|Win32.Build.0 = DebugDynamic|Win32 - {47B20498-1AC3-4C23-A168-C2E40610D170}.DebugStatic|Win32.ActiveCfg = DebugStatic|Win32 - {47B20498-1AC3-4C23-A168-C2E40610D170}.DebugStatic|Win32.Build.0 = DebugStatic|Win32 - {47B20498-1AC3-4C23-A168-C2E40610D170}.ReleaseDynamic|Win32.ActiveCfg = ReleaseDynamic|Win32 - {47B20498-1AC3-4C23-A168-C2E40610D170}.ReleaseDynamic|Win32.Build.0 = ReleaseDynamic|Win32 - {47B20498-1AC3-4C23-A168-C2E40610D170}.ReleaseStatic|Win32.ActiveCfg = ReleaseStatic|Win32 - {47B20498-1AC3-4C23-A168-C2E40610D170}.ReleaseStatic|Win32.Build.0 = ReleaseStatic|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/curlpp.VC8.vcproj b/curlpp.VC8.vcproj deleted file mode 100644 index c9174e5..0000000 --- a/curlpp.VC8.vcproj +++ /dev/null @@ -1,635 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AUTHORS b/doc/AUTHORS similarity index 69% rename from AUTHORS rename to doc/AUTHORS index ad1a0ee..2a6ceb6 100644 --- a/AUTHORS +++ b/doc/AUTHORS @@ -1,9 +1,8 @@ Eric Lavigne (erlavigne at wanadoo.fr) Jean-Philippe Barrette-LaPierre (jpb at rrette.com) -A special thanks from Jean-Philippe to Thomas Boutry(tboutry at ygingras.net) for helping me to fix some C++ errors. - Thanks to some patch providers: +Thomas Boutry Jonathan Wakely Peter Krumins Ben Golding diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt deleted file mode 100644 index 3a90753..0000000 --- a/doc/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - - -########### install files ############### - - - - -#original Makefile.am contents follow: - -#EXTRA_DIST = guide.pdf \ No newline at end of file diff --git a/COPYING b/doc/LICENSE similarity index 100% rename from COPYING rename to doc/LICENSE diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index eb45c4d..0000000 --- a/doc/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = guide.pdf \ No newline at end of file diff --git a/README.win32 b/doc/README.win32 similarity index 100% rename from README.win32 rename to doc/README.win32 diff --git a/TODO b/doc/TODO similarity index 53% rename from TODO rename to doc/TODO index 509665c..a68450e 100644 --- a/TODO +++ b/doc/TODO @@ -1,3 +1,4 @@ - Need to fix the OptionList::print function. - Need to put WriteStream and ReadStream to be exception safe. -- Need to have better define tests when boost isn't available \ No newline at end of file +- Need to put WriteStream and ReadStream to be exception safe. +- Get rid of example 18 and 20 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 81dfc4c..b32f9ae 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,294 +1,26 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - - -########### next target ############### - -set(example01_SRCS example01.cpp) - -kde4_add_executable(example01 ${example01_SRCS}) - -target_link_libraries(example01 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example02_SRCS example02.cpp) - -kde4_add_executable(example02 ${example02_SRCS}) - -target_link_libraries(example02 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example03_SRCS example03.cpp) - -kde4_add_executable(example03 ${example03_SRCS}) - -target_link_libraries(example03 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example04_SRCS example04.cpp) - -kde4_add_executable(example04 ${example04_SRCS}) - -target_link_libraries(example04 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example05_SRCS example05.cpp) - -kde4_add_executable(example05 ${example05_SRCS}) - -target_link_libraries(example05 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example06_SRCS example06.cpp) - -kde4_add_executable(example06 ${example06_SRCS}) - -target_link_libraries(example06 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example07_SRCS example07.cpp) - -kde4_add_executable(example07 ${example07_SRCS}) - -target_link_libraries(example07 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example08_SRCS example08.cpp) - -kde4_add_executable(example08 ${example08_SRCS}) - -target_link_libraries(example08 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example09_SRCS example09.cpp) - -kde4_add_executable(example09 ${example09_SRCS}) - -target_link_libraries(example09 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example10_SRCS example10.cpp) - -kde4_add_executable(example10 ${example10_SRCS}) - -target_link_libraries(example10 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example11_SRCS example11.cpp) - -kde4_add_executable(example11 ${example11_SRCS}) - -target_link_libraries(example11 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example12_SRCS example12.cpp) - -kde4_add_executable(example12 ${example12_SRCS}) - -target_link_libraries(example12 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example13_SRCS example13.cpp) - -kde4_add_executable(example13 ${example13_SRCS}) - -target_link_libraries(example13 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example14_SRCS example14.cpp) - -kde4_add_executable(example14 ${example14_SRCS}) - -target_link_libraries(example14 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example15_SRCS example15.cpp) - -kde4_add_executable(example15 ${example15_SRCS}) - -target_link_libraries(example15 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example16_SRCS example16.cpp) - -kde4_add_executable(example16 ${example16_SRCS}) - -target_link_libraries(example16 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example17_SRCS example17.cpp) - -kde4_add_executable(example17 ${example17_SRCS}) - -target_link_libraries(example17 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example19_SRCS example19.cpp) - -kde4_add_executable(example19 ${example19_SRCS}) - -target_link_libraries(example19 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example21_SRCS example21.cpp) - -kde4_add_executable(example21 ${example21_SRCS}) - -target_link_libraries(example21 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(example22_SRCS example22.cpp) - -kde4_add_executable(example22 ${example22_SRCS}) - -target_link_libraries(example22 ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(${maintener_programs}_SRCS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp) - -kde4_add_executable(${maintener_programs} ${${maintener_programs}_SRCS}) - -target_link_libraries(${maintener_programs} ${KDE4_KDECORE_LIBS}) - - -########### next target ############### - -set(${boost_programs}_SRCS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp) - -kde4_add_executable(${boost_programs} ${${boost_programs}_SRCS}) - -target_link_libraries(${boost_programs} ${KDE4_KDECORE_LIBS}) - - -########### install files ############### - - - - -#original Makefile.am contents follow: - -#if MAINTENER_CODE -#maintener_programs = -#endif -# -#if HAVE_BOOST -#boost_programs = example18 example20 -#endif -# -#EXTRA_DIST = Makefile.msvc -# -#noinst_PROGRAMS = \ -# example01 \ -# example02 \ -# example03 \ -# example04 \ -# example05 \ -# example06 \ -# example07 \ -# example08 \ -# example09 \ -# example10 \ -# example11 \ -# example12 \ -# example13 \ -# example14 \ -# example15 \ -# example16 \ -# example17 \ -# example19 \ -# example21 \ -# example22 \ -# ${maintener_programs} ${boost_programs} -# -# -# -#example01_SOURCES = example01.cpp -# -#example02_SOURCES = example02.cpp -# -#example03_SOURCES = example03.cpp -# -#example04_SOURCES = example04.cpp -# -#example05_SOURCES = example05.cpp -# -#example06_SOURCES = example06.cpp -# -#example07_SOURCES = example07.cpp -# -#example08_SOURCES = example08.cpp -# -#example09_SOURCES = example09.cpp -# -#example10_SOURCES = example10.cpp -# -#example11_SOURCES = example11.cpp -# -#example12_SOURCES = example12.cpp -# -#example13_SOURCES = example13.cpp -# -#example14_SOURCES = example14.cpp -# -#example15_SOURCES = example15.cpp -# -#example16_SOURCES = example16.cpp -# -#example17_SOURCES = example17.cpp -# -#example18_SOURCES = example18.cpp -# -#example19_SOURCES = example19.cpp -# -#example20_SOURCES = example20.cpp -# -#example21_SOURCES = example21.cpp -# -#example22_SOURCES = example22.cpp -# -#AM_LDFLAGS = -L../src/curlpp/ -lcurlpp -static -# -#INCLUDES = -I$(top_builddir)/include -# -# -# +cmake_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}) diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index 692b626..0000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,95 +0,0 @@ -if MAINTENER_CODE -maintener_programs = -endif - -if HAVE_BOOST -boost_programs = example18 example20 -endif - -EXTRA_DIST = Makefile.msvc - -noinst_PROGRAMS = \ - example01 \ - example02 \ - example03 \ - example04 \ - example05 \ - example06 \ - example07 \ - example08 \ - example09 \ - example10 \ - example11 \ - example12 \ - example13 \ - example14 \ - example15 \ - example16 \ - example17 \ - example19 \ - example21 \ - example22 \ - example23 \ - example24 \ - ${maintener_programs} ${boost_programs} - - - -example01_SOURCES = example01.cpp - -example02_SOURCES = example02.cpp - -example03_SOURCES = example03.cpp - -example04_SOURCES = example04.cpp - -example05_SOURCES = example05.cpp - -example06_SOURCES = example06.cpp - -example07_SOURCES = example07.cpp - -example08_SOURCES = example08.cpp - -example09_SOURCES = example09.cpp - -example10_SOURCES = example10.cpp - -example11_SOURCES = example11.cpp - -example12_SOURCES = example12.cpp - -example13_SOURCES = example13.cpp - -example14_SOURCES = example14.cpp - -example15_SOURCES = example15.cpp - -example16_SOURCES = example16.cpp - -example17_SOURCES = example17.cpp - -if HAVE_BOOST -example18_SOURCES = example18.cpp -endif - -example19_SOURCES = example19.cpp - -if HAVE_BOOST -example20_SOURCES = example20.cpp -endif - -example21_SOURCES = example21.cpp - -example22_SOURCES = example22.cpp - -example23_SOURCES = example23.cpp - -example24_SOURCES = example24.cpp - -AM_LDFLAGS = -L../src/curlpp/ -lcurlpp -static - -AM_CPPFLAGS = -I$(top_builddir)/include - - - diff --git a/examples/Makefile.msvc b/examples/Makefile.msvc deleted file mode 100644 index c07887c..0000000 --- a/examples/Makefile.msvc +++ /dev/null @@ -1,147 +0,0 @@ -############################################################# -# -# Makefile for building libcurlpp examples with MSVC -# All examples are linked against curlpp release static library -# Giuseppe "Cowo" Corbelli - cowo at lugbs dot linux dot it -# -# Usage: nmake -f Makefile.msvc all -# Should be invoked from examples/ directory -# Edit the LIBCURL_PATH/BOOST_PATH or set LIBCURL_PATH/BOOST_PATH env vars -# -############################################################## - -CURLPP_LIB_NAME = curlpp.lib -CURL_LIB_NAME = libcurl.lib - -############################################################# - -!IFNDEF LIBCURL_PATH -LIBCURL_PATH = ../../curl/include -!ENDIF - -!IF "$(cfg)"=="DebugStatic" || "$(cfg)"=="DebugDynamic" -CC = cl.exe /MDd /Od /Gm /Zi /D_DEBUG /GR /EHsc -!ELSE -CC = cl.exe /MD /O2 /DNDEBUG /GR /Y- /EHsc -!ENDIF - -CFLAGS = /I ../include /I ../include/curlpp /I "$(LIBCURL_PATH)/include" /DCURLPP_STATICLIB /D_CRT_SECURE_NO_DEPRECATE /nologo /W3 /DWIN32 /FD /c -!IFDEF BOOST_PATH -CFLAGS = /I $(BOOST_PATH) $(CFLAGS) -!ENDIF - -LNKLIB = link.exe /INCREMENTAL:NO /OPT:NOREF -LFLAGS = /nologo /LIBPATH:"$(LIBCURL_PATH)\lib" /LIBPATH:"..\$(cfg)" $(CURLPP_LIB_NAME) $(CURL_LIB_NAME) - -LNK = $(LNKLIB) $(LFLAGS) - -example01 : $$(@B).o - $(LNK) /out:$@.exe $** - -example02 : $$(@B).o - $(LNK) /out:$@.exe $** - -example03 : $$(@B).o - $(LNK) /out:$@.exe $** - -example04 : $$(@B).o - $(LNK) /out:$@.exe $** - -example05 : $$(@B).o - $(LNK) /out:$@.exe $** - -example06 : $$(@B).o - $(LNK) /out:$@.exe $** - -example07 : $$(@B).o - $(LNK) /out:$@.exe $** - -example08 : $$(@B).o - $(LNK) /out:$@.exe $** - -example09 : $$(@B).o - $(LNK) /out:$@.exe $** - -example10 : $$(@B).o - $(LNK) /out:$@.exe $** - -example11 : $$(@B).o - $(LNK) /out:$@.exe $** - -example12 : $$(@B).o - $(LNK) /out:$@.exe $** - -example13 : $$(@B).o - $(LNK) Ws2_32.lib /out:$@.exe $** - -example14 : $$(@B).o - $(LNK) Ws2_32.lib /out:$@.exe $** - -example15 : $$(@B).o - $(LNK) /out:$@.exe $** - -example16 : $$(@B).o - $(LNK) /out:$@.exe $** - -example17 : $$(@B).o - $(LNK) /out:$@.exe $** - -example18 : $$(@B).o - $(LNK) /out:$@.exe $** - -example19 : $$(@B).o - $(LNK) /out:$@.exe $** - -example20 : $$(@B).o - $(LNK) /out:$@.exe $** - -example21 : $$(@B).o - $(LNK) /out:$@.exe $** - -example22 : $$(@B).o - $(LNK) /out:$@.exe $** - - -TARGET = \ - example01 \ - example02 \ - example03 \ - example04 \ - example05 \ - example06 \ - example07 \ - example08 \ - example09 \ - example10 \ - example11 \ - example12 \ - example13 \ - example14 \ - example15 \ - example16 \ - example17 \ - example18 \ - example19 \ - example20 \ - example21 \ - example22 - -all : $(TARGET) copy_curlpp - -rebuild: clean all - -clean: - @echo Cleaning... - del *.o *.exe >NUL 2>&1 - -copy_curlpp: -!IF "$(cfg)"=="DebugDynamic" || "$(cfg)"=="ReleaseDynamic" - copy ..\$(cfg)\curlpp.dll .\ -!ENDIF - -.SUFFIXES: .cpp .o - -.cpp.o: - $(CC) $(CFLAGS) /Fo"$@" $< - - diff --git a/examples/README b/examples/README index c9b488f..c6f399c 100644 --- a/examples/README +++ b/examples/README @@ -23,7 +23,7 @@ usage. (SslEngineDefault) Example 16: HTTP POST example with HTTP Authentification. Example 17: Binded method functor for WriteFunction example. - Example 18: Boost binded method 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. diff --git a/examples/curlpp.examples.VC8.vcproj b/examples/curlpp.examples.VC8.vcproj deleted file mode 100644 index c9a5174..0000000 --- a/examples/curlpp.examples.VC8.vcproj +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/example03.cpp b/examples/example03.cpp index a6fddbf..6230614 100644 --- a/examples/example03.cpp +++ b/examples/example03.cpp @@ -66,8 +66,8 @@ int main(int argc, char *argv[]) using namespace curlpp::Options; request.setOpt(Verbose(true)); - request.setOpt(DebugFunction(curlpp::types::DebugFunctionFunctor(&myWindow, - &MyWindow::writeDebug))); + using namespace std::placeholders; + request.setOpt(DebugFunction(std::bind(&MyWindow::writeDebug, &myWindow, _1, _2, _3))); request.setOpt(Url(url)); request.perform(); diff --git a/examples/example06.cpp b/examples/example06.cpp index 25556f0..78cfe1d 100644 --- a/examples/example06.cpp +++ b/examples/example06.cpp @@ -118,8 +118,9 @@ int main(int argc, char *argv[]) // Set the writer callback to enable cURL // to write result in a memory area - curlpp::types::WriteFunctionFunctor functor(&mWriterChunk, - &WriterMemoryClass::WriteMemoryCallback); + 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); diff --git a/examples/example08.cpp b/examples/example08.cpp index b9cb437..a56302c 100644 --- a/examples/example08.cpp +++ b/examples/example08.cpp @@ -71,8 +71,8 @@ int main(int argc, char *argv[]) using namespace curlpp::Options; request.setOpt(Verbose(true)); - request.setOpt(DebugFunction(curlpp::types::DebugFunctionFunctor(&myWindow, - &MyWindow::writeDebug))); + using namespace std::placeholders; + request.setOpt(DebugFunction(std::bind(&MyWindow::writeDebug, &myWindow, _1, _2, _3))); request.setOpt(Url(url)); request.perform(); diff --git a/examples/example09.cpp b/examples/example09.cpp index 7f54e48..fb97643 100644 --- a/examples/example09.cpp +++ b/examples/example09.cpp @@ -63,17 +63,17 @@ int main(int argc, char *argv[]) MyWindow myWindow; try - { - curlpp::Cleanup cleaner; - curlpp::Easy request; - - using namespace curlpp::Options; - request.setOpt(Verbose(true)); - request.setOpt(DebugFunction(curlpp::types::DebugFunctionFunctor(&myWindow, - &MyWindow::writeDebug))); - request.setOpt(Url(url)); - - request.perform(); + { + 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 ) diff --git a/examples/example10.cpp b/examples/example10.cpp index 1e4ab75..e406122 100644 --- a/examples/example10.cpp +++ b/examples/example10.cpp @@ -73,8 +73,8 @@ int main(int argc, char *argv[]) curlpp::Easy request; // Set the writer callback to enable cURL to write result in a memory area - curlpp::types::WriteFunctionFunctor functor(utilspp::BindFirst(utilspp::make_functor(&FileCallback), file)); - curlpp::options::WriteFunction *test = new curlpp::options::WriteFunction(functor); + 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. diff --git a/examples/example13.cpp b/examples/example13.cpp index 0ef0cc3..b989ae8 100644 --- a/examples/example13.cpp +++ b/examples/example13.cpp @@ -38,6 +38,9 @@ #include #include +#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +#pragma comment(lib, "Ws2_32.lib") +#endif // WIN32 int main(int argc, char *argv[]) { diff --git a/examples/example14.cpp b/examples/example14.cpp index 2bb7d33..08c1196 100644 --- a/examples/example14.cpp +++ b/examples/example14.cpp @@ -37,6 +37,10 @@ #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) { diff --git a/examples/example17.cpp b/examples/example17.cpp index 6b5cb80..db7a959 100644 --- a/examples/example17.cpp +++ b/examples/example17.cpp @@ -82,8 +82,8 @@ int main(int argc, char *argv[]) // Set the writer callback to enable cURL // to write result in a memory area - curlpp::types::WriteFunctionFunctor functor(utilspp::BindFirst(utilspp::make_functor(&mObject, &MethodClass::write), &request)); - curlpp::options::WriteFunction *test = new curlpp::options::WriteFunction(functor); + 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. diff --git a/examples/example18.cpp b/examples/example18.cpp index 12c9ea3..21f4c56 100644 --- a/examples/example18.cpp +++ b/examples/example18.cpp @@ -1,116 +1,115 @@ -/* - * 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 -#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; +/* + * 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; -} + + // 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; +} diff --git a/examples/example24.cpp b/examples/example24.cpp index 9670fc9..3d5213c 100644 --- a/examples/example24.cpp +++ b/examples/example24.cpp @@ -82,8 +82,8 @@ int main(int argc, char *argv[]) // Set the debug callback to enable cURL // to write result in a stream - curlpp::types::DebugFunctionFunctor functor(utilspp::BindFirst(utilspp::make_functor(&mObject, &MethodClass::debug), &request)); - curlpp::options::DebugFunction * test = new curlpp::options::DebugFunction(functor); + 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. diff --git a/extras/CMakeLists.txt b/extras/CMakeLists.txt new file mode 100644 index 0000000..d20150b --- /dev/null +++ b/extras/CMakeLists.txt @@ -0,0 +1,43 @@ +# extracting curlpp version text + version num +file (READ ${CURLPP_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_PREFIX}/lib") +set(libdir_static "${CMAKE_INSTALL_PREFIX}/lib/static") +set(prefix "${CMAKE_INSTALL_PREFIX}") +set(exec_prefix "\${prefix}") +set(includedir "\${prefix}/include") + +set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + +# Finally generate a "curl-config" matching this config +configure_file("${CURLPP_SOURCE_DIR}/extras/curlpp-config.in" + "${CURLPP_BINARY_DIR}/curlpp-config" @ONLY) +install(FILES "${CURLPP_BINARY_DIR}/curlpp-config" + DESTINATION bin + 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("${CURLPP_SOURCE_DIR}/extras/curlpp.pc.in" + "${CURLPP_BINARY_DIR}/curlpp.pc" @ONLY) +install(FILES "${CURLPP_BINARY_DIR}/curlpp.pc" + DESTINATION lib/pkgconfig) diff --git a/curlpp-config.in b/extras/curlpp-config.in similarity index 80% rename from curlpp-config.in rename to extras/curlpp-config.in index 0425d4e..43e3a8c 100644 --- a/curlpp-config.in +++ b/extras/curlpp-config.in @@ -56,12 +56,12 @@ while test $# -gt 0; do ;; --version) - echo libcurlpp @VERSION@ + echo libcurlpp @CURLPP_VERSION@ exit 0 ;; --vernum) - echo @VERSIONNUM@ + echo @CURLPP_VERSION_NUM@ exit 0 ;; @@ -70,12 +70,15 @@ while test $# -gt 0; do ;; --cflags) - echo -I@includedir@ @CURLPP_CXXFLAGS@ + echo -I@includedir@ @CURLPP_CXXFLAGS@ `curl-config --cflags` ;; --libs) - echo -L@libdir@ -lcurlpp @LDFLAGS@ @LIBS@ + echo -L@libdir@ @LDFLAGS@ @LIBS@ `curl-config --libs` -lcurlpp ;; + --static-libs) + echo @libdir_static@/libcurlpp_static.@libext@ @LDFLAGS@ @LIBS@ `curl-config --static-libs` + ;; *) echo "unknown option: $1" diff --git a/curlpp.m4 b/extras/curlpp.m4 similarity index 100% rename from curlpp.m4 rename to extras/curlpp.m4 diff --git a/curlpp.pc.in b/extras/curlpp.pc.in similarity index 73% rename from curlpp.pc.in rename to extras/curlpp.pc.in index 09b8e3d..fcd0800 100644 --- a/curlpp.pc.in +++ b/extras/curlpp.pc.in @@ -8,5 +8,6 @@ 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 diff --git a/curlpp.spec.in b/extras/curlpp.spec.in similarity index 100% rename from curlpp.spec.in rename to extras/curlpp.spec.in diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt deleted file mode 100644 index 5cf939f..0000000 --- a/include/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - -add_subdirectory(curlpp) -add_subdirectory(utilspp) - - -########### install files ############### - - - - -#original Makefile.am contents follow: - -#SUBDIRS = curlpp utilspp \ No newline at end of file diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index 5a01d18..0000000 --- a/include/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = curlpp utilspp \ No newline at end of file diff --git a/include/curlpp/CMakeLists.txt b/include/curlpp/CMakeLists.txt deleted file mode 100644 index e601204..0000000 --- a/include/curlpp/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) - - -########### install files ############### - -install(FILES Easy.hpp Easy.inl Exception.hpp Form.hpp Info.hpp Info.inl Infos.hpp Multi.hpp Option.hpp Option.inl OptionBase.hpp Options.hpp Types.hpp cURLpp.hpp config.h.in config.h.sample config.win32.h DESTINATION /include/curlpp) - - - -#original Makefile.am contents follow: - -#pkginclude_HEADERS = \ -# Easy.hpp Easy.inl \ -# Exception.hpp \ -# Form.hpp \ -# Info.hpp Info.inl \ -# Infos.hpp \ -# Multi.hpp \ -# Option.hpp Option.inl \ -# OptionBase.hpp \ -# Options.hpp \ -# Types.hpp \ -# cURLpp.hpp \ -# config.h.in \ -# config.h.sample \ -# config.win32.h -# -#pkgincludedir=$(includedir)/curlpp diff --git a/include/curlpp/Easy.hpp b/include/curlpp/Easy.hpp index f215967..48a1746 100644 --- a/include/curlpp/Easy.hpp +++ b/include/curlpp/Easy.hpp @@ -25,7 +25,6 @@ #define CURLPP_EASY_HPP -#include "internal/buildconfig.h" #include "internal/CurlHandle.hpp" #include "internal/OptionList.hpp" @@ -43,7 +42,7 @@ namespace curlpp * Detailed description. */ - class CURLPPAPI Easy + class Easy { public: @@ -162,13 +161,10 @@ namespace curlpp namespace cURLpp = curlpp; - -#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS #include "Easy.inl" -#endif // Not quite sure if we shouldn't pass a const handle and clone it instead. -CURLPPAPI std::ostream & operator<<(std::ostream & stream, const curlpp::Easy & handle); +std::ostream & operator<<(std::ostream & stream, const curlpp::Easy & handle); #endif // #ifndef CURLPP_EASY_HPP diff --git a/include/curlpp/Exception.hpp b/include/curlpp/Exception.hpp index 16bcc50..66b11d0 100644 --- a/include/curlpp/Exception.hpp +++ b/include/curlpp/Exception.hpp @@ -25,7 +25,6 @@ #define CURLPP_EXCEPTION_HPP -#include "internal/buildconfig.h" #include @@ -45,7 +44,7 @@ namespace curlpp * considerations, "unpredictable" by the library user. */ - class CURLPPAPI RuntimeError : public std::runtime_error + class RuntimeError : public std::runtime_error { public: @@ -66,7 +65,7 @@ namespace curlpp * that the library user is missusing the library. */ - class CURLPPAPI LogicError : public std::logic_error + class LogicError : public std::logic_error { public: @@ -86,7 +85,7 @@ namespace curlpp * "unpredictable" by the library user. */ - class CURLPPAPI LibcurlRuntimeError : public curlpp::RuntimeError + class LibcurlRuntimeError : public curlpp::RuntimeError { public: @@ -114,7 +113,7 @@ namespace curlpp * user is missusing the library. */ - class CURLPPAPI LibcurlLogicError : public curlpp::LogicError + class LibcurlLogicError : public curlpp::LogicError { public: @@ -144,8 +143,8 @@ namespace curlpp public: - CURLPPAPI UnsetOption(const std::string & reason); - CURLPPAPI UnsetOption(const char * reason); + UnsetOption(const std::string & reason); + UnsetOption(const char * reason); }; @@ -160,7 +159,7 @@ namespace curlpp public: - CURLPPAPI NotAvailable(); + NotAvailable(); }; @@ -175,7 +174,7 @@ namespace curlpp public: - CURLPPAPI UnknowException(); + UnknowException(); }; @@ -185,7 +184,7 @@ namespace curlpp * It's used to throw exceptions within callbacks */ - class CURLPPAPI CallbackExceptionBase : public curlpp::RuntimeError + class CallbackExceptionBase : public curlpp::RuntimeError { protected: @@ -207,7 +206,7 @@ namespace curlpp */ template - class CURLPPAPI CallbackException : public CallbackExceptionBase + class CallbackException : public CallbackExceptionBase { public: @@ -262,8 +261,8 @@ namespace curlpp * code, something we don't want in inline functions. */ - void CURLPPAPI libcurlRuntimeAssert(const std::string & reason, CURLcode code); - void CURLPPAPI libcurlRuntimeAssert(const char * reason, CURLcode code); + void libcurlRuntimeAssert(const std::string & reason, CURLcode code); + void libcurlRuntimeAssert(const char * reason, CURLcode code); /** @@ -273,8 +272,8 @@ namespace curlpp * code, something we don't want in inline functions. */ - void CURLPPAPI libcurlLogicAssert(const std::string & reason, CURLcode code); - void CURLPPAPI libcurlLogicAssert(const char * reason, CURLcode code); + void libcurlLogicAssert(const std::string & reason, CURLcode code); + void libcurlLogicAssert(const char * reason, CURLcode code); /** @@ -284,8 +283,8 @@ namespace curlpp * an inline function. */ - void CURLPPAPI runtimeAssert(const std::string & reason, bool isOkay); - void CURLPPAPI runtimeAssert(const char * reason, bool isOkay); + void runtimeAssert(const std::string & reason, bool isOkay); + void runtimeAssert(const char * reason, bool isOkay); /** @@ -295,8 +294,8 @@ namespace curlpp * want in an inline function. */ - void CURLPPAPI logicAssert(const std::string & reason, bool isOkay); - void CURLPPAPI logicAssert(const char * reason, bool isOkay); + void logicAssert(const std::string & reason, bool isOkay); + void logicAssert(const char * reason, bool isOkay); } // namespace curlpp diff --git a/include/curlpp/Form.hpp b/include/curlpp/Form.hpp index 2b81116..c499aee 100644 --- a/include/curlpp/Form.hpp +++ b/include/curlpp/Form.hpp @@ -25,7 +25,6 @@ #define CURLPP_FORM_HPP -#include "internal/buildconfig.h" #include #include @@ -49,7 +48,7 @@ namespace curlpp * class. */ - class CURLPPAPI HttpPost + class HttpPost { public: @@ -98,7 +97,7 @@ namespace curlpp * to inherit from it to define a type of post. */ - class CURLPPAPI FormPart + class FormPart { friend class HttpPost; @@ -143,7 +142,7 @@ namespace FormParts * HTTP post. */ - class CURLPPAPI File : public FormPart + class File : public FormPart { public: @@ -205,7 +204,7 @@ namespace FormParts * HTTP post. */ - class CURLPPAPI Content : public FormPart + class Content : public FormPart { public: diff --git a/include/curlpp/Info.hpp b/include/curlpp/Info.hpp index c316ed4..5132218 100644 --- a/include/curlpp/Info.hpp +++ b/include/curlpp/Info.hpp @@ -26,7 +26,6 @@ #define CURLPP_INFO_HPP -#include "internal/buildconfig.h" #include "Easy.hpp" @@ -42,7 +41,7 @@ namespace curlpp */ template - struct CURLPPAPI Info + struct Info { static void get(const curlpp::Easy & handle, T & value); static T get(const curlpp::Easy & handle); @@ -55,7 +54,7 @@ namespace curlpp */ template - struct CURLPPAPI NotAvailableInfo : Info + struct NotAvailableInfo : Info { static void get(const curlpp::Easy & handle, T & value); static T get(const curlpp::Easy & handle); @@ -70,7 +69,7 @@ namespace curlpp */ template - struct CURLPPAPI InfoTypeConverter + struct InfoTypeConverter { static void get(const curlpp::Easy & handle, CURLINFO info, T & value); }; @@ -105,7 +104,7 @@ namespace curlpp * private data. */ - struct CURLPPAPI InfoGetter + struct InfoGetter { template static void get(const curlpp::Easy & handle, CURLINFO info, T & value); @@ -117,9 +116,6 @@ namespace curlpp namespace cURLpp = curlpp; -#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "Info.inl" -#endif - +#include "Info.inl" #endif // #ifndef CURLPP_INFO_HPP diff --git a/include/curlpp/Makefile.am b/include/curlpp/Makefile.am deleted file mode 100644 index db10941..0000000 --- a/include/curlpp/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -SUBDIRS = internal - -pkginclude_HEADERS = \ - Easy.hpp Easy.inl \ - Exception.hpp \ - Form.hpp \ - Info.hpp Info.inl \ - Infos.hpp \ - Multi.hpp \ - Option.hpp Option.inl \ - OptionBase.hpp \ - Options.hpp \ - Types.hpp \ - cURLpp.hpp \ - config.h.in \ - config.h.sample \ - config.win32.h - -pkgincludedir=$(includedir)/curlpp diff --git a/include/curlpp/Multi.hpp b/include/curlpp/Multi.hpp index 926fefc..c29102e 100644 --- a/include/curlpp/Multi.hpp +++ b/include/curlpp/Multi.hpp @@ -37,7 +37,7 @@ namespace curlpp class Easy; - class CURLPPAPI Multi + class Multi { public: diff --git a/include/curlpp/Option.hpp b/include/curlpp/Option.hpp index b49717d..5781820 100644 --- a/include/curlpp/Option.hpp +++ b/include/curlpp/Option.hpp @@ -25,7 +25,6 @@ #define CURLPP_OPTION_HPP -#include "internal/buildconfig.h" #include "internal/OptionContainer.hpp" #include "OptionBase.hpp" @@ -45,7 +44,7 @@ namespace curlpp */ template - class CURLPPAPI Option : public curlpp::OptionBase + class Option : public curlpp::OptionBase { public: @@ -143,7 +142,7 @@ namespace curlpp */ template - class CURLPPAPI OptionTrait : public Option + class OptionTrait : public Option { friend class Easy; @@ -188,7 +187,7 @@ namespace curlpp */ template - class CURLPPAPI NoValueOptionTrait : public OptionTrait + class NoValueOptionTrait : public OptionTrait { public: @@ -209,7 +208,7 @@ namespace curlpp */ template - class CURLPPAPI NotAvailableOptionTrait : public Option + class NotAvailableOptionTrait : public Option { public: @@ -249,9 +248,6 @@ namespace curlpp namespace cURLpp = curlpp; -#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS #include "Option.inl" -#endif - #endif // #ifndef CURLPP_OPTION_HPP diff --git a/include/curlpp/OptionBase.hpp b/include/curlpp/OptionBase.hpp index 83082a6..2129208 100644 --- a/include/curlpp/OptionBase.hpp +++ b/include/curlpp/OptionBase.hpp @@ -25,7 +25,6 @@ #define CURLPP_OPTION_BASE_HPP -#include "internal/buildconfig.h" #include @@ -49,7 +48,7 @@ namespace internal * This is only used to be able to stock a list of options. */ - class CURLPPAPI OptionBase + class OptionBase { public: diff --git a/include/curlpp/Options.hpp b/include/curlpp/Options.hpp index 701311b..c705c9d 100644 --- a/include/curlpp/Options.hpp +++ b/include/curlpp/Options.hpp @@ -90,13 +90,8 @@ namespace options typedef curlpp::OptionTrait WriteFunction; - #ifdef HAVE_BOOST - typedef curlpp::OptionTrait - BoostWriteFunction; - #endif - - /** + /** * Using this option will reset CURLOPT_WRITEFUNCTION to * default callback. In fact, use only this option if you only * want libcURL to use the FILE * given in argument instead @@ -122,11 +117,6 @@ namespace options typedef curlpp::OptionTrait ReadFunction; - #ifdef HAVE_BOOST - typedef curlpp::OptionTrait - BoostReadFunction; - - #endif #else #ifdef CURLPP_ALLOW_NOT_AVAILABLE @@ -137,10 +127,6 @@ namespace options typedef curlpp::NotAvailableOptionTrait ReadFunction; - #ifdef HAVE_BOOST - typedef curlpp::NotAvailableOptionTrait - BoostReadFunction; - #endif // HAVE_BOOST #endif // CURLPP_ALLOW_NOT_AVAILABLE #endif // LIBCURL_VERSION_NUM @@ -166,36 +152,15 @@ namespace options typedef curlpp::OptionTrait ProgressFunction; - #ifdef HAVE_BOOST - typedef curlpp::OptionTrait - BoostProgressFunction; - #endif - typedef curlpp::OptionTrait HeaderFunction; - #ifdef HAVE_BOOST - typedef curlpp::OptionTrait - BoostHeaderFunction; - #endif - typedef curlpp::OptionTrait DebugFunction; - #ifdef HAVE_BOOST - typedef curlpp::OptionTrait - BoostDebugFunction; - #endif - typedef curlpp::OptionTrait SslCtxFunction; - #ifdef HAVE_BOOST - typedef curlpp::OptionTrait - BoostSslCtxFunction; - #endif - - /** * Error options. */ @@ -365,7 +330,7 @@ namespace options namespace cURLpp = curlpp; -CURLPPAPI std::ostream & operator<<(std::ostream & stream, const curlpp::options::Url & url); +std::ostream & operator<<(std::ostream & stream, const curlpp::options::Url & url); #endif // #ifndef CURLPP_OPTIONS_HPP diff --git a/include/curlpp/Types.hpp b/include/curlpp/Types.hpp index 26ed04e..7cdbaa0 100644 --- a/include/curlpp/Types.hpp +++ b/include/curlpp/Types.hpp @@ -25,13 +25,8 @@ #define CURLPP_TYPES_HPP -#include "internal/global.h" -#ifdef HAVE_BOOST - #include -#endif - -#include +#include namespace curlpp @@ -41,39 +36,13 @@ namespace curlpp namespace types { - - typedef utilspp::Functor< - size_t, - TYPE_LIST_3(char*, size_t, size_t)> WriteFunctionFunctor; - - typedef utilspp::Functor< - size_t, - TYPE_LIST_3(char*, size_t, size_t)> ReadFunctionFunctor; - + typedef std::function< size_t(char*, size_t, size_t) > WriteFunctionFunctor; + typedef std::function< size_t(char*, size_t, size_t) > ReadFunctionFunctor; /// DebugFunctor related typedefs - typedef utilspp::Functor< - int, - TYPE_LIST_3(curl_infotype, - char *, - size_t)> DebugFunctionFunctor; - - typedef utilspp::Functor< - CURLcode, - TYPE_LIST_1(void *)> SslCtxFunctionFunctor; - - typedef utilspp::Functor< - int, - TYPE_LIST_4(double, double, double, double)> ProgressFunctionFunctor; - - #ifdef HAVE_BOOST - typedef boost::function3 BoostWriteFunction; - typedef boost::function3 BoostReadFunction; - typedef boost::function3 BoostDebugFunction; - typedef boost::function1 BoostSslCtxFunction; - typedef boost::function4 BoostProgressFunction; - #endif - - + typedef std::function< int(curl_infotype, char *, size_t) > DebugFunctionFunctor; + typedef std::function< CURLcode(void *) > SslCtxFunctionFunctor; + typedef std::function< int(double, double, double, double)> ProgressFunctionFunctor; + } // namespace types namespace Types = types; diff --git a/include/curlpp/cURLpp.hpp b/include/curlpp/cURLpp.hpp index d1bcb32..6f9183a 100644 --- a/include/curlpp/cURLpp.hpp +++ b/include/curlpp/cURLpp.hpp @@ -25,11 +25,10 @@ #ifndef CURLPP_CURLPP_HPP #define CURLPP_CURLPP_HPP -#define LIBCURLPP_VERSION "0.7.4" -#define LIBCURLPP_VERSION_NUM 0x000704 +#define LIBCURLPP_VERSION "0.8.0" +#define LIBCURLPP_VERSION_NUM 0x000800 -#include "internal/buildconfig.h" #include @@ -65,7 +64,7 @@ namespace curlpp * NOTE: you should never call this function twice. */ - void CURLPPAPI initialize(long flags = CURL_GLOBAL_ALL); + void initialize(long flags = CURL_GLOBAL_ALL); /** * This function takes care of cleaning up curlpp (also libcURL). @@ -75,7 +74,7 @@ namespace curlpp * called in once; it will throw a logic_error if you do otherwise. */ - void CURLPPAPI terminate(); + void terminate(); /** * \depreciated This is an obsolete class. DO NOT use it. @@ -98,7 +97,7 @@ namespace curlpp * See curlpp::initialize(long flags) and curlpp:terminate() for more documentation. */ - class CURLPPAPI Cleanup + class Cleanup { public: @@ -117,7 +116,7 @@ namespace curlpp * version (%NN where NN is a two-digit hexadecimal number). */ - std::string CURLPPAPI escape(const std::string & url); + std::string escape(const std::string & url); /** * Decodes URL encoded string. @@ -130,7 +129,7 @@ namespace curlpp * converted). */ - std::string CURLPPAPI unescape(const std::string & url); + std::string unescape(const std::string & url); /** * Portable wrapper for the getenv() function. @@ -144,7 +143,7 @@ namespace curlpp * systems. */ - std::string CURLPPAPI getenv(const std::string & name); + std::string getenv(const std::string & name); /** * Returns a human readable string with the version number of libcurl and @@ -154,7 +153,7 @@ namespace curlpp * installed a newer lib's include files in your system which may turn * your LIBCURL_VERSION #define value to differ from this result. */ - std::string CURLPPAPI libcurlVersion(); + std::string libcurlVersion(); /** * This function returns the number of seconds since January 1st 1970, @@ -213,7 +212,7 @@ namespace curlpp * specified calendar date. */ - time_t CURLPPAPI getdate(const std::string & date, time_t * now = 0); + time_t getdate(const std::string & date, time_t * now = 0); } // namespace curlpp diff --git a/include/curlpp/config.h.sample b/include/curlpp/config.h.sample deleted file mode 100644 index 48a92b7..0000000 --- a/include/curlpp/config.h.sample +++ /dev/null @@ -1,71 +0,0 @@ -/* curlpp/config.h. Generated from config.h.in by configure. */ -/* curlpp/config.h.in. Generated from configure.ac by autoheader. */ - -/* when building cURLpp itself */ -/* #undef BUILDING_CURLPP */ - -/* when not building a shared library */ -/* #undef CURLPP_STATICLIB */ - -/* define if the Boost library is available */ -/* #undef HAVE_BOOST */ - -/* Define to 1 if you have the header file. */ -#define HAVE_CURL_CURL_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_OSTREAM 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Name of package */ -#define PACKAGE "curlpp" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define to 1 if you have the ANSI C header files. */ -/* #undef STDC_HEADERS */ - -/* Version number of package */ -#define VERSION "0.7.2" diff --git a/include/curlpp/config.win32.h b/include/curlpp/config.win32.h deleted file mode 100644 index 3dc90da..0000000 --- a/include/curlpp/config.win32.h +++ /dev/null @@ -1,67 +0,0 @@ -/* config.win32.h Config for Win32 platform. See configure.ac */ -/* config.h.in Generated from configure.ac by autoheader. */ - -/* Define when building curlpp itself */ -/* DO NOT define or undefine this symbol if you are building from the IDE */ -/* using solution files for VC9. Project files define or undefine this from within the IDE */ -//#define BUILDING_CURLPP - -/* Define to 1 if you have the header file. */ -#define HAVE_CURL_CURL_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_OSTREAM 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#define PACKAGE "curlpp" - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "CurlPP" - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS - -/* Version number of package */ -#define VERSION 0.7.2 diff --git a/include/curlpp/internal/CMakeLists.txt b/include/curlpp/internal/CMakeLists.txt deleted file mode 100644 index 8613a4f..0000000 --- a/include/curlpp/internal/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - - -########### install files ############### - -install(FILES CurlHandle.hpp CurlHandle.inl OptionContainer.hpp OptionContainer.inl OptionContainerType.hpp OptionList.hpp OptionSetter.hpp OptionSetter.inl SList.hpp buildconfig.h global.h DESTINATION /include/curlpp/internal) - - - -#original Makefile.am contents follow: - -#pkginclude_HEADERS = \ -# CurlHandle.hpp CurlHandle.inl \ -# OptionContainer.hpp OptionContainer.inl OptionContainerType.hpp \ -# OptionList.hpp \ -# OptionSetter.hpp OptionSetter.inl \ -# SList.hpp \ -# buildconfig.h \ -# global.h -# -#pkgincludedir=$(includedir)/curlpp/internal diff --git a/include/curlpp/internal/CurlHandle.hpp b/include/curlpp/internal/CurlHandle.hpp index 7986ae5..75e4502 100644 --- a/include/curlpp/internal/CurlHandle.hpp +++ b/include/curlpp/internal/CurlHandle.hpp @@ -25,7 +25,6 @@ #define CURLPP_CURL_HANDLE_HPP -#include "buildconfig.h" #include "../Exception.hpp" #include "../Types.hpp" @@ -47,7 +46,7 @@ namespace internal * Wrapper for CURL * handle. */ - class CURLPPAPI CurlHandle + class CurlHandle { public: @@ -199,9 +198,6 @@ namespace internal namespace cURLpp = curlpp; -#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "CurlHandle.inl" -#endif - +#include "CurlHandle.inl" #endif // #ifndef CURLPP_CURL_HANDLE_HPP diff --git a/include/curlpp/internal/Makefile.am b/include/curlpp/internal/Makefile.am deleted file mode 100644 index af431de..0000000 --- a/include/curlpp/internal/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -pkginclude_HEADERS = \ - CurlHandle.hpp CurlHandle.inl \ - OptionContainer.hpp OptionContainer.inl OptionContainerType.hpp \ - OptionList.hpp \ - OptionSetter.hpp OptionSetter.inl \ - SList.hpp \ - buildconfig.h \ - global.h - -pkgincludedir=$(includedir)/curlpp/internal diff --git a/include/curlpp/internal/OptionContainer.hpp b/include/curlpp/internal/OptionContainer.hpp index 2fde02f..b5060d3 100644 --- a/include/curlpp/internal/OptionContainer.hpp +++ b/include/curlpp/internal/OptionContainer.hpp @@ -25,7 +25,6 @@ #define CURLPP_OPTION_CONTAINER_HPP -#include "buildconfig.h" #include "OptionContainerType.hpp" @@ -44,7 +43,7 @@ namespace internal * This class is used to set an option to a handle and to keep it's value. */ template - class CURLPPAPI OptionContainer + class OptionContainer { public: @@ -101,11 +100,7 @@ namespace internal namespace cURLpp = curlpp; - -#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "OptionContainer.inl" -#endif - +#include "OptionContainer.inl" #endif // #ifndef CURLPP_OPTION_CONTAINER_HPP diff --git a/include/curlpp/internal/OptionList.hpp b/include/curlpp/internal/OptionList.hpp index 57b0d8c..cc60996 100644 --- a/include/curlpp/internal/OptionList.hpp +++ b/include/curlpp/internal/OptionList.hpp @@ -24,7 +24,6 @@ #ifndef CURLPP_OPTION_LIST_HPP #define CURLPP_OPTION_LIST_HPP -#include "buildconfig.h" #include "../OptionBase.hpp" @@ -44,7 +43,7 @@ namespace internal * option set on a handle. */ - class CURLPPAPI OptionList + class OptionList { public: diff --git a/include/curlpp/internal/OptionSetter.hpp b/include/curlpp/internal/OptionSetter.hpp index a65ec8a..7492cf6 100644 --- a/include/curlpp/internal/OptionSetter.hpp +++ b/include/curlpp/internal/OptionSetter.hpp @@ -25,7 +25,6 @@ #define CURLPP_OPTION_SETTER_HPP -#include "buildconfig.h" #include "OptionContainerType.hpp" #include "CurlHandle.hpp" @@ -45,7 +44,7 @@ namespace internal */ template - class CURLPPAPI OptionSetter + class OptionSetter { public: @@ -63,7 +62,7 @@ namespace internal */ template - class CURLPPAPI OptionSetter + class OptionSetter { public: @@ -81,7 +80,7 @@ namespace internal */ template - class CURLPPAPI OptionSetter, optionType> + class OptionSetter, optionType> { public: @@ -102,7 +101,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter + class OptionSetter { public: @@ -123,7 +122,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -147,7 +146,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -171,7 +170,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -193,7 +192,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -214,7 +213,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -238,7 +237,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -262,7 +261,7 @@ namespace internal */ template <> - class CURLPPAPI OptionSetter { @@ -284,7 +283,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -306,7 +305,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -330,7 +329,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -354,7 +353,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -379,7 +378,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -403,7 +402,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -427,7 +426,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -451,7 +450,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -475,7 +474,7 @@ namespace internal */ template<> - class CURLPPAPI OptionSetter { @@ -500,10 +499,6 @@ namespace internal namespace cURLpp = curlpp; - -#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "OptionSetter.inl" -#endif - +#include "OptionSetter.inl" #endif // #ifndef CURLPP_OPTION_SETTER_HPP diff --git a/include/curlpp/internal/SList.hpp b/include/curlpp/internal/SList.hpp index 68f93e1..a040a42 100644 --- a/include/curlpp/internal/SList.hpp +++ b/include/curlpp/internal/SList.hpp @@ -25,7 +25,6 @@ #define CURLPP_SLIST_HPP -#include "buildconfig.h" #include @@ -44,7 +43,7 @@ namespace internal * This class is binding the curl_slist struct. */ - class CURLPPAPI SList + class SList { public: @@ -87,7 +86,7 @@ namespace internal namespace cURLpp = curlpp; -std::ostream CURLPPAPI & operator<<(std::ostream & stream, const std::list & value); +std::ostream & operator<<(std::ostream & stream, const std::list & value); #endif // #ifndef CURLPP_SLIST_HPP diff --git a/include/curlpp/internal/buildconfig.h b/include/curlpp/internal/buildconfig.h deleted file mode 100644 index 9600c64..0000000 --- a/include/curlpp/internal/buildconfig.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (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. - */ - -#ifndef CURLPP_BUILDCONFIG_H -#define CURLPP_BUILDCONFIG_H - -/* - * Decorate exportable functions for Win32 DLL linking. - * This avoids using a .def file for building curlpp.dll. - */ -#if !defined(CURLPP_STATICLIB) - #if defined(BUILDING_CURLPP) - #if (defined(WIN32) || defined(_WIN32)) - #define CURLPPAPI __declspec(dllexport) - #else - #define CURLPPAPI - #endif - - #define CURLPP_LIB_EXPORT - #undef CURLPP_LIB_IMPORT - #else - #if (defined(WIN32) || defined(_WIN32)) - #define CURLPPAPI __declspec(dllimport) - #else - #define CURLPPAPI - #endif - - #define CURLPP_LIB_IMPORT - #undef CURLPP_LIB_EXPORT - #endif -#else - #define CURLPPAPI - - #undef CURLPP_LIB_IMPORT - #undef CURLPP_LIB_EXPORT -#endif - -#if defined (CURLPP_SELF_CONTAINED) - #if defined(BUILDING_CURLPP) - #define CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #define CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION - #else - #undef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #undef CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION - #endif -#else - #if defined(BUILDING_CURLPP) - #define CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #undef CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION - #else - #define CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #undef CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION - #endif -#endif - - -#endif // #ifndef CURLPP_BUILDCONFIG_H diff --git a/include/curlpp/internal/global.h b/include/curlpp/internal/global.h deleted file mode 100644 index 45dd517..0000000 --- a/include/curlpp/internal/global.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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_GLOBAL_H -#define CURLPP_GLOBAL_H - -#ifndef HAVE_CONFIG_H - #include "../config.win32.h" -#else - #include "../config.h" -#endif - -#endif // #ifndef CURLPP_GLOBAL_H diff --git a/include/utilspp/CMakeLists.txt b/include/utilspp/CMakeLists.txt deleted file mode 100644 index cc09aae..0000000 --- a/include/utilspp/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - - -########### install files ############### - -install(FILES EmptyType.hpp Functors.hpp NonCopyable.hpp NullType.hpp Singleton.hpp SmartPtr.hpp ThreadingFactoryMutex.hpp ThreadingFactoryMutex.inl ThreadingSingle.hpp ThreadingSingle.inl TypeList.hpp TypeTrait.hpp clone_ptr.hpp DESTINATION /include/utilspp) - - - -#original Makefile.am contents follow: - -#pkginclude_HEADERS = \ -# EmptyType.hpp \ -# Functors.hpp \ -# NonCopyable.hpp \ -# NullType.hpp \ -# Singleton.hpp \ -# SmartPtr.hpp \ -# ThreadingFactoryMutex.hpp ThreadingFactoryMutex.inl \ -# ThreadingSingle.hpp ThreadingSingle.inl \ -# TypeList.hpp \ -# TypeTrait.hpp \ -# clone_ptr.hpp -# -#pkgincludedir=$(includedir)/utilspp diff --git a/include/utilspp/Functors.hpp b/include/utilspp/Functors.hpp deleted file mode 100644 index 5c47d26..0000000 --- a/include/utilspp/Functors.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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 UTILSPP_FUNCTORS_HPP -#define UTILSPP_FUNCTORS_HPP - -#include "functor/Functor.hpp" - -#endif diff --git a/include/utilspp/Makefile.am b/include/utilspp/Makefile.am deleted file mode 100644 index 14d7c51..0000000 --- a/include/utilspp/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -SUBDIRS = functor singleton - -pkginclude_HEADERS = \ - EmptyType.hpp \ - Functors.hpp \ - NonCopyable.hpp \ - NullType.hpp \ - Singleton.hpp \ - SmartPtr.hpp \ - ThreadingFactoryMutex.hpp ThreadingFactoryMutex.inl \ - ThreadingSingle.hpp ThreadingSingle.inl \ - TypeList.hpp \ - TypeTrait.hpp \ - clone_ptr.hpp - -pkgincludedir=$(includedir)/utilspp diff --git a/include/utilspp/Singleton.hpp b/include/utilspp/Singleton.hpp deleted file mode 100644 index 52fe364..0000000 --- a/include/utilspp/Singleton.hpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "ThreadingSingle.hpp" -#include "singleton/SingletonHolder.hpp" -#include "singleton/LifetimeLibrary.hpp" diff --git a/include/utilspp/ThreadingFactoryMutex.hpp b/include/utilspp/ThreadingFactoryMutex.hpp index 78d154d..77fc072 100644 --- a/include/utilspp/ThreadingFactoryMutex.hpp +++ b/include/utilspp/ThreadingFactoryMutex.hpp @@ -24,7 +24,6 @@ #ifndef THREADING_FACTORY_MUTEX_HPP #define THREADING_FACTORY_MUTEX_HPP -//#include "curlpp/internal/buildconfig.h" namespace utilspp { @@ -41,8 +40,6 @@ namespace utilspp }; } -//#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "utilspp/ThreadingFactoryMutex.inl" -//#endif +#include "utilspp/ThreadingFactoryMutex.inl" #endif diff --git a/include/utilspp/ThreadingSingle.hpp b/include/utilspp/ThreadingSingle.hpp index d36a15b..27576ee 100644 --- a/include/utilspp/ThreadingSingle.hpp +++ b/include/utilspp/ThreadingSingle.hpp @@ -24,7 +24,6 @@ #ifndef SINGLE_THREADED_HPP #define SINGLE_THREADED_HPP -//#include "curlpp/internal/buildconfig.h" #include "utilspp/NullType.hpp" namespace utilspp @@ -48,8 +47,6 @@ namespace utilspp }; } -//#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "utilspp/ThreadingSingle.inl" -//#endif +#include "utilspp/ThreadingSingle.inl" #endif diff --git a/include/utilspp/functor/Binder.hpp b/include/utilspp/functor/Binder.hpp deleted file mode 100644 index 67ffbba..0000000 --- a/include/utilspp/functor/Binder.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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_BINDER_HPP -#define CURLPP_BINDER_HPP - -#include - -namespace utilspp -{ - template - class BinderFirst : public FunctorImpl - { - typedef utilspp::Functor Outgoing; - typedef typename Incoming::Parm1 Bound; - typedef typename Incoming::ResultType ResultType; - - public: - BinderFirst(const Incoming & fun, Bound bound) - : mFun(fun), mBound(bound) - {} - - BinderFirst* clone() const - {return new BinderFirst(*this);} - - ResultType operator()() - {return mFun(mBound)();} - - ResultType operator()(typename Outgoing::Parm1 p1) - {return mFun(mBound, p1);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2) - {return mFun(mBound, p1, p2);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3) - {return mFun(mBound, p1, p2, p3);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4) - {return mFun(mBound, p1, p2, p3, p4);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5) - {return mFun(mBound, p1, p2, p3, p4, p5);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6) - {return mFun(mBound, p1, p2, p3, p4, p5, p6);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6, typename Outgoing::Parm7 p7) - {return mFun(mBound, p1, p2, p3, p4, p5, p6, p7);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6, typename Outgoing::Parm7 p7, typename Outgoing::Parm8 p8) - {return mFun(mBound, p1, p2, p3, p4, p5, p6, p7, p8);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6, typename Outgoing::Parm7 p7, typename Outgoing::Parm8 p8, typename Outgoing::Parm9 p9) - {return mFun(mBound, p1, p2, p3, p4, p5, p6, p7, p8, p9);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6, typename Outgoing::Parm7 p7, typename Outgoing::Parm8 p8, typename Outgoing::Parm9 p9, typename Outgoing::Parm10 p10) - {return mFun(mBound, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6, typename Outgoing::Parm7 p7, typename Outgoing::Parm8 p8, typename Outgoing::Parm9 p9, typename Outgoing::Parm10 p10, typename Outgoing::Parm11 p11) - {return mFun(mBound, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6, typename Outgoing::Parm7 p7, typename Outgoing::Parm8 p8, typename Outgoing::Parm9 p9, typename Outgoing::Parm10 p10, typename Outgoing::Parm11 p11, typename Outgoing::Parm12 p12) - {return mFun(mBound, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6, typename Outgoing::Parm7 p7, typename Outgoing::Parm8 p8, typename Outgoing::Parm9 p9, typename Outgoing::Parm10 p10, typename Outgoing::Parm11 p11, typename Outgoing::Parm12 p12, typename Outgoing::Parm13 p13) - {return mFun(mBound, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);} - - ResultType operator()(typename Outgoing::Parm1 p1, typename Outgoing::Parm2 p2, typename Outgoing::Parm3 p3, typename Outgoing::Parm4 p4, typename Outgoing::Parm5 p5, typename Outgoing::Parm6 p6, typename Outgoing::Parm7 p7, typename Outgoing::Parm8 p8, typename Outgoing::Parm9 p9, typename Outgoing::Parm10 p10, typename Outgoing::Parm11 p11, typename Outgoing::Parm12 p12, typename Outgoing::Parm13 p13, typename Outgoing::Parm14 p14) - {return mFun(mBound, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14);} - - private: - Incoming mFun; - Bound mBound; - }; - - template - Functor BindFirst(const Functor & fun, - typename TList::head bound) - { - typedef Functor Incoming; - typedef Functor Outgoing; - - std::unique_ptr impl_ptr(new BinderFirst(fun, bound)); - return Outgoing(std::move(impl_ptr)); - } - -} - -#endif diff --git a/include/utilspp/functor/CMakeLists.txt b/include/utilspp/functor/CMakeLists.txt deleted file mode 100644 index 3986f39..0000000 --- a/include/utilspp/functor/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - - -########### install files ############### - -install(FILES Binder.hpp FunctorHandler.hpp Functor.hpp FunctorImpl.hpp MemFunHandler.hpp DESTINATION /include/utilspp/functor) - - - -#original Makefile.am contents follow: - -#pkginclude_HEADERS = \ -# Binder.hpp \ -# FunctorHandler.hpp \ -# Functor.hpp \ -# FunctorImpl.hpp \ -# MemFunHandler.hpp -# -#pkgincludedir=$(includedir)/utilspp/functor diff --git a/include/utilspp/functor/Functor.hpp b/include/utilspp/functor/Functor.hpp deleted file mode 100644 index a9cb076..0000000 --- a/include/utilspp/functor/Functor.hpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 UTILSPP_FUNCTOR_HPP -#define UTILSPP_FUNCTOR_HPP - -#include - -#include "../NullType.hpp" -#include "../EmptyType.hpp" -#include "../TypeList.hpp" -#include "../TypeTrait.hpp" - -#include "FunctorImpl.hpp" -#include "FunctorHandler.hpp" -#include "MemFunHandler.hpp" - -#include - -namespace utilspp -{ - template - class Functor - { - public: - typedef FunctorImpl Impl; - - typedef R ResultType; - typedef TList ParmList; - - Functor(const Functor & functor) - : mImpl(functor.mImpl->clone()) - {} - - Functor() - : mImpl() - {} - - Functor(std::unique_ptr impl) - : mImpl(std::move(impl)) - {} - - Functor & operator=(const Functor & functor) - { - mImpl = std::unique_ptr(std::move(functor.mImpl->clone())); - return (*this); - } - - template - Functor(Fun fun) - : mImpl(new FunctorHandler(fun)) - {} - - template - Functor(const PointerToObj & obj, MemFun fun) - : mImpl(new MemFunHandler(obj, fun)) - {} - - bool operator!() - {return !mImpl.get();} - - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm1; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm2; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm3; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm4; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm5; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm6; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm7; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm8; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm9; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm10; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm11; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm12; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm13; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm14; - typedef typename utilspp::tl::TypeAtNonStrict::Result Parm15; - - R operator()() - {return (*mImpl)();} - - R operator()(Parm1 p1) - {return (*mImpl)(p1);} - - R operator()(Parm1 p1, Parm2 p2) - {return (*mImpl)(p1, p2);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3) - {return (*mImpl)(p1, p2, p3);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4) - {return (*mImpl)(p1, p2, p3, p4);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5) - {return (*mImpl)(p1, p2, p3, p4, p5);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6) - {return (*mImpl)(p1, p2, p3, p4, p5, p6);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7, Parm8 p8) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7, p8);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7, p8, p9);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11, Parm12 p12) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11, Parm12 p12, Parm13 p13) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11, Parm12 p12, Parm13 p13, Parm14 p14) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14);} - - R operator()(Parm1 p1, Parm2 p2, Parm3 p3, Parm4 p4, Parm5 p5, Parm6 p6, Parm7 p7, Parm8 p8, Parm9 p9, Parm10 p10, Parm11 p11, Parm12 p12, Parm13 p13, Parm14 p14, Parm15 p15) - {return (*mImpl)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15);} - - private: - std::unique_ptr mImpl; - }; - - template - Functor::ReturnType, - typename PointerOnFunction::ParamList> make_functor(Fun fun) - { - return utilspp::Functor::ReturnType, - typename utilspp::PointerOnFunction::ParamList>(fun); - } - - template - Functor::ReturnType, - typename PointerOnMemberFunction::ParamList> - make_functor(typename PointerOnMemberFunction::ClassType * obj, MemFun fun) - { - return utilspp::Functor::ReturnType, - typename utilspp::PointerOnMemberFunction::ParamList>(obj, fun); - } -} - -#include "Binder.hpp" - -#endif diff --git a/include/utilspp/functor/FunctorHandler.hpp b/include/utilspp/functor/FunctorHandler.hpp deleted file mode 100644 index a230da8..0000000 --- a/include/utilspp/functor/FunctorHandler.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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 UTILSPP_FUNCTORHANDLER_HPP -#define UTILSPP_FUNCTORHANDLER_HPP - -namespace utilspp -{ - template - class FunctorHandler : public FunctorImpl - { - public: - typedef typename ParentFunctor::ResultType ResultType; - - FunctorHandler(Fun fun) : mFun(fun) {} - FunctorHandler* clone() const - {return new FunctorHandler(*this);} - - ResultType operator()() - {return (mFun)();} - - ResultType operator()(typename ParentFunctor::Parm1 p1) - {return (mFun)(p1);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2) - {return (mFun)(p1, p2);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3) - {return (mFun)(p1, p2, p3);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4) - {return (mFun)(p1, p2, p3, p4);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5) - {return (mFun)(p1, p2, p3, p4, p5);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6) - {return (mFun)(p1, p2, p3, p4, p5, p6);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7, p8);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7, p8, p9);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11, typename ParentFunctor::Parm12 p12) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11, typename ParentFunctor::Parm12 p12, typename ParentFunctor::Parm13 p13) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11, typename ParentFunctor::Parm12 p12, typename ParentFunctor::Parm13 p13, typename ParentFunctor::Parm14 p14) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11, typename ParentFunctor::Parm12 p12, typename ParentFunctor::Parm13 p13, typename ParentFunctor::Parm14 p14, typename ParentFunctor::Parm15 p15) - {return (mFun)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15);} - - private: - Fun mFun; - }; -} - -#endif - - diff --git a/include/utilspp/functor/FunctorImpl.hpp b/include/utilspp/functor/FunctorImpl.hpp deleted file mode 100644 index 41057e8..0000000 --- a/include/utilspp/functor/FunctorImpl.hpp +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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 UTILSPP_FUNCTORIMPL_HPP -#define UTILSPP_FUNCTORIMPL_HPP - -namespace utilspp -{ - template - struct FunctorImpl; - - template - struct FunctorImpl - { - R operator()() = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2, P3) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template< - typename R, - typename P1, - typename P2, - typename P3, - typename P4, - typename P5, - typename P6> - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template< - typename R, - typename P1, - typename P2, - typename P3, - typename P4, - typename P5, - typename P6, - typename P7> - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template< - typename R, - typename P1, - typename P2, - typename P3, - typename P4, - typename P5, - typename P6, - typename P7, - typename P8> - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7, P8) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template< - typename R, - typename P1, - typename P2, - typename P3, - typename P4, - typename P5, - typename P6, - typename P7, - typename P8, - typename P9> - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7, P8, P9) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template< - typename R, - typename P1, - typename P2, - typename P3, - typename P4, - typename P5, - typename P6, - typename P7, - typename P8, - typename P9, - typename P10> - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; - - template - struct FunctorImpl - { - virtual R operator()(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15) = 0; - virtual FunctorImpl * clone() const = 0; - virtual ~FunctorImpl(){}; - }; -} - -#endif diff --git a/include/utilspp/functor/Makefile.am b/include/utilspp/functor/Makefile.am deleted file mode 100644 index 8e68b6a..0000000 --- a/include/utilspp/functor/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -pkginclude_HEADERS = \ - Binder.hpp \ - FunctorHandler.hpp \ - Functor.hpp \ - FunctorImpl.hpp \ - MemFunHandler.hpp - -pkgincludedir=$(includedir)/utilspp/functor diff --git a/include/utilspp/functor/MemFunHandler.hpp b/include/utilspp/functor/MemFunHandler.hpp deleted file mode 100644 index 8af37e5..0000000 --- a/include/utilspp/functor/MemFunHandler.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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 UTILSPP_MEMFUNHANDLER_HPP -#define UTILSPP_MEMFUNHANDLER_HPP - -namespace utilspp -{ - template - class MemFunHandler : public FunctorImpl - { - public: - typedef typename ParentFunctor::ResultType ResultType; - MemFunHandler(PointerToObj obj, PointerToMemFn memFn) - : mObj(obj) - , mMemFn(memFn) - {} - - MemFunHandler* clone() const - {return new MemFunHandler(*this);} - - ResultType operator()() - {return ((*mObj).*mMemFn)();} - - ResultType operator()(typename ParentFunctor::Parm1 p1) - {return ((*mObj).*mMemFn)(p1);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2) - {return ((*mObj).*mMemFn)(p1, p2);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, - typename ParentFunctor::Parm2 p2, - typename ParentFunctor::Parm3 p3) - {return ((*mObj).*mMemFn)(p1, p2, p3);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7, p8);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7, p8, p9);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11, typename ParentFunctor::Parm12 p12) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11, typename ParentFunctor::Parm12 p12, typename ParentFunctor::Parm13 p13) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11, typename ParentFunctor::Parm12 p12, typename ParentFunctor::Parm13 p13, typename ParentFunctor::Parm14 p14) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14);} - - ResultType operator()(typename ParentFunctor::Parm1 p1, typename ParentFunctor::Parm2 p2, typename ParentFunctor::Parm3 p3, typename ParentFunctor::Parm4 p4, typename ParentFunctor::Parm5 p5, typename ParentFunctor::Parm6 p6, typename ParentFunctor::Parm7 p7, typename ParentFunctor::Parm8 p8, typename ParentFunctor::Parm9 p9, typename ParentFunctor::Parm10 p10, typename ParentFunctor::Parm11 p11, typename ParentFunctor::Parm12 p12, typename ParentFunctor::Parm13 p13, typename ParentFunctor::Parm14 p14, typename ParentFunctor::Parm15 p15) - {return ((*mObj).*mMemFn)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15);} - - private: - PointerToObj mObj; - PointerToMemFn mMemFn; - }; -} - -#endif - diff --git a/include/utilspp/singleton/CMakeLists.txt b/include/utilspp/singleton/CMakeLists.txt deleted file mode 100644 index ae55f94..0000000 --- a/include/utilspp/singleton/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - - -########### install files ############### - -install(FILES CreationStatic.hpp CreationStatic.inl CreationUsingNew.hpp CreationUsingNew.inl LifetimeDefault.hpp LifetimeDefault.inl LifetimeLibrary.hpp LifetimeLibrary.inl LifetimeWithLongevity.hpp LifetimeWithLongevity.inl PrivateMembers.hpp PrivateMembers.inl SingletonHolder.hpp SingletonHolder.inl DESTINATION /include/utilspp/singleton) - - - -#original Makefile.am contents follow: - -#pkginclude_HEADERS = \ -# CreationStatic.hpp CreationStatic.inl \ -# CreationUsingNew.hpp CreationUsingNew.inl \ -# LifetimeDefault.hpp LifetimeDefault.inl \ -# LifetimeLibrary.hpp LifetimeLibrary.inl \ -# LifetimeWithLongevity.hpp LifetimeWithLongevity.inl \ -# PrivateMembers.hpp PrivateMembers.inl \ -# SingletonHolder.hpp SingletonHolder.inl -# -#pkgincludedir=$(includedir)/utilspp/singleton -# -# diff --git a/include/utilspp/singleton/CreationStatic.hpp b/include/utilspp/singleton/CreationStatic.hpp deleted file mode 100644 index d933765..0000000 --- a/include/utilspp/singleton/CreationStatic.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 CREATION_STATIC_HPP -#define CREATION_STATIC_HPP - -/** - * This class is a creation policy for the utilspp::singleton_holder. The - * policy is creating the singleton by a static memory. The constructor is - * called the first time we call the utilspp::creation_static::create() - * function. - * - * This creation policy is very usefull since it rely on static allocation. - * It means that the creation is automatically thread-safe, since compilers - * static ensures that static allocation is thread-safe. - * - * Note don't use this class with a lifetime policy that allows revivals. - * Be carefull with this policy since it won't respect the lifetime policy. - * It will eventually be destroyed, but at the end of the program. - */ -namespace utilspp -{ - template - class CreationStatic - { - public: - static T* create(); - static void destroy(T* obj); - }; -} - -//#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "CreationStatic.inl" -//#endif - -#endif diff --git a/include/utilspp/singleton/CreationStatic.inl b/include/utilspp/singleton/CreationStatic.inl deleted file mode 100644 index ac14dfb..0000000 --- a/include/utilspp/singleton/CreationStatic.inl +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -#ifndef CREATION_STATIC_INL -#define CREATION_STATIC_INL - - -template -T* -utilspp::CreationStatic::create() -{ - static T mObj; - return &mObj; -} - -template -void -utilspp::CreationStatic::destroy(T*) -{} - - -#endif diff --git a/include/utilspp/singleton/CreationUsingNew.hpp b/include/utilspp/singleton/CreationUsingNew.hpp deleted file mode 100644 index bcacd62..0000000 --- a/include/utilspp/singleton/CreationUsingNew.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 CREATION_USING_NEW_HPP -#define CREATION_USING_NEW_HPP - -/** - * This class is a creation policy for the utilspp::singleton_holder. The - * policy is creating the singleton by a "new" call. - */ -namespace utilspp -{ - template - struct CreationUsingNew - { - static T * create(); - static void destroy(T * obj); - }; -} - -//#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "CreationUsingNew.inl" -//#endif - -#endif diff --git a/include/utilspp/singleton/CreationUsingNew.inl b/include/utilspp/singleton/CreationUsingNew.inl deleted file mode 100644 index 561d713..0000000 --- a/include/utilspp/singleton/CreationUsingNew.inl +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -#ifndef CREATION_USING_NEW_INL -#define CREATION_USING_NEW_INL - -template -T * -utilspp::CreationUsingNew::create() -{ - return new T; -} - -template -void -utilspp::CreationUsingNew::destroy(T * obj) -{ - delete obj; -} - - -#endif diff --git a/include/utilspp/singleton/LifetimeDefault.hpp b/include/utilspp/singleton/LifetimeDefault.hpp deleted file mode 100644 index a715866..0000000 --- a/include/utilspp/singleton/LifetimeDefault.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -#ifndef LIFETIME_DEFAULT_HPP -#define LIFETIME_DEFAULT_HPP - -#include -#include - -namespace utilspp -{ - template< typename T > - class LifetimeDefault - { - public: - static void scheduleDestruction( T *obj, void (*func)() ); - static void onDeadReference(); - }; -} - - -#endif diff --git a/include/utilspp/singleton/LifetimeDefault.inl b/include/utilspp/singleton/LifetimeDefault.inl deleted file mode 100644 index e1f5021..0000000 --- a/include/utilspp/singleton/LifetimeDefault.inl +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -#ifndef LIFETIME_DEFAULT_INL -#define LIFETIME_DEFAULT_INL - -template -void -utilspp::LifetimeDefault::scheduleDestruction(T *, void (* func)()) -{ - std::atexit(func); -} - -template -void -utilspp::LifetimeDefault::onDeadReference() -{ - throw std::logic_error("Dead reference detected"); -} - - -#endif diff --git a/include/utilspp/singleton/LifetimeLibrary.hpp b/include/utilspp/singleton/LifetimeLibrary.hpp deleted file mode 100644 index 33a8778..0000000 --- a/include/utilspp/singleton/LifetimeLibrary.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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 LIFETIME_LIBRARY_HPP -#define LIFETIME_LIBRARY_HPP - -#include - -#include "PrivateMembers.hpp" -#include "CreationUsingNew.hpp" - -namespace utilspp -{ - - template - unsigned int getLongevity(T * p); - - /** - * Assigns an object a longevity. Ensures ordered destructions of objects - * registered thusly during the exit sequence of the application. - */ - template - void setLibraryLongevity( - T * obj, - unsigned int longevity, - TDestroyer d = utilspp::PrivateMembers::Deleter::deleteObject - ); - - /** - * This class is a lifetime policy for the singleton. This - * class allow you to terminate the singleton explicitly. - * You can terminate by calling: - * - * LifetimeLibrarySingleton::instance().terminate() - * - * This singleton use the utilspp::LifetimeWithLongevity policy. - */ - template - struct LifetimeLibrary - { - static void scheduleDestruction(T * obj, void (* func)()); - static void onDeadReference(); - }; - - class LifetimeLibraryImpl - { - public: - LifetimeLibraryImpl(); - ~LifetimeLibraryImpl(); - - void add(utilspp::PrivateMembers::LifetimeTracker * tracker); - void terminate(); - - private: - utilspp::PrivateMembers::TrackerArray mTrackerArray; - int mNbElements; - }; - - unsigned int getLongevity(utilspp::LifetimeLibraryImpl * p); - - typedef utilspp::SingletonHolder< - utilspp::LifetimeLibraryImpl, - utilspp::CreationUsingNew, - utilspp::LifetimeWithLongevity - > LifetimeLibrarySingleton; - - /** - * This class will ensure that - * - * LifetimeLibraryImpl::terminate() - * - * is called. - */ - template - class LifetimeLibraryGuard - { - public: - ~LifetimeLibraryGuard(); - }; -} - -//#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "LifetimeLibrary.inl" -//#endif - -#endif diff --git a/include/utilspp/singleton/LifetimeLibrary.inl b/include/utilspp/singleton/LifetimeLibrary.inl deleted file mode 100644 index 7739755..0000000 --- a/include/utilspp/singleton/LifetimeLibrary.inl +++ /dev/null @@ -1,33 +0,0 @@ -template -void -utilspp::setLibraryLongevity(T * obj, unsigned int longevity, TDestroyer d) -{ - using namespace utilspp::PrivateMembers; - - LifetimeTracker * p = new ConcreteLifetimeTracker( - obj, longevity, d); - - utilspp::LifetimeLibrarySingleton::instance().add(p); -}; - -template -void -utilspp::LifetimeLibrary::scheduleDestruction(T *obj, void (* func)()) -{ - utilspp::PrivateMembers::adapter adapter = { func }; - utilspp::setLibraryLongevity(obj, getLongevity( obj ), adapter); -} - -template -void -utilspp::LifetimeLibrary::onDeadReference() -{ - throw std::logic_error("Dead reference detected"); -} - -template -utilspp::LifetimeLibraryGuard::~LifetimeLibraryGuard() -{ - T::instance().terminate(); -} - diff --git a/include/utilspp/singleton/LifetimeWithLongevity.hpp b/include/utilspp/singleton/LifetimeWithLongevity.hpp deleted file mode 100644 index 53fe6d8..0000000 --- a/include/utilspp/singleton/LifetimeWithLongevity.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 LIFETIME_WITH_LONGEVITY_HPP -#define LIFETIME_WITH_LONGEVITY_HPP - -#include -#include -#include "PrivateMembers.hpp" - -namespace utilspp -{ - - template - unsigned int getLongevity(T * p); - - /** - * Assigns an object a longevity. Ensures ordered destructions of objects - * registered thusly during the exit sequence of the application. - */ - template - void setLongevity(T * obj, - unsigned int longevity, - TDestroyer d = utilspp::PrivateMembers::Deleter::deleteObject); - - template - struct LifetimeWithLongevity - { - static void scheduleDestruction(T * obj, void (* func)()); - static void onDeadReference(); - }; -} - -//#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "LifetimeWithLongevity.inl" -//#endif - -#endif diff --git a/include/utilspp/singleton/LifetimeWithLongevity.inl b/include/utilspp/singleton/LifetimeWithLongevity.inl deleted file mode 100644 index f046890..0000000 --- a/include/utilspp/singleton/LifetimeWithLongevity.inl +++ /dev/null @@ -1,58 +0,0 @@ -#include - -template -void -utilspp::setLongevity(T * obj, unsigned int longevity, TDestroyer d) -{ - using namespace utilspp::PrivateMembers; - - TrackerArray newArray = static_cast( - std::realloc(mTrackerArray, mNbElements + 1)); - if(newArray == NULL) - { - throw std::bad_alloc(); - } - - LifetimeTracker * p = - new ConcreteLifetimeTracker(obj, longevity, d); - - mTrackerArray = newArray; - - TrackerArray pos = std::upper_bound( - mTrackerArray, - mTrackerArray + mNbElements, - p, - &LifetimeTracker::compare); - std::copy_backward( - pos, - mTrackerArray + mNbElements, - mTrackerArray + mNbElements + 1); - - *pos = p; - mNbElements++; - std::atexit(&atExitFunc); -}; - -template -void -utilspp::LifetimeWithLongevity::scheduleDestruction(T * obj, void (* func)()) -{ - utilspp::PrivateMembers::adapter adapter = { func }; - utilspp::setLongevity(obj, getLongevity( obj ), adapter); -} - -template -void -utilspp::LifetimeWithLongevity::onDeadReference() -{ - throw std::logic_error("Dead reference detected"); -} - -template -unsigned int -utilspp::getLongevity(T *) -{ - return 1000; -} - - diff --git a/include/utilspp/singleton/Makefile.am b/include/utilspp/singleton/Makefile.am deleted file mode 100644 index 164dcbe..0000000 --- a/include/utilspp/singleton/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -pkginclude_HEADERS = \ - CreationStatic.hpp CreationStatic.inl \ - CreationUsingNew.hpp CreationUsingNew.inl \ - LifetimeDefault.hpp LifetimeDefault.inl \ - LifetimeLibrary.hpp LifetimeLibrary.inl \ - LifetimeWithLongevity.hpp LifetimeWithLongevity.inl \ - PrivateMembers.hpp PrivateMembers.inl \ - SingletonHolder.hpp SingletonHolder.inl - -pkgincludedir=$(includedir)/utilspp/singleton - - diff --git a/include/utilspp/singleton/PrivateMembers.hpp b/include/utilspp/singleton/PrivateMembers.hpp deleted file mode 100644 index 3e8f2d9..0000000 --- a/include/utilspp/singleton/PrivateMembers.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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 PRIVATE_MEMBERS_HPP -#define PRIVATE_MEMBERS_HPP - -#include - -namespace utilspp -{ - namespace PrivateMembers - { - /** - * Helper class for utils::setLongevity - */ - class LifetimeTracker - { - public: - LifetimeTracker(unsigned int longevity); - virtual ~LifetimeTracker(); - static bool compare( - const LifetimeTracker * l, - const LifetimeTracker * r - ); - - private: - unsigned int mLongevity; - }; - - typedef LifetimeTracker** TrackerArray; - - extern TrackerArray mTrackerArray; - extern int mNbElements; - - /** - * Helper class for Destroyer - */ - template - struct Deleter - { - void deleteObject(T * obj); - }; - - /** - * Concrete lifetime tracker for objects of type T - */ - template - class ConcreteLifetimeTracker : public LifetimeTracker - { - public: - ConcreteLifetimeTracker(T * obj, unsigned int longevity, TDestroyer d); - - ~ConcreteLifetimeTracker(); - - private: - T* mTracked; - TDestroyer mDestroyer; - }; - - void atExitFunc(); - - template - struct adapter - { - void operator()(T*); - void (* mFunc)(); - }; - } -} - -//#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "PrivateMembers.inl" -//#endif - -#endif diff --git a/include/utilspp/singleton/PrivateMembers.inl b/include/utilspp/singleton/PrivateMembers.inl deleted file mode 100644 index 34a1517..0000000 --- a/include/utilspp/singleton/PrivateMembers.inl +++ /dev/null @@ -1,30 +0,0 @@ - -template -void -utilspp::PrivateMembers::Deleter::deleteObject(T * obj) -{ - delete obj; -} - -template -utilspp::PrivateMembers::ConcreteLifetimeTracker::ConcreteLifetimeTracker( - T * obj, unsigned int longevity, TDestroyer d) -: LifetimeTracker(longevity) -, mTracked(obj) -, mDestroyer(d) -{} - -template -utilspp::PrivateMembers::ConcreteLifetimeTracker::~ConcreteLifetimeTracker() -{ - mDestroyer(mTracked); -} - - -template -void -utilspp::PrivateMembers::adapter::operator()(T*) -{ - return (*mFunc)(); -} - diff --git a/include/utilspp/singleton/SingletonHolder.hpp b/include/utilspp/singleton/SingletonHolder.hpp deleted file mode 100644 index ddd2888..0000000 --- a/include/utilspp/singleton/SingletonHolder.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 SINGLETON_HOLDER_HPP -#define SINGLETON_HOLDER_HPP - -#include - -#include "CreationUsingNew.hpp" -#include "LifetimeDefault.hpp" -#include "LifetimeWithLongevity.hpp" -#include "../ThreadingSingle.hpp" - -namespace utilspp -{ - template - class CreationPolicy = utilspp::CreationUsingNew, - template class LifetimePolicy = utilspp::LifetimeDefault, - template class ThreadingModel = utilspp::ThreadingSingle> - class SingletonHolder - { - public: - //the accessor method. - static T & instance(); - static void makeInstance(); - static void terminate(); - - protected: - //protected to be sure that nobody may create one by himself. - SingletonHolder(); - - private: - static void destroySingleton(); - - private: - typedef typename ThreadingModel::VolatileType InstanceType; - static InstanceType mInstance; - static bool mDestroyed; - }; - -} - -//#ifdef CURLPP_INCLUDE_TEMPLATE_DEFINITIONS - #include "SingletonHolder.inl" -//#endif - -#endif diff --git a/include/utilspp/singleton/SingletonHolder.inl b/include/utilspp/singleton/SingletonHolder.inl deleted file mode 100644 index 1ed07a5..0000000 --- a/include/utilspp/singleton/SingletonHolder.inl +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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. - */ - -#ifndef SINGLETON_HOLDER_INL -#define SINGLETON_HOLDER_INL - -template -< -class T, -template class CreationPolicy, -template class LifetimePolicy, -template class ThreadingModel -> -T& -utilspp::SingletonHolder -< -T, -CreationPolicy, -LifetimePolicy, -ThreadingModel -> -::instance() -{ - if (mInstance == NULL) - { - makeInstance(); - } - - return (*mInstance); -}; - -template -< - class T, - template class CreationPolicy, - template class LifetimePolicy, - template class ThreadingModel - > -void -utilspp::SingletonHolder -< - T, - CreationPolicy, - LifetimePolicy, - ThreadingModel - >::makeInstance() -{ - if (mInstance == NULL) - { - typename ThreadingModel::lock guard; - (void)guard; - - if (mInstance == NULL) { - if (mDestroyed) - { - LifetimePolicy::onDeadReference(); - mDestroyed = false; - } - - mInstance = CreationPolicy::create(); - LifetimePolicy::scheduleDestruction(mInstance, & destroySingleton); - } - } -} - -template -< -class T, -template class CreationPolicy, -template class LifetimePolicy, -template class ThreadingModel -> -void -utilspp::SingletonHolder -< -T, -CreationPolicy, -LifetimePolicy, -ThreadingModel -> -::destroySingleton() -{ - assert(!mDestroyed); - CreationPolicy::destroy(mInstance); - mInstance = NULL; - mDestroyed = true; -} - -template class C, -template class L, -template class M -> -typename utilspp::SingletonHolder::InstanceType -utilspp::SingletonHolder::mInstance; - -template -< -class T, -template class C, -template class L, -template class M -> -bool utilspp::SingletonHolder::mDestroyed; - -#endif diff --git a/m4/ax_boost.m4 b/m4/ax_boost.m4 deleted file mode 100644 index 7ce27b6..0000000 --- a/m4/ax_boost.m4 +++ /dev/null @@ -1,523 +0,0 @@ -# =========================================================================== -# http://autoconf-archive.cryp.to/ax_boost.html -# =========================================================================== -# -# OBSOLETE MACRO -# -# Use AX_BOOST_BASE in combination with library-specific macros. -# -# SYNOPSIS -# -# AX_BOOST([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# DESCRIPTION -# -# Test for the Boost C++ libraries of a particular version (or newer) -# -# If no path to the installed boost library is given the macro searchs -# under /usr, /usr/local, and /opt, and evaluates the $BOOST_ROOT -# environment variable. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) -# AC_SUBST(BOOST_FILESYSTEM_LIB) -# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) -# AC_SUBST(BOOST_THREAD_LIB) -# AC_SUBST(BOOST_IOSTREAMS_LIB) -# AC_SUBST(BOOST_SERIALIZATION_LIB) -# AC_SUBST(BOOST_WSERIALIZATION_LIB) -# AC_SUBST(BOOST_SIGNALS_LIB) -# AC_SUBST(BOOST_DATE_TIME_LIB) -# AC_SUBST(BOOST_REGEX_LIB) -# AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) -# -# And sets: -# -# HAVE_BOOST -# HAVE_BOOST_FILESYSTEM -# HAVE_BOOST_PROGRAM_OPTIONS -# HAVE_BOOST_THREAD -# HAVE_BOOST_IOSTREAMS -# HAVE_BOOST_SERIALIZATION -# HAVE_BOOST_SIGNALS -# HAVE_BOOST_DATE_TIME -# HAVE_BOOST_REGEX -# HAVE_BOOST_UNIT_TEST_FRAMEWORK -# -# LAST MODIFICATION -# -# 2008-04-12 -# -# COPYLEFT -# -# Copyright (c) 2008 Thomas Porschberg -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. - -AC_DEFUN([AX_BOOST], -[ - AC_ARG_WITH([boost], - AS_HELP_STRING([--with-boost=DIR], - [use boost (default is yes) specify the root directory for boost library (optional)]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - - AC_CANONICAL_BUILD - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - BOOST_CPPFLAGS="-I$ac_boost_path/include" - else - for ac_boost_path_tmp in /usr /usr/local /opt ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -@%:@include -]], - [[ -#if BOOST_VERSION >= $WANT_BOOST_VERSION -// Everything is okay -#else -# error Boost version is too old -#endif - - ]])], - [ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ifelse([$2], , :, [$2]) - ], - [ - ]) - AC_LANG_POP([C++]) - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - _version=0 - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - fi - else - for ac_boost_path in /usr /usr/local /opt ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - BOOST_LDFLAGS="-L$best_path/lib" - - if test "x$BOOST_ROOT" != "x"; then - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -@%:@include -]], - [[ -#if BOOST_VERSION >= $WANT_BOOST_VERSION -// Everything is okay -#else -# error Boost version is too old -#endif - - ]])], - [ - AC_MSG_RESULT(yes ($_version)) - succeeded=yes - ifelse([$2], , :, [$2]) - ], - [ - AC_MSG_RESULT(no ($_version)) - ifelse([$3], , :, [$3]) - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - if test "$_version" = "0" ; then - AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.]]) - else - AC_MSG_ERROR('Your boost libraries seems to old (version $_version). We need at least $boost_lib_version_shorten') - fi - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - - AC_CACHE_CHECK([whether the Boost::Filesystem library is available], - ax_cv_boost_filesystem, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[using namespace boost::filesystem; - path my_path( "foo/bar/data.txt" ); - return 0;]]), - ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no) - AC_LANG_POP([C++]) - ]) - if test "$ax_cv_boost_filesystem" = "yes"; then - AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::FILESYSTEM library is available]) - BN=boost_filesystem - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break], - [link_filesystem="no"]) - done - if test "x$link_filesystem" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - fi - - AC_CACHE_CHECK([whether the Boost::Program_Options library is available], - ax_cv_boost_program_options, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[boost::program_options::options_description generic("Generic options"); - return 0;]]), - ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no) - AC_LANG_POP([C++]) - ]) - if test "$ax_cv_boost_program_options" = yes; then - AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available]) - BN=boost_program_options - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break], - [link_program_options="no"]) - done - if test "x$link_program_options="no"" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - fi - - AC_CACHE_CHECK(whether the Boost::Thread library is available, - ax_cv_boost_thread, - [AC_LANG_PUSH([C++]) - CXXFLAGS_SAVE=$CXXFLAGS - - if test "x$build_os" = "xsolaris" ; then - CXXFLAGS="-pthreads $CXXFLAGS" - elif test "x$build_os" = "xming32" ; then - CXXFLAGS="-mthreads $CXXFLAGS" - else - CXXFLAGS="-pthread $CXXFLAGS" - fi - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[boost::thread_group thrds; - return 0;]]), - ax_cv_boost_thread=yes, ax_cv_boost_thread=no) - CXXFLAGS=$CXXFLAGS_SAVE - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_thread" = "xyes"; then - if test "x$build_os" = "xsolaris" ; then - BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS" - elif test "x$build_os" = "xming32" ; then - BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS" - else - BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS" - fi - - AC_SUBST(BOOST_CPPFLAGS) - AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::THREAD library is available]) - BN=boost_thread - LDFLAGS_SAVE=$LDFLAGS - case "x$build_os" in - *bsd* ) - LDFLAGS="-pthread $LDFLAGS" - break; - ;; - esac - - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - if test "x$link_thread" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - else - case "x$build_os" in - *bsd* ) - BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS" - break; - ;; - esac - fi - fi - - AC_CACHE_CHECK(whether the Boost::IOStreams library is available, - ax_cv_boost_iostreams, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include - @%:@include - ]], - [[std::string input = "Hello World!"; - namespace io = boost::iostreams; - io::filtering_istream in(boost::make_iterator_range(input)); - return 0; - ]]), - ax_cv_boost_iostreams=yes, ax_cv_boost_iostreams=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_iostreams" = "xyes"; then - AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available]) - BN=boost_iostreams - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - if test "x$link_thread" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - fi - - AC_CACHE_CHECK(whether the Boost::Serialization library is available, - ax_cv_boost_serialization, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include - @%:@include - @%:@include - ]], - [[std::ofstream ofs("filename"); - boost::archive::text_oarchive oa(ofs); - return 0; - ]]), - ax_cv_boost_serialization=yes, ax_cv_boost_serialization=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_serialization" = "xyes"; then - AC_DEFINE(HAVE_BOOST_SERIALIZATION,,[define if the Boost::Serialization library is available]) - BN=boost_serialization - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_SERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_SERIALIZATION_LIB) link_serialization="yes"; break], - [link_serialization="no"]) - done - if test "x$link_serialization" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - - BN=boost_wserialization - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, - [BOOST_WSERIALIZATION_LIB="-l$ax_lib"; AC_SUBST(BOOST_WSERIALIZATION_LIB) link_wserialization="yes"; break], - [link_wserialization="no"]) - done - if test "x$link_wserialization" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - fi - - AC_CACHE_CHECK(whether the Boost::Signals library is available, - ax_cv_boost_signals, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include - ]], - [[boost::signal sig; - return 0; - ]]), - ax_cv_boost_signals=yes, ax_cv_boost_signals=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_signals" = "xyes"; then - AC_DEFINE(HAVE_BOOST_SIGNALS,,[define if the Boost::Signals library is available]) - BN=boost_signals - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, [BOOST_SIGNALS_LIB="-l$ax_lib"; AC_SUBST(BOOST_SIGNALS_LIB) link_signals="yes"; break], - [link_signals="no"]) - done - if test "x$link_signals" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - fi - - AC_CACHE_CHECK(whether the Boost::Date_Time library is available, - ax_cv_boost_date_time, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include - ]], - [[using namespace boost::gregorian; date d(2002,Jan,10); - return 0; - ]]), - ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_date_time" = "xyes"; then - AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available]) - BN=boost_date_time - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_thread="yes"; break], - [link_thread="no"]) - done - if test "x$link_thread"="no" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - fi - - AC_CACHE_CHECK(whether the Boost::Regex library is available, - ax_cv_boost_regex, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include - ]], - [[boost::regex r(); return 0;]]), - ax_cv_boost_regex=yes, ax_cv_boost_regex=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_regex" = "xyes"; then - AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available]) - BN=boost_regex - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, exit, [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], - [link_regex="no"]) - done - if test "x$link_regex" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - fi - - AC_CACHE_CHECK(whether the Boost::UnitTestFramework library is available, - ax_cv_boost_unit_test_framework, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[using boost::unit_test::test_suite; - test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); return 0;]]), - ax_cv_boost_unit_test_framework=yes, ax_cv_boost_unit_test_framework=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_unit_test_framework" = "xyes"; then - AC_DEFINE(HAVE_BOOST_UNIT_TEST_FRAMEWORK,,[define if the Boost::Unit_test_framework library is available]) - BN=boost_unit_test_framework - saved_ldflags="${LDFLAGS}" - for ax_lib in $BN $BN-$CC $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-$CC lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - LDFLAGS="${LDFLAGS} -l$ax_lib" - AC_CACHE_CHECK(the name of the Boost::UnitTestFramework library, - ax_cv_boost_unit_test_framework_link, - [AC_LANG_PUSH([C++]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include - using boost::unit_test::test_suite; - test_suite* init_unit_test_suite( int argc, char * argv[] ) { - test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); - return test; - } - ]], - [[ return 0;]])], - link_unit_test_framework="yes",link_unit_test_framework="no") - AC_LANG_POP([C++]) - ]) - LDFLAGS="${saved_ldflags}" - if test "x$link_unit_test_framework" = "xyes"; then - BOOST_UNIT_TEST_FRAMEWORK_LIB="-l$ax_lib" - AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) - break - fi - done - if test "x$link_unit_test_framework" = "xno"; then - AC_MSG_NOTICE(Could not link against $ax_lib !) - fi - fi - fi - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) diff --git a/m4/ax_boost_base.m4 b/m4/ax_boost_base.m4 deleted file mode 100644 index ab46745..0000000 --- a/m4/ax_boost_base.m4 +++ /dev/null @@ -1,285 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# DESCRIPTION -# -# Test for the Boost C++ libraries of a particular version (or newer) -# -# If no path to the installed boost library is given the macro searchs -# under /usr, /usr/local, /opt and /opt/local and evaluates the -# $BOOST_ROOT environment variable. Further documentation is available at -# . -# -# This macro calls: -# -# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) -# -# And sets: -# -# HAVE_BOOST -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2009 Peter Adolphs -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 27 - -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - [AS_HELP_STRING([--with-boost@<:@=ARG@:>@], - [use Boost library from a standard location (ARG=yes), - from the specified location (ARG=), - or disable it (ARG=no) - @<:@ARG=yes@:>@ ])], - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - - -AC_ARG_WITH([boost-libdir], - AS_HELP_STRING([--with-boost-libdir=LIB_DIR], - [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]), - [ - if test -d "$withval" - then - ac_boost_lib_path="$withval" - else - AC_MSG_ERROR(--with-boost-libdir expected directory name) - fi - ], - [ac_boost_lib_path=""] -) - -if test "x$want_boost" = "xyes"; then - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl On 64-bit systems check for system libraries in both lib64 and lib. - dnl The former is specified by FHS, but e.g. Debian does not adhere to - dnl this (as it rises problems for generic multi-arch support). - dnl The last entry in the list is chosen by default when no libraries - dnl are found, e.g. when only header-only libraries are installed! - libsubdirs="lib" - ax_arch=`uname -m` - case $ax_arch in - x86_64) - libsubdirs="lib64 libx32 lib lib64" - ;; - ppc64|s390x|sparc64|aarch64|ppc64le) - libsubdirs="lib64 lib lib64" - ;; - esac - - dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give - dnl them priority over the other paths since, if libs are found there, they - dnl are almost assuredly the ones desired. - AC_REQUIRE([AC_CANONICAL_HOST]) - libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs" - - case ${host_cpu} in - i?86) - libsubdirs="lib/i386-${host_os} $libsubdirs" - ;; - esac - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_CPPFLAGS="-I$ac_boost_path/include" - for ac_boost_path_tmp in $libsubdirs; do - if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then - BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp" - break - fi - done - elif test "$cross_compiling" != yes; then - for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - for libsubdir in $libsubdirs ; do - if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - dnl overwrite ld flags if we have required special directory with - dnl --with-boost-libdir parameter - if test "$ac_boost_lib_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_lib_path" - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - BOOST_CPPFLAGS= - BOOST_LDFLAGS= - _version=0 - if test "$ac_boost_path" != ""; then - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - dnl if nothing found search for layout used in Windows distributions - if test -z "$BOOST_CPPFLAGS"; then - if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then - BOOST_CPPFLAGS="-I$ac_boost_path" - fi - fi - fi - else - if test "$cross_compiling" != yes; then - for ac_boost_path in /usr /usr/local /opt /opt/local ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - if test "$ac_boost_lib_path" = ""; then - for libsubdir in $libsubdirs ; do - if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_LDFLAGS="-L$best_path/$libsubdir" - fi - fi - - if test "x$BOOST_ROOT" != "x"; then - for libsubdir in $libsubdirs ; do - if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - if test "$_version" = "0" ; then - AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.]]) - else - AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) - fi - # execute ACTION-IF-NOT-FOUND (if present): - ifelse([$3], , :, [$3]) - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - # execute ACTION-IF-FOUND (if present): - ifelse([$2], , :, [$2]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" -fi - -]) diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4 deleted file mode 100644 index 2c18e49..0000000 --- a/m4/ax_cxx_compile_stdcxx.m4 +++ /dev/null @@ -1,562 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) -# or '14' (for the C++14 standard). -# -# The second argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. -# -# The third argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline support for the specified C++ standard is -# required and that the macro should error out if no mode with that -# support is found. If specified 'optional', then configuration proceeds -# regardless, after defining HAVE_CXX${VERSION} if and only if a -# supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# Copyright (c) 2015 Paul Norman -# Copyright (c) 2015 Moritz Klammler -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 4 - -dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro -dnl (serial version number 13). - -AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl - m4_if([$1], [11], [], - [$1], [14], [], - [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])], - [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$2], [], [], - [$2], [ext], [], - [$2], [noext], [], - [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], - [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], - [$3], [optional], [ax_cxx_compile_cxx$1_required=false], - [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) - AC_LANG_PUSH([C++])dnl - ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi - - m4_if([$2], [noext], [], [dnl - if test x$ac_success = xno; then - for switch in -std=gnu++$1 -std=gnu++0x; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi]) - - m4_if([$2], [ext], [], [dnl - if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - dnl Cray's crayCC needs "-h std=c++11" - for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi]) - AC_LANG_POP([C++]) - if test x$ax_cxx_compile_cxx$1_required = xtrue; then - if test x$ac_success = xno; then - AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) - fi - fi - if test x$ac_success = xno; then - HAVE_CXX$1=0 - AC_MSG_NOTICE([No compiler with C++$1 support was found]) - else - HAVE_CXX$1=1 - AC_DEFINE(HAVE_CXX$1,1, - [define if the compiler supports basic C++$1 syntax]) - fi - AC_SUBST(HAVE_CXX$1) -]) - - -dnl Test body for checking C++11 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 -) - - -dnl Test body for checking C++14 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 -) - - -dnl Tests for new features in C++11 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual void f() {} - }; - - struct Derived : public Base - { - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - -]]) - - -dnl Tests for new features in C++14 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201402L - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_seperators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - -]]) diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4 deleted file mode 100644 index 0aadeaf..0000000 --- a/m4/ax_cxx_compile_stdcxx_11.m4 +++ /dev/null @@ -1,39 +0,0 @@ -# ============================================================================ -# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html -# ============================================================================ -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the C++11 -# standard; if necessary, add switches to CXX and CXXCPP to enable -# support. -# -# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX -# macro with the version set to C++11. The two optional arguments are -# forwarded literally as the second and third argument respectively. -# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for -# more information. If you want to use this macro, you also need to -# download the ax_cxx_compile_stdcxx.m4 file. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# Copyright (c) 2015 Paul Norman -# Copyright (c) 2015 Moritz Klammler -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 17 - -AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) -AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) diff --git a/m4/boost.m4 b/m4/boost.m4 deleted file mode 100644 index a0894f3..0000000 --- a/m4/boost.m4 +++ /dev/null @@ -1,1574 +0,0 @@ -# boost.m4: Locate Boost headers and libraries for autoconf-based projects. -# Copyright (C) 2007-2011, 2014 Benoit Sigoure -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Additional permission under section 7 of the GNU General Public -# License, version 3 ("GPLv3"): -# -# If you convey this file as part of a work that contains a -# configuration script generated by Autoconf, you may do so under -# terms of your choice. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -m4_define([_BOOST_SERIAL], [m4_translit([ -# serial 26 -], [# -], [])]) - -# Original sources can be found at http://github.com/tsuna/boost.m4 -# You can fetch the latest version of the script by doing: -# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4 - -# ------ # -# README # -# ------ # - -# This file provides several macros to use the various Boost libraries. -# The first macro is BOOST_REQUIRE. It will simply check if it's possible to -# find the Boost headers of a given (optional) minimum version and it will -# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to -# your configure so that users can specify non standard locations. -# If the user's environment contains BOOST_ROOT and --with-boost was not -# specified, --with-boost=$BOOST_ROOT is implicitly used. -# For more README and documentation, go to http://github.com/tsuna/boost.m4 -# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry, -# simply read the README, it will show you what to do step by step. - -m4_pattern_forbid([^_?(BOOST|Boost)_]) - - -# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM, -# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -------------------------------------------------------- -# Same as AC_EGREP_CPP, but leave the result in conftest.i. -# -# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded -# in double-quotes, so escape your double quotes. -# -# It could be useful to turn this into a macro which extracts the -# value of any macro. -m4_define([_BOOST_SED_CPP], -[AC_LANG_PUSH([C++])dnl -AC_LANG_PREPROC_REQUIRE()dnl -AC_REQUIRE([AC_PROG_SED])dnl -AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) -AS_IF([dnl eval is necessary to expand ac_cpp. -dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. -dnl Beware of Windows end-of-lines, for instance if we are running -dnl some Windows programs under Wine. In that case, boost/version.hpp -dnl is certainly using "\r\n", but the regular Unix shell will only -dnl strip `\n' with backquotes, not the `\r'. This results in -dnl boost_cv_lib_version='1_37\r' for instance, which breaks -dnl everything else. -dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK -dnl -dnl Beware that GCC 5, when expanding macros, may embed # line directives -dnl a within single line: -dnl -dnl # 1 "conftest.cc" -dnl # 1 "" -dnl # 1 "" -dnl # 1 "conftest.cc" -dnl # 1 "/opt/local/include/boost/version.hpp" 1 3 -dnl # 2 "conftest.cc" 2 -dnl boost-lib-version = -dnl # 2 "conftest.cc" 3 -dnl "1_56" -dnl -dnl So get rid of the # and empty lines, and glue the remaining ones together. -(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | - grep -v '#' | - grep -v '^[[[:space:]]]*$' | - tr -d '\r' | - tr -s '\n' ' ' | - $SED -n -e "$1" >conftest.i 2>&1], - [$3], - [$4]) -rm -rf conftest* -AC_LANG_POP([C++])dnl -])# _BOOST_SED_CPP - - - -# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND]) -# ----------------------------------------------- -# Look for Boost. If version is given, it must either be a literal of the form -# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a -# variable "$var". -# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with -# the required version, it does not check for any of the Boost libraries. -# On # success, defines HAVE_BOOST. On failure, calls the optional -# ACTION-IF-NOT-FOUND action if one was supplied. -# Otherwise aborts with an error message. -AC_DEFUN_ONCE([BOOST_REQUIRE], -[AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_PROG_GREP])dnl -echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD -boost_save_IFS=$IFS -boost_version_req=$1 -IFS=. -set x $boost_version_req 0 0 0 -IFS=$boost_save_IFS -shift -boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"` -boost_version_req_string=$[1].$[2].$[3] -AC_ARG_WITH([boost], - [AS_HELP_STRING([--with-boost=DIR], - [prefix of Boost $1 @<:@guess@:>@])])dnl -AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl -# If BOOST_ROOT is set and the user has not provided a value to -# --with-boost, then treat BOOST_ROOT as if it the user supplied it. -if test x"$BOOST_ROOT" != x; then - if test x"$with_boost" = x; then - AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT]) - with_boost=$BOOST_ROOT - else - AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost]) - fi -fi -AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], - ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl -boost_save_CPPFLAGS=$CPPFLAGS - AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string], - [boost_cv_inc_path], - [boost_cv_inc_path=no -AC_LANG_PUSH([C++])dnl -m4_pattern_allow([^BOOST_VERSION$])dnl - AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include -#if !defined BOOST_VERSION -# error BOOST_VERSION is not defined -#elif BOOST_VERSION < $boost_version_req -# error Boost headers version < $boost_version_req -#endif -]])]) - # If the user provided a value to --with-boost, use it and only it. - case $with_boost in #( - ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \ - /usr/include C:/Boost/include;; #( - *) set x "$with_boost/include" "$with_boost";; - esac - shift - for boost_dir - do - # Without --layout=system, Boost (or at least some versions) installs - # itself in /include/boost-. This inner loop helps to - # find headers in such directories. - # - # Any ${boost_dir}/boost-x_xx directories are searched in reverse version - # order followed by ${boost_dir}. The final '.' is a sentinel for - # searching $boost_dir" itself. Entries are whitespace separated. - # - # I didn't indent this loop on purpose (to avoid over-indented code) - boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \ - && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \ - && echo .` - for boost_inc in $boost_layout_system_search_list - do - if test x"$boost_inc" != x.; then - boost_inc="$boost_dir/$boost_inc" - else - boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list - fi - if test x"$boost_inc" != x; then - # We are going to check whether the version of Boost installed - # in $boost_inc is usable by running a compilation that - # #includes it. But if we pass a -I/some/path in which Boost - # is not installed, the compiler will just skip this -I and - # use other locations (either from CPPFLAGS, or from its list - # of system include directories). As a result we would use - # header installed on the machine instead of the /some/path - # specified by the user. So in that precise case (trying - # $boost_inc), make sure the version.hpp exists. - # - # Use test -e as there can be symlinks. - test -e "$boost_inc/boost/version.hpp" || continue - CPPFLAGS="$CPPFLAGS -I$boost_inc" - fi - AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no]) - if test x"$boost_cv_inc_path" = xyes; then - if test x"$boost_inc" != x; then - boost_cv_inc_path=$boost_inc - fi - break 2 - fi - done - done -AC_LANG_POP([C++])dnl - ]) - case $boost_cv_inc_path in #( - no) - boost_errmsg="cannot find Boost headers version >= $boost_version_req_string" - m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])], - [AC_MSG_NOTICE([$boost_errmsg])]) - $2 - ;;#( - yes) - BOOST_CPPFLAGS= - ;;#( - *) - AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl - ;; - esac - if test x"$boost_cv_inc_path" != xno; then - AC_DEFINE([HAVE_BOOST], [1], - [Defined if the requested minimum BOOST version is satisfied]) - AC_CACHE_CHECK([for Boost's header version], - [boost_cv_lib_version], - [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl - _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]], - [#include -boost-lib-version = BOOST_LIB_VERSION], - [boost_cv_lib_version=`cat conftest.i`])]) - # e.g. "134" for 1_34_1 or "135" for 1_35 - boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'` - case $boost_major_version in #( - '' | *[[!0-9]]*) - AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version']) - ;; - esac -fi -CPPFLAGS=$boost_save_CPPFLAGS -])# BOOST_REQUIRE - - -# BOOST_STATIC() -# -------------- -# Add the "--enable-static-boost" configure argument. If this argument is given -# on the command line, static versions of the libraries will be looked up. -AC_DEFUN([BOOST_STATIC], - [AC_ARG_ENABLE([static-boost], - [AS_HELP_STRING([--enable-static-boost], - [Prefer the static boost libraries over the shared ones [no]])], - [enable_static_boost=yes], - [enable_static_boost=no])])# BOOST_STATIC - - -# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND]) -# -------------------------------------------------------------------------- -# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for -# some parts of the Boost library which are only made of headers and don't -# require linking (such as Boost.Foreach). -# -# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be -# found in the first place, in which case by default a notice is issued to the -# user. Presumably if we haven't died already it's because it's OK to not have -# Boost, which is why only a notice is issued instead of a hard error. -# -# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_ in -# case of success # (where HEADER-NAME is written LIKE_THIS, e.g., -# HAVE_BOOST_FOREACH_HPP). -AC_DEFUN([BOOST_FIND_HEADER], -[AC_REQUIRE([BOOST_REQUIRE])dnl -if test x"$boost_cv_inc_path" = xno; then - m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])]) -else -AC_LANG_PUSH([C++])dnl -boost_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_CHECK_HEADER([$1], - [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1], - [Define to 1 if you have <$1>])])], - [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])]) -CPPFLAGS=$boost_save_CPPFLAGS -AC_LANG_POP([C++])dnl -fi -])# BOOST_FIND_HEADER - - -# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES], -# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], -# [CXX-PROLOGUE]) -# -------------------------------------------------------------- -# Look for the Boost library COMPONENT-NAME (e.g., `thread', for -# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g., -# "thread_win32 thread"). Check that HEADER-NAME works and check that -# libboost_LIB-NAME can link with the code CXX-TEST. The optional -# argument CXX-PROLOGUE can be used to include some C++ code before -# the `main' function. -# -# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above). -# -# Boost libraries typically come compiled with several flavors (with different -# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one -# or more of the following letters: sgdpn (in that order). s = static -# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build, -# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n' -# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can -# start with `mt-' to indicate that there is a preference for multi-thread -# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp -# ... If you want to make sure you have a specific version of Boost -# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro. -AC_DEFUN([BOOST_FIND_LIBS], -[AC_REQUIRE([BOOST_REQUIRE])dnl -AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl -AC_REQUIRE([BOOST_STATIC])dnl -AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl -if test x"$boost_cv_inc_path" = xno; then - AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library]) -else -dnl The else branch is huge and wasn't intended on purpose. -AC_LANG_PUSH([C++])dnl -AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl -AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl -AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl -AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl -BOOST_FIND_HEADER([$4]) -boost_save_CPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib], - [_BOOST_FIND_LIBS($@)]) -case $Boost_lib in #( - (no) _AC_MSG_LOG_CONFTEST - AC_MSG_ERROR([cannot find the flags to link with Boost $1]) - ;; -esac -AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl -AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl -AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl -AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl -CPPFLAGS=$boost_save_CPPFLAGS -AS_VAR_POPDEF([Boost_lib])dnl -AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl -AS_VAR_POPDEF([Boost_lib_LDPATH])dnl -AS_VAR_POPDEF([Boost_lib_LIBS])dnl -AC_LANG_POP([C++])dnl -fi -]) - - -# BOOST_FIND_LIB([LIB-NAME], -# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], -# [CXX-PROLOGUE]) -# -------------------------------------------------------------- -# Backward compatibility wrapper for BOOST_FIND_LIBS. -AC_DEFUN([BOOST_FIND_LIB], -[BOOST_FIND_LIBS([$1], $@)]) - - -# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES], -# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST], -# [CXX-PROLOGUE]) -# -------------------------------------------------------------- -# Real implementation of BOOST_FIND_LIBS: rely on these local macros: -# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS -# -# The algorithm is as follows: first look for a given library name -# according to the user's PREFERRED-RT-OPT. For each library name, we -# prefer to use the ones that carry the tag (toolset name). Each -# library is searched through the various standard paths were Boost is -# usually installed. If we can't find the standard variants, we try -# to enforce -mt (for instance on MacOSX, libboost_thread.dylib -# doesn't exist but there's -obviously- libboost_thread-mt.dylib). -AC_DEFUN([_BOOST_FIND_LIBS], -[Boost_lib=no - case "$3" in #( - (mt | mt-) boost_mt=-mt; boost_rtopt=;; #( - (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #( - (*) boost_mt=; boost_rtopt=$3;; - esac - if test $enable_static_boost = yes; then - boost_rtopt="s$boost_rtopt" - fi - # Find the proper debug variant depending on what we've been asked to find. - case $boost_rtopt in #( - (*d*) boost_rt_d=$boost_rtopt;; #( - (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn') - boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #( - (*) boost_rt_d='-d';; - esac - # If the PREFERRED-RT-OPT are not empty, prepend a `-'. - test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt" - $boost_guess_use_mt && boost_mt=-mt - # Look for the abs path the static archive. - # $libext is computed by Libtool but let's make sure it's non empty. - test -z "$libext" && - AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?]) - boost_save_ac_objext=$ac_objext - # Generate the test file. - AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <$4> -$6], [$5])]) -dnl Optimization hacks: compiling C++ is slow, especially with Boost. What -dnl we're trying to do here is guess the right combination of link flags -dnl (LIBS / LDFLAGS) to use a given library. This can take several -dnl iterations before it succeeds and is thus *very* slow. So what we do -dnl instead is that we compile the code first (and thus get an object file, -dnl typically conftest.o). Then we try various combinations of link flags -dnl until we succeed to link conftest.o in an executable. The problem is -dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always -dnl remove all the temporary files including conftest.o. So the trick here -dnl is to temporarily change the value of ac_objext so that conftest.o is -dnl preserved accross tests. This is obviously fragile and I will burn in -dnl hell for not respecting Autoconf's documented interfaces, but in the -dnl mean time, it optimizes the macro by a factor of 5 to 30. -dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left -dnl empty because the test file is generated only once above (before we -dnl start the for loops). - AC_COMPILE_IFELSE([], - [ac_objext=do_not_rm_me_plz], - [AC_MSG_ERROR([cannot compile a test that uses Boost $1])]) - ac_objext=$boost_save_ac_objext - boost_failed_libs= -# Don't bother to ident the following nested for loops, only the 2 -# innermost ones matter. -for boost_lib_ in $2; do -for boost_tag_ in -$boost_cv_lib_tag ''; do -for boost_ver_ in -$boost_cv_lib_version ''; do -for boost_mt_ in $boost_mt -mt ''; do -for boost_rtopt_ in $boost_rtopt '' -d; do - for boost_lib in \ - boost_$boost_lib_$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \ - boost_$boost_lib_$boost_tag_$boost_rtopt_$boost_ver_ \ - boost_$boost_lib_$boost_tag_$boost_mt_$boost_ver_ \ - boost_$boost_lib_$boost_tag_$boost_ver_ - do - # Avoid testing twice the same lib - case $boost_failed_libs in #( - (*@$boost_lib@*) continue;; - esac - # If with_boost is empty, we'll search in /lib first, which is not quite - # right so instead we'll try to a location based on where the headers are. - boost_tmp_lib=$with_boost - test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include} - for boost_ldpath in "$boost_tmp_lib/lib" '' \ - /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \ - "$with_boost" C:/Boost/lib /lib* - do - # Don't waste time with directories that don't exist. - if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then - continue - fi - boost_save_LDFLAGS=$LDFLAGS - # Are we looking for a static library? - case $boost_ldpath:$boost_rtopt_ in #( - (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt) - Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext" - test -e "$Boost_lib_LIBS" || continue;; #( - (*) # No: use -lboost_foo to find the shared library. - Boost_lib_LIBS="-l$boost_lib";; - esac - boost_save_LIBS=$LIBS - LIBS="$Boost_lib_LIBS $LIBS" - test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath" -dnl First argument of AC_LINK_IFELSE left empty because the test file is -dnl generated only once above (before we start the for loops). - _BOOST_AC_LINK_IFELSE([], - [Boost_lib=yes], [Boost_lib=no]) - ac_objext=$boost_save_ac_objext - LDFLAGS=$boost_save_LDFLAGS - LIBS=$boost_save_LIBS - if test x"$Boost_lib" = xyes; then - # Check or used cached result of whether or not using -R or - # -rpath makes sense. Some implementations of ld, such as for - # Mac OSX, require -rpath but -R is the flag known to work on - # other systems. https://github.com/tsuna/boost.m4/issues/19 - AC_CACHE_VAL([boost_cv_rpath_link_ldflag], - [case $boost_ldpath in - '') # Nothing to do. - boost_cv_rpath_link_ldflag= - boost_rpath_link_ldflag_found=yes;; - *) - for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do - LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" - LIBS="$boost_save_LIBS $Boost_lib_LIBS" - _BOOST_AC_LINK_IFELSE([], - [boost_rpath_link_ldflag_found=yes - break], - [boost_rpath_link_ldflag_found=no]) - done - ;; - esac - AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"], - [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])]) - LDFLAGS=$boost_save_LDFLAGS - LIBS=$boost_save_LIBS - ]) - test x"$boost_ldpath" != x && - Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath" - Boost_lib_LDPATH="$boost_ldpath" - break 7 - else - boost_failed_libs="$boost_failed_libs@$boost_lib@" - fi - done - done -done -done -done -done -done # boost_lib_ -rm -f conftest.$ac_objext -]) - - - -# --------------------------------------- # -# Checks for the various Boost libraries. # -# --------------------------------------- # - -# List of boost libraries: http://www.boost.org/libs/libraries.htm -# The page http://beta.boost.org/doc/libs is useful: it gives the first release -# version of each library (among other things). - -# BOOST_DEFUN(LIBRARY, CODE) -# -------------------------- -# Define BOOST_ as a macro that runs CODE. -# -# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN. -m4_define([BOOST_DEFUN], -[m4_indir([AC_DEFUN], - m4_toupper([BOOST_$1]), -[m4_pushdef([BOOST_Library], [$1])dnl -$2 -m4_popdef([BOOST_Library])dnl -]) -]) - -# BOOST_ARRAY() -# ------------- -# Look for Boost.Array -BOOST_DEFUN([Array], -[BOOST_FIND_HEADER([boost/array.hpp])]) - - -# BOOST_ASIO() -# ------------ -# Look for Boost.Asio (new in Boost 1.35). -BOOST_DEFUN([Asio], -[AC_REQUIRE([BOOST_SYSTEM])dnl -BOOST_FIND_HEADER([boost/asio.hpp])]) - - -# BOOST_ASSIGN() -# ------------- -# Look for Boost.Assign -BOOST_DEFUN([Assign], -[BOOST_FIND_HEADER([boost/assign.hpp])]) - - -# BOOST_BIND() -# ------------ -# Look for Boost.Bind. -BOOST_DEFUN([Bind], -[BOOST_FIND_HEADER([boost/bind.hpp])]) - - -# BOOST_CHRONO() -# -------------- -# Look for Boost.Chrono. -BOOST_DEFUN([Chrono], -[# Do we have to check for Boost.System? This link-time dependency was -# added as of 1.35.0. If we have a version <1.35, we must not attempt to -# find Boost.System as it didn't exist by then. -if test $boost_major_version -ge 135; then - BOOST_SYSTEM([$1]) -fi # end of the Boost.System check. -boost_filesystem_save_LIBS=$LIBS -boost_filesystem_save_LDFLAGS=$LDFLAGS -m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_SYSTEM_LIBS" -LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" -BOOST_FIND_LIB([chrono], [$1], - [boost/chrono.hpp], - [boost::chrono::thread_clock d;]) -if test $enable_static_boost = yes && test $boost_major_version -ge 135; then - BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS" -fi -LIBS=$boost_filesystem_save_LIBS -LDFLAGS=$boost_filesystem_save_LDFLAGS -])# BOOST_CHRONO - - -# BOOST_CONTEXT([PREFERRED-RT-OPT]) -# ----------------------------------- -# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -# -# * This library was introduced in Boost 1.51.0 -# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0 -# * A dependency on boost_thread appears in 1.57.0 -BOOST_DEFUN([Context], -[boost_context_save_LIBS=$LIBS - boost_context_save_LDFLAGS=$LDFLAGS -if test $boost_major_version -ge 157; then - BOOST_THREAD([$1]) - m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl - LIBS="$LIBS $BOOST_THREAD_LIBS" - LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS" -fi -BOOST_FIND_LIB([context], [$1], - [boost/context/all.hpp],[[ - -// creates a stack -void * stack_pointer = new void*[4096]; -std::size_t const size = sizeof(void*[4096]); - -#if BOOST_VERSION <= 105100 -ctx::make_fcontext(&fc, f); -return ctx::jump_fcontext(&fcm, &fc, 3) == 6; - -#else - -fc = ctx::make_fcontext(stack_pointer, size, f); -return ctx::jump_fcontext(&fcm, fc, 3) == 6; - -#endif - - -]],[dnl - -#include -#if BOOST_VERSION <= 105100 - -namespace ctx = boost::ctx; - -static ctx::fcontext_t fcm, fc; - -static void f(intptr_t i) { - ctx::jump_fcontext(&fc, &fcm, i * 2); -} - -#elif BOOST_VERSION <= 105500 - -namespace ctx = boost::context; - -// context -static ctx::fcontext_t fcm, *fc; - -// context-function -static void f(intptr_t i) { - ctx::jump_fcontext(fc, &fcm, i * 2); -} - -#else - -namespace ctx = boost::context; - -// context -static ctx::fcontext_t fcm, fc; - -// context-function -static void f(intptr_t i) { - ctx::jump_fcontext(&fc, fcm, i * 2); -} -#endif -]) -LIBS=$boost_context_save_LIBS -LDFLAGS=$boost_context_save_LDFLAGS -])# BOOST_CONTEXT - - -# BOOST_CONVERSION() -# ------------------ -# Look for Boost.Conversion (cast / lexical_cast) -BOOST_DEFUN([Conversion], -[BOOST_FIND_HEADER([boost/cast.hpp]) -BOOST_FIND_HEADER([boost/lexical_cast.hpp]) -])# BOOST_CONVERSION - - -# BOOST_COROUTINE([PREFERRED-RT-OPT]) -# ----------------------------------- -# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. This library was introduced in Boost -# 1.53.0 -BOOST_DEFUN([Coroutine], -[ -boost_coroutine_save_LIBS=$LIBS -boost_coroutine_save_LDFLAGS=$LDFLAGS -# Link-time dependency from coroutine to context -BOOST_CONTEXT([$1]) -# Starting from Boost 1.55 a dependency on Boost.System is added -if test $boost_major_version -ge 155; then - BOOST_SYSTEM([$1]) -fi -m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)]) -LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS" -LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS" - -# in 1.53 coroutine was a header only library -if test $boost_major_version -eq 153; then - BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp]) -else - BOOST_FIND_LIB([coroutine], [$1], - [boost/coroutine/coroutine.hpp], - [ - #include - #if BOOST_VERSION <= 105500 - boost::coroutines::coroutine coro; coro.get(); - #else - boost::coroutines::asymmetric_coroutine::pull_type coro; coro.get(); - #endif - ]) -fi -# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54 -# coroutine doesn't use context from its headers but from its library. -if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then - BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS" - BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS" -fi -if test $enable_static_boost = yes && test $boost_major_version -ge 155; then - BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS" - BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS" -fi -LIBS=$boost_coroutine_save_LIBS -LDFLAGS=$boost_coroutine_save_LDFLAGS -])# BOOST_COROUTINE - - -# BOOST_CRC() -# ----------- -# Look for Boost.CRC -BOOST_DEFUN([CRC], -[BOOST_FIND_HEADER([boost/crc.hpp]) -])# BOOST_CRC - - -# BOOST_DATE_TIME([PREFERRED-RT-OPT]) -# ----------------------------------- -# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Date_Time], -[BOOST_FIND_LIB([date_time], [$1], - [boost/date_time/posix_time/posix_time.hpp], - [boost::posix_time::ptime t;]) -])# BOOST_DATE_TIME - - -# BOOST_FILESYSTEM([PREFERRED-RT-OPT]) -# ------------------------------------ -# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see -# the documentation of BOOST_FIND_LIB above. -# Do not check for boost/filesystem.hpp because this file was introduced in -# 1.34. -BOOST_DEFUN([Filesystem], -[# Do we have to check for Boost.System? This link-time dependency was -# added as of 1.35.0. If we have a version <1.35, we must not attempt to -# find Boost.System as it didn't exist by then. -if test $boost_major_version -ge 135; then - BOOST_SYSTEM([$1]) -fi # end of the Boost.System check. -boost_filesystem_save_LIBS=$LIBS -boost_filesystem_save_LDFLAGS=$LDFLAGS -m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_SYSTEM_LIBS" -LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" -BOOST_FIND_LIB([filesystem], [$1], - [boost/filesystem/path.hpp], [boost::filesystem::path p;]) -if test $enable_static_boost = yes && test $boost_major_version -ge 135; then - BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" -fi -LIBS=$boost_filesystem_save_LIBS -LDFLAGS=$boost_filesystem_save_LDFLAGS -])# BOOST_FILESYSTEM - - -# BOOST_FLYWEIGHT() -# ----------------- -# Look for Boost.Flyweight. -BOOST_DEFUN([Flyweight], -[dnl There's a hidden dependency on pthreads. -AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl -BOOST_FIND_HEADER([boost/flyweight.hpp]) -AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag]) -]) - - -# BOOST_FOREACH() -# --------------- -# Look for Boost.Foreach. -BOOST_DEFUN([Foreach], -[BOOST_FIND_HEADER([boost/foreach.hpp])]) - - -# BOOST_FORMAT() -# -------------- -# Look for Boost.Format. -# Note: we can't check for boost/format/format_fwd.hpp because the header isn't -# standalone. It can't be compiled because it triggers the following error: -# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std' -# does not name a type -BOOST_DEFUN([Format], -[BOOST_FIND_HEADER([boost/format.hpp])]) - - -# BOOST_FUNCTION() -# ---------------- -# Look for Boost.Function -BOOST_DEFUN([Function], -[BOOST_FIND_HEADER([boost/function.hpp])]) - - -# BOOST_GEOMETRY() -# ---------------- -# Look for Boost.Geometry (new since 1.47.0). -BOOST_DEFUN([Geometry], -[BOOST_FIND_HEADER([boost/geometry.hpp]) -])# BOOST_GEOMETRY - - -# BOOST_GRAPH([PREFERRED-RT-OPT]) -# ------------------------------- -# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Graph], -[boost_graph_save_LIBS=$LIBS -boost_graph_save_LDFLAGS=$LDFLAGS -# Link-time dependency from graph to regex was added as of 1.40.0. -if test $boost_major_version -ge 140; then - BOOST_REGEX([$1]) - m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl - LIBS="$LIBS $BOOST_REGEX_LIBS" - LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS" -fi -BOOST_FIND_LIB([graph], [$1], - [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;]) -LIBS=$boost_graph_save_LIBS -LDFLAGS=$boost_graph_save_LDFLAGS -])# BOOST_GRAPH - - -# BOOST_IOSTREAMS([PREFERRED-RT-OPT]) -# ----------------------------------- -# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([IOStreams], -[BOOST_FIND_LIB([iostreams], [$1], - [boost/iostreams/device/file_descriptor.hpp], - [boost::iostreams::file_descriptor fd; fd.close();]) -])# BOOST_IOSTREAMS - - -# BOOST_HASH() -# ------------ -# Look for Boost.Functional/Hash -BOOST_DEFUN([Hash], -[BOOST_FIND_HEADER([boost/functional/hash.hpp])]) - - -# BOOST_LAMBDA() -# -------------- -# Look for Boost.Lambda -BOOST_DEFUN([Lambda], -[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])]) - - -# BOOST_LOCALE() -# -------------- -# Look for Boost.Locale -BOOST_DEFUN([Locale], -[ -boost_locale_save_LIBS=$LIBS -boost_locale_save_LDFLAGS=$LDFLAGS -# require SYSTEM for boost-1.50.0 and up -if test $boost_major_version -ge 150; then - BOOST_SYSTEM([$1]) - m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl - LIBS="$LIBS $BOOST_SYSTEM_LIBS" - LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" -fi # end of the Boost.System check. -BOOST_FIND_LIB([locale], [$1], - [boost/locale.hpp], - [[boost::locale::generator gen; std::locale::global(gen(""));]]) -LIBS=$boost_locale_save_LIBS -LDFLAGS=$boost_locale_save_LDFLAGS -])# BOOST_LOCALE - -# BOOST_LOG([PREFERRED-RT-OPT]) -# ----------------------------- -# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Log], -[boost_log_save_LIBS=$LIBS -boost_log_save_LDFLAGS=$LDFLAGS -BOOST_SYSTEM([$1]) -BOOST_FILESYSTEM([$1]) -BOOST_DATE_TIME([$1]) -m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS" -LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS" -BOOST_FIND_LIB([log], [$1], - [boost/log/core/core.hpp], - [boost::log::attribute a; a.get_value();]) -LIBS=$boost_log_save_LIBS -LDFLAGS=$boost_log_save_LDFLAGS -])# BOOST_LOG - - -# BOOST_LOG_SETUP([PREFERRED-RT-OPT]) -# ----------------------------------- -# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Log_Setup], -[boost_log_setup_save_LIBS=$LIBS -boost_log_setup_save_LDFLAGS=$LDFLAGS -BOOST_LOG([$1]) -m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_LOG_LIBS" -LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS" -BOOST_FIND_LIB([log_setup], [$1], - [boost/log/utility/setup/from_settings.hpp], - [boost::log::basic_settings bs; bs.empty();]) -LIBS=$boost_log_setup_save_LIBS -LDFLAGS=$boost_log_setup_save_LDFLAGS -])# BOOST_LOG_SETUP - - -# BOOST_MATH() -# ------------ -# Look for Boost.Math -# TODO: This library isn't header-only but it comes in multiple different -# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99, -# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1, -# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the -# right thing anyway. -BOOST_DEFUN([Math], -[BOOST_FIND_HEADER([boost/math/special_functions.hpp])]) - - -# BOOST_MPI([PREFERRED-RT-OPT]) -# ------------------------------- -# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is -# set, otherwise tries CXX -# -BOOST_DEFUN([MPI], -[boost_save_CXX=${CXX} -boost_save_CXXCPP=${CXXCPP} -if test x"${MPICXX}" != x; then - CXX=${MPICXX} - CXXCPP="${MPICXX} -E" -fi -BOOST_FIND_LIB([mpi], [$1], - [boost/mpi.hpp], - [int argc = 0; - char **argv = 0; - boost::mpi::environment env(argc,argv);]) -CXX=${boost_save_CXX} -CXXCPP=${boost_save_CXXCPP} -])# BOOST_MPI - - -# BOOST_MULTIARRAY() -# ------------------ -# Look for Boost.MultiArray -BOOST_DEFUN([MultiArray], -[BOOST_FIND_HEADER([boost/multi_array.hpp])]) - - -# BOOST_NUMERIC_UBLAS() -# -------------------------- -# Look for Boost.NumericUblas (Basic Linear Algebra) -BOOST_DEFUN([Numeric_Ublas], -[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp]) -])# BOOST_NUMERIC_UBLAS - - -# BOOST_NUMERIC_CONVERSION() -# -------------------------- -# Look for Boost.NumericConversion (policy-based numeric conversion) -BOOST_DEFUN([Numeric_Conversion], -[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp]) -])# BOOST_NUMERIC_CONVERSION - - -# BOOST_OPTIONAL() -# ---------------- -# Look for Boost.Optional -BOOST_DEFUN([Optional], -[BOOST_FIND_HEADER([boost/optional.hpp])]) - - -# BOOST_PREPROCESSOR() -# -------------------- -# Look for Boost.Preprocessor -BOOST_DEFUN([Preprocessor], -[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])]) - - -# BOOST_RANGE() -# -------------------- -# Look for Boost.Range -BOOST_DEFUN([Range], -[BOOST_FIND_HEADER([boost/range/adaptors.hpp])]) - -# BOOST_UNORDERED() -# ----------------- -# Look for Boost.Unordered -BOOST_DEFUN([Unordered], -[BOOST_FIND_HEADER([boost/unordered_map.hpp])]) - - -# BOOST_UUID() -# ------------ -# Look for Boost.Uuid -BOOST_DEFUN([Uuid], -[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])]) - - -# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT]) -# ----------------------------------------- -# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT, -# see the documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Program_Options], -[BOOST_FIND_LIB([program_options], [$1], - [boost/program_options.hpp], - [boost::program_options::options_description d("test");]) -])# BOOST_PROGRAM_OPTIONS - - - -# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG) -# ------------------------------------ -# Save VARIABLE, and define it via `python-config --FLAG`. -# Substitute BOOST_PYTHON_VARIABLE. -m4_define([_BOOST_PYTHON_CONFIG], -[AC_SUBST([BOOST_PYTHON_$1], - [`python-config --$2 2>/dev/null`])dnl -boost_python_save_$1=$$1 -$1="$$1 $BOOST_PYTHON_$1"]) - - -# BOOST_PYTHON([PREFERRED-RT-OPT]) -# -------------------------------- -# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT, -# see the documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Python], -[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes]) -_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags]) -_BOOST_PYTHON_CONFIG([LIBS], [libs]) -m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl -BOOST_FIND_LIBS([python], [python python3], [$1], - [boost/python.hpp], - [], [BOOST_PYTHON_MODULE(empty) {}]) -CPPFLAGS=$boost_python_save_CPPFLAGS -LDFLAGS=$boost_python_save_LDFLAGS -LIBS=$boost_python_save_LIBS -])# BOOST_PYTHON - - -# BOOST_REF() -# ----------- -# Look for Boost.Ref -BOOST_DEFUN([Ref], -[BOOST_FIND_HEADER([boost/ref.hpp])]) - - -# BOOST_REGEX([PREFERRED-RT-OPT]) -# ------------------------------- -# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Regex], -[BOOST_FIND_LIB([regex], [$1], - [boost/regex.hpp], - [boost::regex exp("*"); boost::regex_match("foo", exp);]) -])# BOOST_REGEX - - -# BOOST_SERIALIZATION([PREFERRED-RT-OPT]) -# --------------------------------------- -# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see -# the documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Serialization], -[BOOST_FIND_LIB([serialization], [$1], - [boost/archive/text_oarchive.hpp], - [std::ostream* o = 0; // Cheap way to get an ostream... - boost::archive::text_oarchive t(*o);]) -])# BOOST_SERIALIZATION - - -# BOOST_SIGNALS([PREFERRED-RT-OPT]) -# --------------------------------- -# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Signals], -[BOOST_FIND_LIB([signals], [$1], - [boost/signal.hpp], - [boost::signal s;]) -])# BOOST_SIGNALS - - -# BOOST_SIGNALS2() -# ---------------- -# Look for Boost.Signals2 (new since 1.39.0). -BOOST_DEFUN([Signals2], -[BOOST_FIND_HEADER([boost/signals2.hpp]) -])# BOOST_SIGNALS2 - - -# BOOST_SMART_PTR() -# ----------------- -# Look for Boost.SmartPtr -BOOST_DEFUN([Smart_Ptr], -[BOOST_FIND_HEADER([boost/scoped_ptr.hpp]) -BOOST_FIND_HEADER([boost/shared_ptr.hpp]) -]) - - -# BOOST_STATICASSERT() -# -------------------- -# Look for Boost.StaticAssert -BOOST_DEFUN([StaticAssert], -[BOOST_FIND_HEADER([boost/static_assert.hpp])]) - - -# BOOST_STRING_ALGO() -# ------------------- -# Look for Boost.StringAlgo -BOOST_DEFUN([String_Algo], -[BOOST_FIND_HEADER([boost/algorithm/string.hpp]) -]) - - -# BOOST_SYSTEM([PREFERRED-RT-OPT]) -# -------------------------------- -# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. This library was introduced in Boost -# 1.35.0. -BOOST_DEFUN([System], -[BOOST_FIND_LIB([system], [$1], - [boost/system/error_code.hpp], - [boost::system::error_code e; e.clear();]) -])# BOOST_SYSTEM - - -# BOOST_TEST([PREFERRED-RT-OPT]) -# ------------------------------ -# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Test], -[m4_pattern_allow([^BOOST_CHECK$])dnl -BOOST_FIND_LIB([unit_test_framework], [$1], - [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);], - [using boost::unit_test::test_suite; - test_suite* init_unit_test_suite(int argc, char ** argv) - { return NULL; }]) -])# BOOST_TEST - - -# BOOST_THREAD([PREFERRED-RT-OPT]) -# --------------------------------- -# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Thread], -[dnl Having the pthread flag is required at least on GCC3 where -dnl boost/thread.hpp would complain if we try to compile without -dnl -pthread on GNU/Linux. -AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl -boost_thread_save_LIBS=$LIBS -boost_thread_save_LDFLAGS=$LDFLAGS -boost_thread_save_CPPFLAGS=$CPPFLAGS -# Link-time dependency from thread to system was added as of 1.49.0. -if test $boost_major_version -ge 149; then -BOOST_SYSTEM([$1]) -fi # end of the Boost.System check. -m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag" -LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS" -CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag" - -# When compiling for the Windows platform, the threads library is named -# differently. This suffix doesn't exist in new versions of Boost, or -# possibly new versions of GCC on mingw I am assuming it's Boost's change for -# now and I am setting version to 1.48, for lack of knowledge as to when this -# change occurred. -if test $boost_major_version -lt 148; then - case $host_os in - (*mingw*) boost_thread_lib_ext=_win32;; - esac -fi -BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext], - [$1], - [boost/thread.hpp], [boost::thread t; boost::mutex m;]) - -case $host_os in - (*mingw*) boost_thread_w32_socket_link=-lws2_32;; -esac - -BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link" -BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS" -BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag" -LIBS=$boost_thread_save_LIBS -LDFLAGS=$boost_thread_save_LDFLAGS -CPPFLAGS=$boost_thread_save_CPPFLAGS -])# BOOST_THREAD - -AU_ALIAS([BOOST_THREADS], [BOOST_THREAD]) - - -# BOOST_TOKENIZER() -# ----------------- -# Look for Boost.Tokenizer -BOOST_DEFUN([Tokenizer], -[BOOST_FIND_HEADER([boost/tokenizer.hpp])]) - - -# BOOST_TRIBOOL() -# --------------- -# Look for Boost.Tribool -BOOST_DEFUN([Tribool], -[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp]) -BOOST_FIND_HEADER([boost/logic/tribool.hpp]) -]) - - -# BOOST_TUPLE() -# ------------- -# Look for Boost.Tuple -BOOST_DEFUN([Tuple], -[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])]) - - -# BOOST_TYPETRAITS() -# -------------------- -# Look for Boost.TypeTraits -BOOST_DEFUN([TypeTraits], -[BOOST_FIND_HEADER([boost/type_traits.hpp])]) - - -# BOOST_UTILITY() -# --------------- -# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom, -# etc.) -BOOST_DEFUN([Utility], -[BOOST_FIND_HEADER([boost/utility.hpp])]) - - -# BOOST_VARIANT() -# --------------- -# Look for Boost.Variant. -BOOST_DEFUN([Variant], -[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp]) -BOOST_FIND_HEADER([boost/variant.hpp])]) - - -# BOOST_POINTER_CONTAINER() -# ------------------------ -# Look for Boost.PointerContainer -BOOST_DEFUN([Pointer_Container], -[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp]) -BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp]) -])# BOOST_POINTER_CONTAINER - - -# BOOST_WAVE([PREFERRED-RT-OPT]) -# ------------------------------ -# NOTE: If you intend to use Wave/Spirit with thread support, make sure you -# call BOOST_THREAD first. -# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the -# documentation of BOOST_FIND_LIB above. -BOOST_DEFUN([Wave], -[AC_REQUIRE([BOOST_FILESYSTEM])dnl -AC_REQUIRE([BOOST_DATE_TIME])dnl -boost_wave_save_LIBS=$LIBS -boost_wave_save_LDFLAGS=$LDFLAGS -m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl -LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \ -$BOOST_THREAD_LIBS" -LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \ -$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS" -BOOST_FIND_LIB([wave], [$1], - [boost/wave.hpp], - [boost::wave::token_id id; get_token_name(id);]) -LIBS=$boost_wave_save_LIBS -LDFLAGS=$boost_wave_save_LDFLAGS -])# BOOST_WAVE - - -# BOOST_XPRESSIVE() -# ----------------- -# Look for Boost.Xpressive (new since 1.36.0). -BOOST_DEFUN([Xpressive], -[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])]) - - -# ----------------- # -# Internal helpers. # -# ----------------- # - - -# _BOOST_PTHREAD_FLAG() -# --------------------- -# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag -# which must be used in CPPFLAGS and LIBS. -# -# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3, -# boost/thread.hpp will trigger a #error if -pthread isn't used: -# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support -# is not turned on. Please set the correct command line options for -# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)" -# -# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html -AC_DEFUN([_BOOST_PTHREAD_FLAG], -[AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_LANG_PUSH([C++])dnl -AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag], -[ boost_cv_pthread_flag= - # The ordering *is* (sometimes) important. Some notes on the - # individual items follow: - # (none): in case threads are in libc; should be tried before -Kthread and - # other compiler flags to prevent continual compiler warnings - # -lpthreads: AIX (must check this before -lpthread) - # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) - # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) - # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread) - # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads) - # -pthreads: Solaris/GCC - # -mthreads: MinGW32/GCC, Lynx/GCC - # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it - # doesn't hurt to check since this sometimes defines pthreads too; - # also defines -D_REENTRANT) - # ... -mt is also the pthreads flag for HP/aCC - # -lpthread: GNU Linux, etc. - # --thread-safe: KAI C++ - case $host_os in #( - *solaris*) - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #( - *) - boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \ - -pthreads -mthreads -lpthread --thread-safe -mt";; - esac - # Generate the test file. - AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include ], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0);])]) - for boost_pthread_flag in '' $boost_pthread_flags; do - boost_pthread_ok=false -dnl Re-use the test file already generated. - boost_pthreads__save_LIBS=$LIBS - LIBS="$LIBS $boost_pthread_flag" - AC_LINK_IFELSE([], - [if grep ".*$boost_pthread_flag" conftest.err; then - echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD - else - boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag - fi]) - LIBS=$boost_pthreads__save_LIBS - $boost_pthread_ok && break - done -]) -AC_LANG_POP([C++])dnl -])# _BOOST_PTHREAD_FLAG - - -# _BOOST_gcc_test(MAJOR, MINOR) -# ----------------------------- -# Internal helper for _BOOST_FIND_COMPILER_TAG. -m4_define([_BOOST_gcc_test], -["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl - -# _BOOST_mingw_test(MAJOR, MINOR) -# ----------------------------- -# Internal helper for _BOOST_FIND_COMPILER_TAG. -m4_define([_BOOST_mingw_test], -["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \ - (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ - || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl - - -# _BOOST_FIND_COMPILER_TAG() -# -------------------------- -# Internal. When Boost is installed without --layout=system, each library -# filename will hold a suffix that encodes the compiler used during the -# build. The Boost build system seems to call this a `tag'. -AC_DEFUN([_BOOST_FIND_COMPILER_TAG], -[AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_CACHE_CHECK([for the toolset name used by Boost for $CXX], - [boost_cv_lib_tag], -[boost_cv_lib_tag=unknown -if test x$boost_cv_inc_path != xno; then - AC_LANG_PUSH([C++])dnl - # The following tests are mostly inspired by boost/config/auto_link.hpp - # The list is sorted to most recent/common to oldest compiler (in order - # to increase the likelihood of finding the right compiler with the - # least number of compilation attempt). - # Beware that some tests are sensible to the order (for instance, we must - # look for MinGW before looking for GCC3). - # I used one compilation test per compiler with a #error to recognize - # each compiler so that it works even when cross-compiling (let me know - # if you know a better approach). - # Known missing tags (known from Boost's tools/build/v2/tools/common.jam): - # como, edg, kcc, bck, mp, sw, tru, xlc - # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines - # the same defines as GCC's). - for i in \ - _BOOST_mingw_test(6, 2) \ - _BOOST_gcc_test(6, 2) \ - _BOOST_mingw_test(6, 1) \ - _BOOST_gcc_test(6, 1) \ - _BOOST_mingw_test(6, 0) \ - _BOOST_gcc_test(6, 0) \ - _BOOST_mingw_test(5, 3) \ - _BOOST_gcc_test(5, 3) \ - _BOOST_mingw_test(5, 2) \ - _BOOST_gcc_test(5, 2) \ - _BOOST_mingw_test(5, 1) \ - _BOOST_gcc_test(5, 1) \ - _BOOST_mingw_test(5, 0) \ - _BOOST_gcc_test(5, 0) \ - _BOOST_mingw_test(4, 10) \ - _BOOST_gcc_test(4, 10) \ - _BOOST_mingw_test(4, 9) \ - _BOOST_gcc_test(4, 9) \ - _BOOST_mingw_test(4, 8) \ - _BOOST_gcc_test(4, 8) \ - _BOOST_mingw_test(4, 7) \ - _BOOST_gcc_test(4, 7) \ - _BOOST_mingw_test(4, 6) \ - _BOOST_gcc_test(4, 6) \ - _BOOST_mingw_test(4, 5) \ - _BOOST_gcc_test(4, 5) \ - _BOOST_mingw_test(4, 4) \ - _BOOST_gcc_test(4, 4) \ - _BOOST_mingw_test(4, 3) \ - _BOOST_gcc_test(4, 3) \ - _BOOST_mingw_test(4, 2) \ - _BOOST_gcc_test(4, 2) \ - _BOOST_mingw_test(4, 1) \ - _BOOST_gcc_test(4, 1) \ - _BOOST_mingw_test(4, 0) \ - _BOOST_gcc_test(4, 0) \ - "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \ - && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \ - || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \ - _BOOST_gcc_test(3, 4) \ - _BOOST_gcc_test(3, 3) \ - "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \ - "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \ - _BOOST_gcc_test(3, 2) \ - "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \ - _BOOST_gcc_test(3, 1) \ - _BOOST_gcc_test(3, 0) \ - "defined __BORLANDC__ @ bcb" \ - "defined __ICC && (defined __unix || defined __unix__) @ il" \ - "defined __ICL @ iw" \ - "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \ - _BOOST_gcc_test(2, 95) \ - "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \ - "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \ - "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \ - "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8" - do - boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '` - boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'` - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if $boost_tag_test -/* OK */ -#else -# error $boost_tag_test -#endif -]])], [boost_cv_lib_tag=$boost_tag; break], []) - done -AC_LANG_POP([C++])dnl - case $boost_cv_lib_tag in #( - # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed - # to "gcc41" for instance. - *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there. - gcc*) - boost_tag_x= - case $host_os in #( - darwin*) - if test $boost_major_version -ge 136; then - # The `x' added in r46793 of Boost. - boost_tag_x=x - fi;; - esac - # We can specify multiple tags in this variable because it's used by - # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ... - boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc" - ;; #( - unknown) - AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]]) - boost_cv_lib_tag= - ;; - esac -fi])dnl end of AC_CACHE_CHECK -])# _BOOST_FIND_COMPILER_TAG - - -# _BOOST_GUESS_WHETHER_TO_USE_MT() -# -------------------------------- -# Compile a small test to try to guess whether we should favor MT (Multi -# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly. -AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT], -[# Check whether we do better use `mt' even though we weren't ask to. -AC_LANG_PUSH([C++])dnl -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if defined _REENTRANT || defined _MT || defined __MT__ -/* use -mt */ -#else -# error MT not needed -#endif -]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false]) -AC_LANG_POP([C++])dnl -]) - -# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# ------------------------------------------------------------------- -# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile, -# will break when Autoconf changes its internals. Requires that you manually -# rm -f conftest.$ac_objext in between to really different tests, otherwise -# you will try to link a conftest.o left behind by a previous test. -# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this -# macro). -# -# Don't use "break" in the actions, as it would short-circuit some code -# this macro runs after the actions. -m4_define([_BOOST_AC_LINK_IFELSE], -[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl -rm -f conftest$ac_exeext -boost_save_ac_ext=$ac_ext -boost_use_source=: -# If we already have a .o, re-use it. We change $ac_ext so that $ac_link -# tries to link the existing object file instead of compiling from source. -test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false && - _AS_ECHO_LOG([re-using the existing conftest.$ac_objext]) -AS_IF([_AC_DO_STDERR($ac_link) && { - test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_executable_p conftest$ac_exeext -dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough. - }], - [$2], - [if $boost_use_source; then - _AC_MSG_LOG_CONFTEST - fi - $3]) -ac_objext=$boost_save_ac_objext -ac_ext=$boost_save_ac_ext -dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization) -dnl information created by the PGI compiler (conftest_ipa8_conftest.oo), -dnl as it would interfere with the next link command. -rm -f core conftest.err conftest_ipa8_conftest.oo \ - conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl -])# _BOOST_AC_LINK_IFELSE - -# Local Variables: -# mode: autoconf -# End: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 7ea6db7..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - -add_subdirectory(utilspp) -add_subdirectory(curlpp) - - -########### install files ############### - - - - -#original Makefile.am contents follow: - -#ACLOCAL_AMFLAGS = -I m4 -#SUBDIRS = utilspp curlpp diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 04dcec0..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = utilspp curlpp diff --git a/src/curlpp/CMakeLists.txt b/src/curlpp/CMakeLists.txt deleted file mode 100644 index 6fd6895..0000000 --- a/src/curlpp/CMakeLists.txt +++ /dev/null @@ -1,97 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - -add_subdirectory(internal) - - -########### next target ############### - -set(curlpp_LIB_SRCS ${sources}) - -add_library(curlpp SHARED ${curlpp_LIB_SRCS}) - -target_link_libraries(curlpp ${KDE4_KDECORE_LIBS} internal) - -set_target_properties(curlpp PROPERTIES VERSION 1.0.0 SOVERSION 1) -install(TARGETS curlpp ${INSTALL_TARGETS_DEFAULT_ARGS}) - - -########### install files ############### - - - - -#original Makefile.am contents follow: - -#SUBDIRS = internal -#lib_LTLIBRARIES = libcurlpp.la -#EXTRA_DIST = Makefile.msvc -# -#if MAINTENER_CODE -#maintener_source = -#endif -# -#INCLUDES = -I$(top_builddir)/include/curlpp -I$(top_builddir)/include -# -#sources = \ -# cURLpp.cpp cURLpp.hpp \ -# Exception.cpp Exception.hpp \ -# Easy.cpp Easy.hpp Easy.inl \ -# Form.cpp Form.hpp \ -# Info.cpp Info.hpp Info.inl \ -# Infos.hpp \ -# Multi.cpp Multi.hpp \ -# NonCopyable.hpp \ -# OptionBase.cpp OptionBase.hpp \ -# OptionContainer.hpp OptionContainer.inl \ -# OptionContainerType.hpp \ -# Option.hpp Option.inl \ -# Options.cpp Options.hpp \ -# StorageOptions.hpp StorageOptions.inl \ -# Types.hpp \ -# TypeTrait.hpp \ -# autolink.h \ -# ${maintener_source} -# -#libcurlpp_la_LIBADD = internal/libinternal.la -#libcurlpp_la_SOURCES = ${sources} -#VERSION=-version-info 0:2:0 -# -#AM_CXXFLAGS= -I../ -# -## This flag accepts an argument of the form current[:revision[:age]]. So, -## passing -version-info 3:12:1 sets current to 3, revision to 12, and age to -## 1. -## -## If either revision or age are omitted, they default to 0. Also note that age -## must be less than or equal to the current interface number. -### Here are a set of rules to help you update your library version information: -## -## 1.Start with version information of 0:0:0 for each libtool library. -## -## 2.Update the version information only immediately before a public release of -## your software. More frequent updates are unnecessary, and only guarantee -## that the current interface number gets larger faster. -## -## 3.If the library source code has changed at all since the last update, then -## increment revision (c:r:a becomes c:r+1:a). -## -## 4.If any interfaces have been added, removed, or changed since the last -## update, increment current, and set revision to 0. -## -## 5.If any interfaces have been added since the last public release, then -## increment age. -## -## 6.If any interfaces have been removed since the last public release, then -## set age to 0. -## -# -#if NO_UNDEFINED -## The -no-undefined flag is CRUCIAL for this to build fine on Cygwin. If we -## find a case in which we need to remove this flag, we should most likely -## write a configure check that detects when this flag is needed and when its -## not. -#libcurlpp_la_LDFLAGS = -no-undefined -Wno-inline-dllimport $(VERSION) -#else -#libcurlpp_la_LDFLAGS = $(VERSION) -#endif diff --git a/src/curlpp/Easy.cpp b/src/curlpp/Easy.cpp index f649841..52567b6 100644 --- a/src/curlpp/Easy.cpp +++ b/src/curlpp/Easy.cpp @@ -25,8 +25,6 @@ #include "curlpp/Easy.hpp" #include "curlpp/Options.hpp" -#include "curlpp/internal/global.h" -#include "curlpp/internal/buildconfig.h" #include @@ -122,6 +120,3 @@ std::ostream & operator<<(std::ostream & stream, const curlpp::Easy & request) } -#if defined(CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION) - #include "./Easy.ins" -#endif diff --git a/src/curlpp/Easy.custom.ins b/src/curlpp/Easy.custom.ins deleted file mode 100644 index f39e1d1..0000000 --- a/src/curlpp/Easy.custom.ins +++ /dev/null @@ -1,42 +0,0 @@ -/** -* \file -* Custom (user) specializations of methods of Easy class. -* -* IMPORTANT !!! -* Users should add explicit specializations for types -* they use in their applications when building library with -* SELF_CONTAINED set. Otherwise there will be linker errors when -* _using_ the library which has been built without these specializations. -* -*/ - -#include "curlpp/Easy.hpp" - -#include - - -using namespace curlpp::options; - - -namespace curlpp -{ - - -/** - * Custom specializations for... - * - * template - * void curlpp::Easy::setOpt(InputIterator first, InputIterator last) - */ - -/// Used in example23. - -typedef std::vector::iterator EasyCustomType1; - -template -CURLPPAPI void Easy::setOpt(EasyCustomType1 first, EasyCustomType1 last); - -/// Add more here... - - -} // namespace curlpp \ No newline at end of file diff --git a/src/curlpp/Easy.ins b/src/curlpp/Easy.ins deleted file mode 100644 index 2f10824..0000000 --- a/src/curlpp/Easy.ins +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Use - * Find what: "typedef.*?\n?.*?\n?.*>\s*(.*);" regex and - * Replace with: "template CURLPPAPI void Easy::setOpt(options::$1::ParamType);" regex - * to generate this file from Options.hpp header file. - */ - -#include - -#include "curlpp/Easy.hpp" -#include "curlpp/Options.hpp" - -#ifdef CURLPP_ALLOW_NOT_AVAILABLE -#define DEF_IF_ALLOW_AVAILABLE (type,option,name) typedef curlpp::NotAvailableOptionTrait name; -#endif - -// #begin define OPTION(version,type,option,name) -// #if LIBCURL_VERSION_NUM >= version -// typedef curlpp::OptionTrait name; -// #else -// DEF_IF_ALLOW_AVAILABLE(type,option,name) -// #endif -// #end - - -namespace curlpp -{ - - /** - * Cookie interface. - */ - -#if LIBCURL_VERSION_NUM >= 0x070d01 - template - CURLPPAPI void Easy::setOpt(options::CookieList::ParamType); -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - CURLPPAPI void Easy::setOpt(options::CookieList::ParamType); -#endif -#endif - - /** - * Behavior options. - */ - - template - CURLPPAPI void Easy::setOpt(options::Verbose::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Header::ParamType); -#if LIBCURL_VERSION_NUM >= 0x070A00 - template - CURLPPAPI void Easy::setOpt(options::NoSignal::ParamType); -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - CURLPPAPI void Easy::setOpt(options::NoSignal::ParamType); -#endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - template -CURLPPAPI void Easy::setOpt(options::NoProgress::ParamType); - - /** - * Callback options. - */ - - template - CURLPPAPI void Easy::setOpt(options::WriteFunction::ParamType); - -#ifdef HAVE_BOOST - template - CURLPPAPI void Easy::setOpt(options::BoostWriteFunction::ParamType); -#endif - - /** - * Using this option will reset CURLOPT_WRITEFUNCTION to - * default callback. In fact, use only this option if you only - * want libcURL to use the FILE * given in argument instead - * of stdout. - */ - -#if LIBCURL_VERSION_NUM >= 0x070907 - template - CURLPPAPI void Easy::setOpt(options::WriteFile::ParamType); - template - CURLPPAPI void Easy::setOpt(options::WriteStream::ParamType); -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template -CURLPPAPI void Easy::setOpt(options::WriteFile::ParamType); - template - CURLPPAPI void Easy::setOpt(options::WriteStream::ParamType); -#endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - -#if LIBCURL_VERSION_NUM >= 0x070c01 - template - CURLPPAPI void Easy::setOpt(options::ReadFunction::ParamType); - -#ifdef HAVE_BOOST - template - CURLPPAPI void Easy::setOpt(options::BoostReadFunction::ParamType); -#endif -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - CURLPPAPI void Easy::setOpt(options::ReadFunction::ParamType); - -#ifdef HAVE_BOOST - template - CURLPPAPI void Easy::setOpt(options::BoostReadFunction::ParamType); -#endif // HAVE_BOOST -#endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - /** - * Using this option will reset CURLOPT_READFUNCTION to - * default callback. In fact, use only this option if you only - * want libcURL to use the FILE * given in argument instead - * of stdout. - */ - -#if LIBCURL_VERSION_NUM >= 0x070907 - template - CURLPPAPI void Easy::setOpt(options::ReadFile::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ReadStream::ParamType); -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - CURLPPAPI void Easy::setOpt(options::ReadFile::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ReadStream::ParamType); -#endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - template - CURLPPAPI void Easy::setOpt(options::ProgressFunction::ParamType); - -#ifdef HAVE_BOOST - template - CURLPPAPI void Easy::setOpt(options::BoostProgressFunction::ParamType); -#endif - - template - CURLPPAPI void Easy::setOpt(options::HeaderFunction::ParamType); - -#ifdef HAVE_BOOST - template - CURLPPAPI void Easy::setOpt(options::BoostHeaderFunction::ParamType); -#endif - - template - CURLPPAPI void Easy::setOpt(options::DebugFunction::ParamType); - -#ifdef HAVE_BOOST - template - CURLPPAPI void Easy::setOpt(options::BoostDebugFunction::ParamType); -#endif - - template - CURLPPAPI void Easy::setOpt(options::SslCtxFunction::ParamType); - -#ifdef HAVE_BOOST - template - CURLPPAPI void Easy::setOpt(options::BoostSslCtxFunction::ParamType); -#endif - - - /** - * Error options. - */ - - template - CURLPPAPI void Easy::setOpt(options::ErrorBuffer::ParamType); - -#ifdef FILE - template - CURLPPAPI void Easy::setOpt(options::StdErr::ParamType); -#endif - - template - CURLPPAPI void Easy::setOpt(options::FailOnError::ParamType); - - /** - * Network options. - */ - - template - CURLPPAPI void Easy::setOpt(options::Url::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Proxy::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ProxyPort::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ProxyType::ParamType); - template - CURLPPAPI void Easy::setOpt(options::HttpProxyTunnel::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Interface::ParamType); - template - CURLPPAPI void Easy::setOpt(options::DnsCacheTimeout::ParamType); - template - CURLPPAPI void Easy::setOpt(options::DnsUseGlobalCache::ParamType); - template - CURLPPAPI void Easy::setOpt(options::BufferSize::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Port::ParamType); - - template - CURLPPAPI void Easy::setOpt(options::TcpNoDelay::ParamType); - - /** - * Names and passwords options. - */ - - template - CURLPPAPI void Easy::setOpt(options::Netrc::ParamType); - template - CURLPPAPI void Easy::setOpt(options::NetrcFile::ParamType); - template - CURLPPAPI void Easy::setOpt(options::UserPwd::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ProxyUserPwd::ParamType); - template - CURLPPAPI void Easy::setOpt(options::HttpAuth::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ProxyAuth::ParamType); - - /** - * HTTP options. - */ - - template - CURLPPAPI void Easy::setOpt(options::AutoReferer::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Encoding::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FollowLocation::ParamType); - template - CURLPPAPI void Easy::setOpt(options::UnrestrictedAuth::ParamType); - template - CURLPPAPI void Easy::setOpt(options::MaxRedirs::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Put::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Upload::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Post::ParamType); - template - CURLPPAPI void Easy::setOpt(options::PostFields::ParamType); - template - CURLPPAPI void Easy::setOpt(options::PostFieldSize::ParamType); - template - CURLPPAPI void Easy::setOpt(options::PostFieldSizeLarge::ParamType); - template - CURLPPAPI void Easy::setOpt(options::HttpPost::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Referer::ParamType); - template - CURLPPAPI void Easy::setOpt(options::UserAgent::ParamType); - template - CURLPPAPI void Easy::setOpt(options::HttpHeader::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Http200Aliases::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Cookie::ParamType); - template - CURLPPAPI void Easy::setOpt(options::CookieFile::ParamType); - template - CURLPPAPI void Easy::setOpt(options::CookieJar::ParamType); - template - CURLPPAPI void Easy::setOpt(options::CookieSession::ParamType); - template - CURLPPAPI void Easy::setOpt(options::HttpGet::ParamType); - template - CURLPPAPI void Easy::setOpt(options::HttpVersion::ParamType); - - /** - * FTP options. - */ - - template - CURLPPAPI void Easy::setOpt(options::FtpPort::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Quote::ParamType); - template - CURLPPAPI void Easy::setOpt(options::PostQuote::ParamType); - template - CURLPPAPI void Easy::setOpt(options::PreQuote::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FtpListOnly::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FtpAppend::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FtpUseEpsv::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FtpFileMethod::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FtpCreateMissingDirs::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FtpResponseTimeout::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FtpSsl::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FtpSslAuth::ParamType); - - /** - * Protocol options. - */ - - template - CURLPPAPI void Easy::setOpt(options::TransferText::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Crlf::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Range::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ResumeFrom::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ResumeFromLarge::ParamType); - template - CURLPPAPI void Easy::setOpt(options::CustomRequest::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FileTime::ParamType); - template - CURLPPAPI void Easy::setOpt(options::NoBody::ParamType); - template - CURLPPAPI void Easy::setOpt(options::InfileSize::ParamType); - template - CURLPPAPI void Easy::setOpt(options::InfileSizeLarge::ParamType); - template - CURLPPAPI void Easy::setOpt(options::MaxFileSize::ParamType); - template - CURLPPAPI void Easy::setOpt(options::MaxFileSizeLarge::ParamType); - template - CURLPPAPI void Easy::setOpt(options::TimeCondition::ParamType); - template - CURLPPAPI void Easy::setOpt(options::TimeValue::ParamType); - - /** - * Connection options. - */ - - template - CURLPPAPI void Easy::setOpt(options::Timeout::ParamType); - template - CURLPPAPI void Easy::setOpt(options::LowSpeedLimit::ParamType); - template - CURLPPAPI void Easy::setOpt(options::LowSpeedTime::ParamType); - template - CURLPPAPI void Easy::setOpt(options::MaxConnects::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ClosePolicy::ParamType); - template - CURLPPAPI void Easy::setOpt(options::FreshConnect::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ForbidReuse::ParamType); - template - CURLPPAPI void Easy::setOpt(options::ConnectTimeout::ParamType); - template - CURLPPAPI void Easy::setOpt(options::IpResolve::ParamType); - - /** - * SSL and security options. - */ - - template - CURLPPAPI void Easy::setOpt(options::SslCert::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslCertType::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslCertPasswd::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslKey::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslKeyType::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslKeyPasswd::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslEngine::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslEngineDefault::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslVersion::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslVerifyPeer::ParamType); - template - CURLPPAPI void Easy::setOpt(options::CaInfo::ParamType); - template - CURLPPAPI void Easy::setOpt(options::CaPath::ParamType); - template - CURLPPAPI void Easy::setOpt(options::RandomFile::ParamType); - template - CURLPPAPI void Easy::setOpt(options::EgdSocket::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslVerifyHost::ParamType); - template - CURLPPAPI void Easy::setOpt(options::SslCipherList::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Krb4Level::ParamType); - - /** - * Others options. - */ - - template - CURLPPAPI void Easy::setOpt(options::Private::ParamType); - template - CURLPPAPI void Easy::setOpt(options::Krb4Level::ParamType); - - //Share; - //TelnetOptions - -} // namespace curlpp - -#include "./Easy.custom.ins" \ No newline at end of file diff --git a/src/curlpp/Exception.cpp b/src/curlpp/Exception.cpp index e2cc97a..d48937e 100644 --- a/src/curlpp/Exception.cpp +++ b/src/curlpp/Exception.cpp @@ -21,7 +21,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "curlpp/internal/global.h" #include "curlpp/Exception.hpp" curlpp::RuntimeError::~RuntimeError() throw() @@ -145,6 +144,3 @@ void curlpp::logicAssert(const char * reason, bool isOkay) throw curlpp::LogicError(reason); } -#if defined(CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION) - #include "./Exception.ins" -#endif diff --git a/src/curlpp/Exception.ins b/src/curlpp/Exception.ins deleted file mode 100644 index e3e9537..0000000 --- a/src/curlpp/Exception.ins +++ /dev/null @@ -1,38 +0,0 @@ -#include "curlpp/Exception.hpp" - -#include - -namespace curlpp -{ - -template -void curlpp::raiseException(const std::exception &); - -template -void raiseException(const std::logic_error &); - -template -void raiseException(const std::domain_error &); - -template -void raiseException(const std::invalid_argument &); - -template -void raiseException(const std::length_error &); - -template -void raiseException(const std::out_of_range &); - -template -void raiseException(const std::runtime_error &); - -template -void raiseException(const std::overflow_error &); - -template -void raiseException(const std::underflow_error &); - -template -void raiseException(const std::range_error &); - -} // namespace curlpp \ No newline at end of file diff --git a/src/curlpp/Form.cpp b/src/curlpp/Form.cpp index e2704ce..41e1002 100644 --- a/src/curlpp/Form.cpp +++ b/src/curlpp/Form.cpp @@ -21,8 +21,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "curlpp/internal/global.h" - #include "curlpp/Form.hpp" #include diff --git a/src/curlpp/Info.cpp b/src/curlpp/Info.cpp index b0586bb..d68757a 100644 --- a/src/curlpp/Info.cpp +++ b/src/curlpp/Info.cpp @@ -1,4 +1,3 @@ -#include "curlpp/internal/global.h" #include "curlpp/internal/SList.hpp" #include "curlpp/Info.hpp" diff --git a/src/curlpp/Infos.cpp b/src/curlpp/Infos.cpp deleted file mode 100644 index 43afbf1..0000000 --- a/src/curlpp/Infos.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "curlpp/internal/buildconfig.h" - -#if defined(CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION) - #include "./Infos.ins" -#endif diff --git a/src/curlpp/Infos.ins b/src/curlpp/Infos.ins deleted file mode 100644 index 11346d6..0000000 --- a/src/curlpp/Infos.ins +++ /dev/null @@ -1,61 +0,0 @@ -#include "curlpp/Infos.hpp" - -#include -#include - -/* - * Use Find what: "typedef.*\> {.*}$" regular expression and Replace with: "template \1" - * to generate most of this file from its corresponding header file. - */ - -namespace curlpp -{ - - namespace infos - { - template EffectiveUrl; - template ResponseCode; - template HttpConnectCode; - template FileTime; - template TotalTime; - template NameLookupTime; - template ConnectTime; - template PreTransferTime; - template StartTransferTime; - template RedirectTime; - template RedirectCount; - template SizeUpload; - template SizeDownload; - template SpeedDownload; - template SpeedUpload; - template HeaderSize; - template RequestSize; - template SslVerifyResult; -#if LIBCURL_VERSION_NUM >= 0x070c03 - template SslEngines; -#endif - template ContentLengthDownload; - template ContentLengthUpload; - template ContentType; - template HttpAuthAvail; - template ProxyAuthAvail; -#if LIBCURL_VERSION_NUM >= 0x070c02 - template OsErrno; -#endif -#if LIBCURL_VERSION_NUM >= 0x070c03 - template NumConnects; -#endif - -#if LIBCURL_VERSION_NUM >= 0x070e01 - template CookieList; -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - // This curlinfo text must be specified, so we specify something - // that we know will be there. - template CookieList; -#endif -#endif - - } // namespace infos - -} // namespace curlpp \ No newline at end of file diff --git a/src/curlpp/Makefile.am b/src/curlpp/Makefile.am deleted file mode 100644 index 3eef54d..0000000 --- a/src/curlpp/Makefile.am +++ /dev/null @@ -1,64 +0,0 @@ -SUBDIRS = internal -lib_LTLIBRARIES = libcurlpp.la -EXTRA_DIST = Makefile.msvc - -if MAINTENER_CODE -maintener_source = -endif - -AM_CPPFLAGS = -I$(top_builddir)/include/curlpp -I$(top_builddir)/include - -sources = \ - cURLpp.cpp \ - Exception.cpp \ - Easy.cpp \ - Form.cpp \ - Info.cpp \ - Multi.cpp \ - OptionBase.cpp \ - Options.cpp \ - autolink.h \ - ${maintener_source} - -libcurlpp_la_LIBADD = internal/libinternal.la -libcurlpp_la_SOURCES = ${sources} -VERSION=-version-info 0:2:0 - -AM_CXXFLAGS= -I../ - -# This flag accepts an argument of the form current[:revision[:age]]. So, -# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to -# 1. -# -# If either revision or age are omitted, they default to 0. Also note that age -# must be less than or equal to the current interface number. -## Here are a set of rules to help you update your library version information: -# -# 1.Start with version information of 0:0:0 for each libtool library. -# -# 2.Update the version information only immediately before a public release of -# your software. More frequent updates are unnecessary, and only guarantee -# that the current interface number gets larger faster. -# -# 3.If the library source code has changed at all since the last update, then -# increment revision (c:r:a becomes c:r+1:a). -# -# 4.If any interfaces have been added, removed, or changed since the last -# update, increment current, and set revision to 0. -# -# 5.If any interfaces have been added since the last public release, then -# increment age. -# -# 6.If any interfaces have been removed since the last public release, then -# set age to 0. -# - -if NO_UNDEFINED -# The -no-undefined flag is CRUCIAL for this to build fine on Cygwin. If we -# find a case in which we need to remove this flag, we should most likely -# write a configure check that detects when this flag is needed and when its -# not. -libcurlpp_la_LDFLAGS = -no-undefined -Wno-inline-dllimport $(VERSION) -else -libcurlpp_la_LDFLAGS = $(VERSION) -endif diff --git a/src/curlpp/Multi.cpp b/src/curlpp/Multi.cpp index 360ba17..58b05aa 100644 --- a/src/curlpp/Multi.cpp +++ b/src/curlpp/Multi.cpp @@ -21,7 +21,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "curlpp/internal/global.h" #include "curlpp/Easy.hpp" #include "curlpp/Exception.hpp" diff --git a/src/curlpp/Option.cpp b/src/curlpp/Option.cpp deleted file mode 100644 index b7a0b57..0000000 --- a/src/curlpp/Option.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "curlpp/Option.hpp" -#include "curlpp/internal/OptionSetter.hpp" - -template -const CURLoption curlpp::OptionTrait::option; - -#if defined(CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION) - #include "./Option.ins" -#endif diff --git a/src/curlpp/Option.ins b/src/curlpp/Option.ins deleted file mode 100644 index c1fafeb..0000000 --- a/src/curlpp/Option.ins +++ /dev/null @@ -1,409 +0,0 @@ -/* - * Use Find what: ".*?<\s*?\n?\s*(.*?)\s*,\s*?\n?.*?>\s*(.*?)s*;" regex and - * Replace with: "template Option<$1>;" regex - * to generate this file from Options.hpp header file. - */ - -#include - - -namespace curlpp -{ - - - /** - * Cookie interface. - */ - -#if LIBCURL_VERSION_NUM >= 0x070d01 - template Option; -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - Option; -#endif -#endif - - /** - * Behavior options. - */ - - template - Option; - template - Option; -#if LIBCURL_VERSION_NUM >= 0x070A00 - template - Option; -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - Option; -#endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - template - Option; - - /** - * Callback options. - */ - - template - Option; - - template - Option; - -#ifdef HAVE_BOOST - template - Option; -#endif - - /** - * Using this option will reset CURLOPT_WRITEFUNCTION to - * default callback. In fact, use only this option if you only - * want libcURL to use the FILE * given in argument instead - * of stdout. - */ - -#if LIBCURL_VERSION_NUM >= 0x070907 - template - Option; - template - Option; -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - Option; - template - Option; -#endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - -#if LIBCURL_VERSION_NUM >= 0x070c01 - - template - Option; - - template - Option; - -#ifdef HAVE_BOOST - template - Option; -#endif - -#else - -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - Option; - -#ifdef HAVE_BOOST - template - Option; -#endif // HAVE_BOOST -#endif // CURLPP_ALLOW_NOT_AVAILABLE - -#endif // LIBCURL_VERSION_NUM - - /** - * Using this option will reset CURLOPT_READFUNCTION to - * default callback. In fact, use only this option if you only - * want libcURL to use the FILE * given in argument instead - * of stdout. - */ - -#if LIBCURL_VERSION_NUM >= 0x070907 - template - Option; - template - Option; -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template - Option; - template - Option; -#endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - template - Option; - -#ifdef HAVE_BOOST - template - Option; -#endif - - template - Option; - -#ifdef HAVE_BOOST - template - Option; -#endif - - template - Option; - -#ifdef HAVE_BOOST - template - Option; -#endif - - template - Option; - -#ifdef HAVE_BOOST - template - Option; -#endif - - - /** - * Error options. - */ - - template - Option; - -#ifdef FILE - template - Option; -#endif - - template - Option; - - /** - * Network options. - */ - - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - - template - Option; - - /** - * Names and passwords options. - */ - - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - - /** - * HTTP options. - */ - - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option >; - template - Option >; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - - /** - * FTP options. - */ - - template - Option; - template - Option >; - template - Option >; - template - Option >; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - - /** - * Protocol options. - */ - - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - - /** - * Connection options. - */ - - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - - /** - * SSL and security options. - */ - - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - template - Option; - - /** - * Others options. - */ - - template - Option; - template - Option; - - //Share; - //TelnetOptions - -} diff --git a/src/curlpp/OptionBase.cpp b/src/curlpp/OptionBase.cpp index 1d82816..153ad1a 100644 --- a/src/curlpp/OptionBase.cpp +++ b/src/curlpp/OptionBase.cpp @@ -21,7 +21,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "curlpp/internal/global.h" #include "curlpp/OptionBase.hpp" diff --git a/src/curlpp/Options.cpp b/src/curlpp/Options.cpp index 21063d7..190ad33 100644 --- a/src/curlpp/Options.cpp +++ b/src/curlpp/Options.cpp @@ -21,7 +21,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "curlpp/internal/global.h" #include "curlpp/Options.hpp" #include "curlpp/Easy.hpp" @@ -35,7 +34,3 @@ std::ostream & operator<<(std::ostream & stream, const curlpp::options::Url & ur return stream; } - -#if defined(CURLPP_TEMPLATE_EXPLICIT_INSTANTIATION) - #include "./Options.ins" -#endif diff --git a/src/curlpp/Options.custom.ins b/src/curlpp/Options.custom.ins deleted file mode 100644 index 6d86e53..0000000 --- a/src/curlpp/Options.custom.ins +++ /dev/null @@ -1,37 +0,0 @@ -/** -* \file -* Custom (user) specializations of options with user types. -* -* IMPORTANT !!! -* Users should add explicit specializations for types -* they use in their applications when building library with -* SELF_CONTAINED set. Otherwise there will be linker errors when -* _using_ the library which has been built without these specializations. -* -*/ - -#include "curlpp/Options.hpp" - - -namespace curlpp -{ - - -namespace options -{ - - -/// Used in example11. - - typedef OptionTrait OptionsCustomType1; - -template -CURLPPAPI OptionsCustomType1; - -/// Add more here... - - -} // namespace options - - -} // namespace curlpp \ No newline at end of file diff --git a/src/curlpp/Options.ins b/src/curlpp/Options.ins deleted file mode 100644 index 8da7929..0000000 --- a/src/curlpp/Options.ins +++ /dev/null @@ -1,289 +0,0 @@ -#include "curlpp/Options.hpp" - -/* - * Use Find what: "typedef.*?\n?.*?\n?.*>\s*(.*);" regex and - * Replace with: "template $1;" regex - * to generate this file from Options.hpp header file. - */ - -namespace curlpp -{ - -namespace options -{ - - /** - * Cookie interface. - */ - -#if LIBCURL_VERSION_NUM >= 0x070d01 - template CookieList; -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template CookieList; -#endif -#endif - - /** - * Behavior options. - */ - - template Verbose; - template Header; - -#if LIBCURL_VERSION_NUM >= 0x070A00 - template NoSignal; -#else -#ifdef CURLPP_ALLOW_NOT_AVAILABLE - template NoSignal; -#endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - template NoProgress; - - /** - * Callback options. - */ - - template WriteFunctionCurlFunction; - - template WriteFunction; - -#ifdef HAVE_BOOST - template BoostWriteFunction; -#endif - - /** - * Using this option will reset CURLOPT_WRITEFUNCTION to - * default callback. In fact, use only this option if you only - * want libcURL to use the FILE * given in argument instead - * of stdout. - */ - -#if LIBCURL_VERSION_NUM >= 0x070907 - template WriteFile; - template WriteStream; -#else - #ifdef CURLPP_ALLOW_NOT_AVAILABLE - template WriteFile; - template WriteStream; - #endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - -#if LIBCURL_VERSION_NUM >= 0x070c01 - - template ReadFunctionCurlFunction; - - template ReadFunction; - - #ifdef HAVE_BOOST - template BoostReadFunction; - #endif - #else - #ifdef CURLPP_ALLOW_NOT_AVAILABLE - template ReadFunction; - #ifdef HAVE_BOOST - template BoostReadFunction; - #endif // HAVE_BOOST - #endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - /** - * Using this option will reset CURLOPT_READFUNCTION to - * default callback. In fact, use only this option if you only - * want libcURL to use the FILE * given in argument instead - * of stdout. - */ - -#if LIBCURL_VERSION_NUM >= 0x070907 - template ReadFile; - template ReadStream; -#else - #ifdef CURLPP_ALLOW_NOT_AVAILABLE - template ReadFile; - template ReadStream; - #endif // CURLPP_ALLOW_NOT_AVAILABLE -#endif // LIBCURL_VERSION_NUM - - template ProgressFunction; - -#ifdef HAVE_BOOST - template BoostProgressFunction; -#endif - - template HeaderFunction; - -#ifdef HAVE_BOOST - template BoostHeaderFunction; -#endif - - template DebugFunction; - -#ifdef HAVE_BOOST - template BoostDebugFunction; -#endif - - template SslCtxFunction; - -#ifdef HAVE_BOOST - template BoostSslCtxFunction; -#endif - - /** - * Error options. - */ - - template ErrorBuffer; - -#ifdef FILE - template StdErr; -#endif - - template FailOnError; - - - /** - * Network options. - */ - - template Url; - template Proxy; - template ProxyPort; - template ProxyType; - template HttpProxyTunnel; - template Interface; - template DnsCacheTimeout; - template DnsUseGlobalCache; - template BufferSize; - template Port; - - template TcpNoDelay; - - /** - * Names and passwords options. - */ - - template Netrc; - template NetrcFile; - template UserPwd; - template ProxyUserPwd; - template HttpAuth; - template ProxyAuth; - - /** - * HTTP options. - */ - - template AutoReferer; - template Encoding; - template FollowLocation; - template UnrestrictedAuth; - template MaxRedirs; - template Put; - template Upload; - template Post; - template PostFields; - template PostFieldSize; - template PostFieldSizeLarge; - template HttpPost; - template Referer; - template UserAgent; - template HttpHeader; - template Http200Aliases; - template Cookie; - template CookieFile; - template CookieJar; - template CookieSession; - template HttpGet; - template HttpVersion; - - /** - * FTP options. - */ - - template FtpPort; - template Quote; - template PostQuote; - template PreQuote; - template FtpListOnly; - template FtpAppend; - template FtpUseEpsv; - template FtpFileMethod; - template FtpCreateMissingDirs; - template FtpResponseTimeout; - template FtpSsl; - template FtpSslAuth; - - /** - * Protocol options. - */ - - template TransferText; - template Crlf; - template Range; - template ResumeFrom; - template ResumeFromLarge; - template CustomRequest; - template FileTime; - template NoBody; - template InfileSize; - template InfileSizeLarge; - template MaxFileSize; - template MaxFileSizeLarge; - template TimeCondition; - template TimeValue; - - /** - * Connection options. - */ - - template Timeout; - template LowSpeedLimit; - template LowSpeedTime; - template MaxConnects; - template ClosePolicy; - template FreshConnect; - template ForbidReuse; - template ConnectTimeout; - template IpResolve; - - /** - * SSL and security options. - */ - - template SslCert; - template SslCertType; - template SslCertPasswd; - template SslKey; - template SslKeyType; - template SslKeyPasswd; - template SslEngine; - template SslEngineDefault; - template SslVersion; - template SslVerifyPeer; - template CaInfo; - template CaPath; - template RandomFile; - template EgdSocket; - template SslVerifyHost; - template SslCipherList; - template Krb4Level; - - /** - * Others options. - */ - - template Private; - template Krb4Level; - - //Share; - //TelnetOptions - - -} // namespace options - - -} // namespace curlpp - -#include "./Options.custom.ins" \ No newline at end of file diff --git a/src/curlpp/autolink.h b/src/curlpp/autolink.h deleted file mode 100644 index fd804ef..0000000 --- a/src/curlpp/autolink.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) <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. - */ - -#ifndef __AUTOLINK__H_ -#define __AUTOLINK__H_ - -/* - * Auto-link feature on win32 supported compilers. Reading boost sources it seems - * that _MSC_VER definition does not guarantee a ms compiler. However this should - * not be a problem for autolink. - */ -#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) - - #if defined(_MSC_VER ) || defined(__INTEL_COMPILER) || defined(__ICL) || \ - defined(__ICC) || defined(__ECC) || defined(__MWERKS__) || defined(__BORLANDC__) - - #if defined(_DEBUG) || defined(DEBUG) - #pragma comment(lib, "libcurlppd.lib") - #else //DEBUG - #pragma comment(lib, "libcurlpp.lib") - #endif //DEBUG - - #endif //Supported compilers - -#endif //Windows - -#endif //__AUTOLINK__H_ diff --git a/src/curlpp/cURLpp.cpp b/src/curlpp/cURLpp.cpp index ec96a59..53ce7aa 100644 --- a/src/curlpp/cURLpp.cpp +++ b/src/curlpp/cURLpp.cpp @@ -1,8 +1,3 @@ -#include "utilspp/singleton/SingletonHolder.hpp" -#include "utilspp/singleton/CreationStatic.hpp" - -#include "curlpp/internal/global.h" - #include "curlpp/cURLpp.hpp" #include "curlpp/Exception.hpp" @@ -13,7 +8,7 @@ namespace { - struct libcURLInstance + struct libcURLInstance { libcURLInstance(); diff --git a/src/curlpp/internal/CMakeLists.txt b/src/curlpp/internal/CMakeLists.txt deleted file mode 100644 index 7f29f91..0000000 --- a/src/curlpp/internal/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - - -########### next target ############### - -set(internal_STAT_SRCS ${sources}) - -add_library(internal STATIC ${internal_STAT_SRCS}) - - -########### install files ############### - - - - -#original Makefile.am contents follow: - -#noinst_LTLIBRARIES = libinternal.la -#EXTRA_DIST = Makefile.msvc -# -#if MAINTENER_CODE -#maintener_source = -#endif -# -#INCLUDES = -I$(top_builddir)/include/curlpp -I$(top_builddir)/include/curlpp/internal -I$(top_builddir)/include -# -#sources = \ -# CurlHandle.cpp \ -# OptionList.cpp \ -# OptionSetter.cpp \ -# SList.cpp \ -# StorageOptions.hpp \ -# autolink.h \ -# ${maintener_source} -# -# -#libinternal_la_SOURCES = ${sources} -# -#VERSION=-version-info 0:2:0 -# -#AM_CXXFLAGS= -I../ -# -#if NO_UNDEFINED -## The -no-undefined flag is CRUCIAL for this to build fine on Cygwin. If we -## find a case in which we need to remove this flag, we should most likely -## write a configure check that detects when this flag is needed and when its -## not. -#libinternal_la_LDFLAGS = -no-undefined -Wno-inline-dllimport $(VERSION) -#else -#libinternal_la_LDFLAGS = $(VERSION) -#endif -# -# diff --git a/src/curlpp/internal/CurlHandle.cpp b/src/curlpp/internal/CurlHandle.cpp index 023e7f7..d29394f 100644 --- a/src/curlpp/internal/CurlHandle.cpp +++ b/src/curlpp/internal/CurlHandle.cpp @@ -21,7 +21,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "curlpp/internal/global.h" #include "curlpp/internal/CurlHandle.hpp" #include "curlpp/cURLpp.hpp" diff --git a/src/curlpp/internal/Makefile.am b/src/curlpp/internal/Makefile.am deleted file mode 100644 index 4698893..0000000 --- a/src/curlpp/internal/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -noinst_LTLIBRARIES = libinternal.la - -if MAINTENER_CODE -maintener_source = -endif - -AM_CPPFLAGS = -I$(top_builddir)/include/curlpp -I$(top_builddir)/include/curlpp/internal -I$(top_builddir)/include - -sources = \ - CurlHandle.cpp \ - OptionList.cpp \ - OptionSetter.cpp \ - SList.cpp \ - ${maintener_source} - - -libinternal_la_SOURCES = ${sources} - -VERSION=-version-info 0:2:0 - -AM_CXXFLAGS= -I../ - -if NO_UNDEFINED -# The -no-undefined flag is CRUCIAL for this to build fine on Cygwin. If we -# find a case in which we need to remove this flag, we should most likely -# write a configure check that detects when this flag is needed and when its -# not. -libinternal_la_LDFLAGS = -no-undefined -Wno-inline-dllimport $(VERSION) -else -libinternal_la_LDFLAGS = $(VERSION) -endif - - diff --git a/src/curlpp/internal/OptionList.cpp b/src/curlpp/internal/OptionList.cpp index ef9ecd8..b6f399f 100644 --- a/src/curlpp/internal/OptionList.cpp +++ b/src/curlpp/internal/OptionList.cpp @@ -21,7 +21,6 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "curlpp/internal/global.h" #include "curlpp/internal/OptionList.hpp" #include diff --git a/src/curlpp/internal/OptionSetter.cpp b/src/curlpp/internal/OptionSetter.cpp index e2be782..962d107 100644 --- a/src/curlpp/internal/OptionSetter.cpp +++ b/src/curlpp/internal/OptionSetter.cpp @@ -21,12 +21,9 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "curlpp/internal/global.h" #include "curlpp/internal/CurlHandle.hpp" #include "curlpp/internal/OptionSetter.hpp" -#include "utilspp/Functors.hpp" - #include #include diff --git a/src/curlpp/internal/SList.cpp b/src/curlpp/internal/SList.cpp index bdda998..f94b614 100644 --- a/src/curlpp/internal/SList.cpp +++ b/src/curlpp/internal/SList.cpp @@ -1,12 +1,6 @@ #include "curlpp/internal/SList.hpp" -#include "curlpp/internal/global.h" - -#if HAVE_OSTREAM -# include -#else -# include -#endif +#include #include diff --git a/src/utilspp/CMakeLists.txt b/src/utilspp/CMakeLists.txt deleted file mode 100644 index 48042ba..0000000 --- a/src/utilspp/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ - -include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) - -add_subdirectory(singleton) - - -########### next target ############### - -set(utilspp_STAT_SRCS - clone_ptr.hpp - EmptyType.hpp - Functors.hpp - NonCopyable.hpp - NullType.hpp - Singleton.hpp - SmartPtr.hpp - ThreadingFactoryMutex.hpp - ThreadingFactoryMutex.inl - ThreadingSingle.hpp - ThreadingSingle.inl - TypeList.hpp - TypeTrait.hpp) - -add_library(utilspp STATIC ${utilspp_STAT_SRCS}) - - -########### install files ############### - - - - -#original Makefile.am contents follow: - -#SUBDIRS = singleton -# -#noinst_LTLIBRARIES = libutilspp.la -# -#libutilspp_la_SOURCES = \ -# clone_ptr.hpp \ -# EmptyType.hpp \ -# Functors.hpp \ -# NonCopyable.hpp \ -# NullType.hpp \ -# Singleton.hpp \ -# SmartPtr.hpp \ -# ThreadingFactoryMutex.hpp ThreadingFactoryMutex.inl \ -# ThreadingSingle.hpp ThreadingSingle.inl \ -# TypeList.hpp \ -# TypeTrait.hpp -# -#libutilspp_la_LIBADD = ./singleton/libsingleton.la -# diff --git a/src/utilspp/LifetimeLibrary.cpp b/src/utilspp/LifetimeLibrary.cpp deleted file mode 100644 index a9a3e23..0000000 --- a/src/utilspp/LifetimeLibrary.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "utilspp/singleton/SingletonHolder.hpp" -#include "utilspp/singleton/LifetimeLibrary.hpp" - -utilspp::LifetimeLibraryImpl::LifetimeLibraryImpl() - : - mTrackerArray(NULL), - mNbElements(0) -{} - -utilspp::LifetimeLibraryImpl::~LifetimeLibraryImpl() -{ - terminate(); -} - -void -utilspp::LifetimeLibraryImpl::add(utilspp::PrivateMembers::LifetimeTracker * tracker) -{ - utilspp::PrivateMembers::TrackerArray newArray = static_cast< - utilspp::PrivateMembers::TrackerArray>(std::realloc(mTrackerArray, - mNbElements + 1)); - if(newArray == NULL) - { - throw std::bad_alloc(); - } - - mTrackerArray = newArray; - - utilspp::PrivateMembers::TrackerArray pos = - std::upper_bound(mTrackerArray, - mTrackerArray + mNbElements, - tracker, - &utilspp::PrivateMembers::LifetimeTracker::compare); - std::copy_backward(pos, - mTrackerArray + mNbElements, - mTrackerArray + mNbElements + 1); - - *pos = tracker; - mNbElements++; -}; - -void -utilspp::LifetimeLibraryImpl::terminate() -{ - //The number of elements MUST always be equal or over zero. - assert(mNbElements >= 0); - - while(mNbElements > 0) - { - //At this point the mTrackerArray MUST not be NULL. - assert(mTrackerArray != NULL); - - //Pick the element at the top of the stack. - utilspp::PrivateMembers::LifetimeTracker* top = - mTrackerArray[mNbElements - 1]; - - //Remove that object off the stack. - //Don't check errors-realloc with less memory, cause that can't fail. - mTrackerArray = - static_cast - (std::realloc(mTrackerArray, --mNbElements)); - - //Destroy the element. - delete top; - } -} - -unsigned int -utilspp::getLongevity(utilspp::LifetimeLibraryImpl *) -{ - return 0; -} - diff --git a/src/utilspp/Makefile.am b/src/utilspp/Makefile.am deleted file mode 100644 index 4be2e45..0000000 --- a/src/utilspp/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -lib_LTLIBRARIES = libutilspp.la - -AM_CPPFLAGS = -I$(top_builddir)/include - -libutilspp_la_SOURCES = \ - LifetimeLibrary.cpp \ - PrivateMembers.cpp - - diff --git a/src/utilspp/PrivateMembers.cpp b/src/utilspp/PrivateMembers.cpp deleted file mode 100644 index 2e42259..0000000 --- a/src/utilspp/PrivateMembers.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include - -#include "utilspp/singleton/PrivateMembers.hpp" - -utilspp::PrivateMembers::TrackerArray - utilspp::PrivateMembers::mTrackerArray = NULL; - -int utilspp::PrivateMembers::mNbElements = 0; - -utilspp::PrivateMembers::LifetimeTracker::LifetimeTracker( unsigned int - longevity ) -: -mLongevity(longevity) -{} - -utilspp::PrivateMembers::LifetimeTracker::~LifetimeTracker() -{} - -bool -utilspp::PrivateMembers::LifetimeTracker::compare( - const LifetimeTracker * l, - const LifetimeTracker * r - ) -{ - return l->mLongevity < r->mLongevity; -} - -void -utilspp::PrivateMembers::atExitFunc() -{ - assert((mTrackerArray != NULL) && - (mNbElements> 0)); - - //Pick the element at the top of the stack. - LifetimeTracker* top = mTrackerArray[mNbElements - 1]; - - //Remove that object off the stack. - //Don't check errors-realloc with less memory, cause that can't fail. - mTrackerArray = static_cast< - utilspp::PrivateMembers::TrackerArray>(std::realloc(mTrackerArray, - --mNbElements)); - - //Destroy the element. - delete top; -} - diff --git a/win32/create-vc-solution.bat b/win32/create-vc-solution.bat deleted file mode 100644 index 1e8f01d..0000000 --- a/win32/create-vc-solution.bat +++ /dev/null @@ -1,68 +0,0 @@ -@echo off - -set OUTPUT_DIR=.. - -REM VC_VERSION = 7.1 | 8 | 9 -REM 7.1 - MS Visual C++ 2003, 8 - MS Visual C++ 2005, 9 - MS Visual C++ 2008 -set VC_VERSION=%1 -set RESTORE=%2 - -if "%VC_VERSION%" == "" ( -@echo on -@echo Usage: -@echo create-vc-solution.bat vc_version [/restore] -@echo -@echo vc_version - Visual C++ version for the target solution and project files. Valid values are 8 and 9. -@echo ???please add doc for restore -pause -exit /b 1) - -if "%VC_VERSION%" == "7.1" ( -set VC_NAME=Visual Studio 2003 -set VC_FORMAT=??? -set SLN_FORMAT=??? -set PRJ_VERSION=??? -set VSPROPS_VERSION=???) - -if "%VC_VERSION%" == "8" ( -set MSVS_NAME=Visual Studio 2005 -set SLN_FORMAT=9.00 -set PRJ_VERSION=8,00 -set VSPROPS_VERSION=8.00) - -if "%VC_VERSION%" == "9" ( -set MSVS_NAME=Visual Studio 2008 -set SLN_FORMAT=10.00 -set PRJ_VERSION=9,00 -set VSPROPS_VERSION=8.00) - -REM curlpp solution -set FILE1=curlpp.sln -if "%RESTORE%" == "restore" ( -sed -T -e s/"%MSVS_NAME%"/MSVS_NAME/ -e s/"%SLN_FORMAT%"/SLN_FORMAT/ %OUTPUT_DIR%\%FILE1% > %FILE1%.stub ) else ( -sed -T -e s/MSVS_NAME/"%MSVS_NAME%"/ -e s/SLN_FORMAT/"%SLN_FORMAT%"/ %FILE1%.stub > %OUTPUT_DIR%\%FILE1%) - -REM curlpp.common -set FILE2=curlpp.common.vsprops -if "%RESTORE%" == "restore" ( -sed -T -e s/"%VSPROPS_VERSION%"/VSPROPS_VERSION/ %OUTPUT_DIR%\%FILE2% > %FILE2%.stub) else ( -sed -T -e s/VSPROPS_VERSION/"%VSPROPS_VERSION%"/ %FILE2%.stub > %OUTPUT_DIR%\%FILE2%) - -REM curlpp.lib -set FILE3=curlpp.lib.vcproj -set FILE3b=curlpp.lib.vsprops -if "%RESTORE%" == "restore" ( -sed -T -e s/"%PRJ_VERSION%"/PRJ_VERSION/ %OUTPUT_DIR%\%FILE3% > %FILE3%.stub -sed -T -e s/"%VSPROPS_VERSION%"/VSPROPS_VERSION/ %OUTPUT_DIR%\%FILE3b% > %FILE3b%.stub) else ( -sed -T -e s/PRJ_VERSION/"%PRJ_VERSION%"/ %FILE3%.stub > %OUTPUT_DIR%\%FILE3% -sed -T -e s/VSPROPS_VERSION/"%VSPROPS_VERSION%"/ %FILE3b%.stub > %OUTPUT_DIR%\%FILE3b%) - - -REM curlpp.examples -set FILE4=curlpp.examples.vcproj -set FILE4b=curlpp.examples.vsprops -if "%RESTORE%" == "restore" ( -sed -T -e s/"%PRJ_VERSION%"/PRJ_VERSION/ %OUTPUT_DIR%\%FILE4% > %FILE4%.stub -sed -T -e s/"%VSPROPS_VERSION%"/VSPROPS_VERSION/ %OUTPUT_DIR%\%FILE4b% > %FILE4b%.stub) else ( -sed -T -e s/PRJ_VERSION/"%PRJ_VERSION%"/ %FILE4%.stub > %OUTPUT_DIR%\%FILE4% -sed -T -e s/VSPROPS_VERSION/"%VSPROPS_VERSION%"/ %FILE4b%.stub > %OUTPUT_DIR%\%FILE4b%) diff --git a/win32/curlpp.common.vsprops.stub b/win32/curlpp.common.vsprops.stub deleted file mode 100644 index 49889d1..0000000 --- a/win32/curlpp.common.vsprops.stub +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - diff --git a/win32/curlpp.examples.vcproj.stub b/win32/curlpp.examples.vcproj.stub deleted file mode 100644 index fc0bceb..0000000 --- a/win32/curlpp.examples.vcproj.stub +++ /dev/null @@ -1,2099 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win32/curlpp.examples.vsprops.stub b/win32/curlpp.examples.vsprops.stub deleted file mode 100644 index 9ed8009..0000000 --- a/win32/curlpp.examples.vsprops.stub +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/win32/curlpp.lib.vcproj.stub b/win32/curlpp.lib.vcproj.stub deleted file mode 100644 index c55b825..0000000 --- a/win32/curlpp.lib.vcproj.stub +++ /dev/null @@ -1,1023 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win32/curlpp.lib.vsprops.stub b/win32/curlpp.lib.vsprops.stub deleted file mode 100644 index 2d33fe5..0000000 --- a/win32/curlpp.lib.vsprops.stub +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/win32/curlpp.sln.stub b/win32/curlpp.sln.stub deleted file mode 100644 index c19ae88..0000000 --- a/win32/curlpp.sln.stub +++ /dev/null @@ -1,59 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curlpp", "curlpp.VC9.vcproj", "{DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curlpp.examples", "curlpp.examples.VC9.vcproj", "{C351C533-3329-4782-A72D-28433330F6E3}" - ProjectSection(ProjectDependencies) = postProject - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087} = {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - DynamicLibDebugDynamicRTL|Win32 = DynamicLibDebugDynamicRTL|Win32 - DynamicLibDebugStaticRTL|Win32 = DynamicLibDebugStaticRTL|Win32 - DynamicLibReleaseDynamicRTL|Win32 = DynamicLibReleaseDynamicRTL|Win32 - DynamicLibReleaseStaticRTL|Win32 = DynamicLibReleaseStaticRTL|Win32 - StaticLibDebugDynamicRTL|Win32 = StaticLibDebugDynamicRTL|Win32 - StaticLibDebugStaticRTL|Win32 = StaticLibDebugStaticRTL|Win32 - StaticLibReleaseDynamicRTL|Win32 = StaticLibReleaseDynamicRTL|Win32 - StaticLibReleaseStaticRTL|Win32 = StaticLibReleaseStaticRTL|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DynamicLibDebugDynamicRTL|Win32.ActiveCfg = DynamicLibDebugDynamicRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DynamicLibDebugDynamicRTL|Win32.Build.0 = DynamicLibDebugDynamicRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DynamicLibDebugStaticRTL|Win32.ActiveCfg = DynamicLibDebugStaticRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DynamicLibDebugStaticRTL|Win32.Build.0 = DynamicLibDebugStaticRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DynamicLibReleaseDynamicRTL|Win32.ActiveCfg = DynamicLibReleaseDynamicRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DynamicLibReleaseDynamicRTL|Win32.Build.0 = DynamicLibReleaseDynamicRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DynamicLibReleaseStaticRTL|Win32.ActiveCfg = DynamicLibReleaseStaticRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.DynamicLibReleaseStaticRTL|Win32.Build.0 = DynamicLibReleaseStaticRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.StaticLibDebugDynamicRTL|Win32.ActiveCfg = StaticLibDebugDynamicRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.StaticLibDebugDynamicRTL|Win32.Build.0 = StaticLibDebugDynamicRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.StaticLibDebugStaticRTL|Win32.ActiveCfg = StaticLibDebugStaticRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.StaticLibDebugStaticRTL|Win32.Build.0 = StaticLibDebugStaticRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.StaticLibReleaseDynamicRTL|Win32.ActiveCfg = StaticLibReleaseDynamicRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.StaticLibReleaseDynamicRTL|Win32.Build.0 = StaticLibReleaseDynamicRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.StaticLibReleaseStaticRTL|Win32.ActiveCfg = StaticLibReleaseStaticRTL|Win32 - {DD2D30B5-B2CB-4DBC-9BA5-039F8CF7D087}.StaticLibReleaseStaticRTL|Win32.Build.0 = StaticLibReleaseStaticRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.DynamicLibDebugDynamicRTL|Win32.ActiveCfg = DynamicLibDebugDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.DynamicLibDebugDynamicRTL|Win32.Build.0 = DynamicLibDebugDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.DynamicLibDebugStaticRTL|Win32.ActiveCfg = DynamicLibDebugStaticRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.DynamicLibDebugStaticRTL|Win32.Build.0 = DynamicLibDebugStaticRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.DynamicLibReleaseDynamicRTL|Win32.ActiveCfg = DynamicLibReleaseDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.DynamicLibReleaseDynamicRTL|Win32.Build.0 = DynamicLibReleaseDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.DynamicLibReleaseStaticRTL|Win32.ActiveCfg = DynamicLibReleaseStaticRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.DynamicLibReleaseStaticRTL|Win32.Build.0 = DynamicLibReleaseStaticRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.StaticLibDebugDynamicRTL|Win32.ActiveCfg = StaticLibDebugDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.StaticLibDebugDynamicRTL|Win32.Build.0 = StaticLibDebugDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.StaticLibDebugStaticRTL|Win32.ActiveCfg = StaticLibReleaseDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.StaticLibDebugStaticRTL|Win32.Build.0 = StaticLibReleaseDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.StaticLibReleaseDynamicRTL|Win32.ActiveCfg = StaticLibReleaseDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.StaticLibReleaseDynamicRTL|Win32.Build.0 = StaticLibReleaseDynamicRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.StaticLibReleaseStaticRTL|Win32.ActiveCfg = StaticLibReleaseStaticRTL|Win32 - {C351C533-3329-4782-A72D-28433330F6E3}.StaticLibReleaseStaticRTL|Win32.Build.0 = StaticLibReleaseStaticRTL|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal