Merge branch 'qPCR4vir-hotfix-1.3' into hotfix-1.3
This commit is contained in:
commit
9eb940367a
200
CMakeLists.txt
200
CMakeLists.txt
@ -1,7 +1,8 @@
|
|||||||
# CMake configuration for Nana
|
# CMake configuration for Nana
|
||||||
# Author: Andrew Kornilov(https://github.com/ierofant)
|
# Author: Andrew Kornilov(https://github.com/ierofant)
|
||||||
# Contributor:
|
# Contributors:
|
||||||
# Robert Hauck - Enable support for PNG/Freetype
|
# Jinhao
|
||||||
|
# Robert Hauck - Enable support for PNG/Freetype
|
||||||
# Qiangqiang Wu - Add biicode support
|
# Qiangqiang Wu - Add biicode support
|
||||||
# Ariel Vina-Rodriguez (qPCR4vir)
|
# Ariel Vina-Rodriguez (qPCR4vir)
|
||||||
|
|
||||||
@ -9,6 +10,7 @@
|
|||||||
#https://cmake.org/cmake/help/v3.3/module/CMakeDependentOption.html?highlight=cmakedependentoption
|
#https://cmake.org/cmake/help/v3.3/module/CMakeDependentOption.html?highlight=cmakedependentoption
|
||||||
# use CACHE FORCE or set(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ ON) or delete CMakecache.txt or the entirely build dir
|
# use CACHE FORCE or set(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ ON) or delete CMakecache.txt or the entirely build dir
|
||||||
# if your changes don't execute
|
# if your changes don't execute
|
||||||
|
|
||||||
option(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ "replaced boost.thread with meganz's mingw-std-threads." OFF)
|
option(ENABLE_MINGW_STD_THREADS_WITH_MEGANZ "replaced boost.thread with meganz's mingw-std-threads." OFF)
|
||||||
option(ENABLE_PNG "Enable the use of PNG" OFF)
|
option(ENABLE_PNG "Enable the use of PNG" OFF)
|
||||||
option(LIBPNG_FROM_OS "Use libpng from operating system." ON)
|
option(LIBPNG_FROM_OS "Use libpng from operating system." ON)
|
||||||
@ -18,6 +20,7 @@ option(ENABLE_AUDIO "Enable class audio::play for PCM playback." OFF)
|
|||||||
option(CMAKE_VERBOSE_PREPROCESSOR "Show annoying debug messages during compilation." OFF)
|
option(CMAKE_VERBOSE_PREPROCESSOR "Show annoying debug messages during compilation." OFF)
|
||||||
option(CMAKE_STOP_VERBOSE_PREPROCESSOR "Stop compilation after showing the annoying debug messages." ON)
|
option(CMAKE_STOP_VERBOSE_PREPROCESSOR "Stop compilation after showing the annoying debug messages." ON)
|
||||||
option(BUILD_NANA_DEMOS "Build all the demos form the nana_demo repository." OFF)
|
option(BUILD_NANA_DEMOS "Build all the demos form the nana_demo repository." OFF)
|
||||||
|
|
||||||
# The ISO C++ File System Technical Specification is optional.
|
# The ISO C++ File System Technical Specification is optional.
|
||||||
# http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf
|
# http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf
|
||||||
# This is not a workaround, but an user option.
|
# This is not a workaround, but an user option.
|
||||||
@ -143,7 +146,6 @@ if(ENABLE_AUDIO)
|
|||||||
endif(UNIX)
|
endif(UNIX)
|
||||||
endif(ENABLE_AUDIO)
|
endif(ENABLE_AUDIO)
|
||||||
|
|
||||||
#Unicode
|
|
||||||
if(CMAKE_VERBOSE_PREPROCESSOR)
|
if(CMAKE_VERBOSE_PREPROCESSOR)
|
||||||
add_definitions(-DVERBOSE_PREPROCESSOR)
|
add_definitions(-DVERBOSE_PREPROCESSOR)
|
||||||
endif(CMAKE_VERBOSE_PREPROCESSOR)
|
endif(CMAKE_VERBOSE_PREPROCESSOR)
|
||||||
@ -186,185 +188,52 @@ add_library(${PROJECT_NAME} ${NANA_SOURCE}
|
|||||||
${NANA_SYSTEM_SOURCE}
|
${NANA_SYSTEM_SOURCE}
|
||||||
${NANA_THREADS_SOURCE})
|
${NANA_THREADS_SOURCE})
|
||||||
|
|
||||||
#Headers: use INCLUDE_DIRECTORIES
|
# Headers: use INCLUDE_DIRECTORIES
|
||||||
# Libraries: use FIND_LIBRARY and link with the result of it (try to avoid LINK_DIRECTORIES
|
# Libraries: use FIND_LIBRARY and link with the result of it (try to avoid LINK_DIRECTORIES)
|
||||||
target_link_libraries(${PROJECT_NAME} ${NANA_LINKS})
|
target_link_libraries(${PROJECT_NAME} ${NANA_LINKS})
|
||||||
|
|
||||||
|
|
||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${PROJECT_NAME}
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
LIBRARY DESTINATION lib)
|
LIBRARY DESTINATION lib)
|
||||||
# ??
|
|
||||||
install(DIRECTORY ${NANA_INCLUDE_DIR}/nana DESTINATION include)
|
|
||||||
|
|
||||||
set_property( TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14 )
|
set_property( TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14 )
|
||||||
|
|
||||||
|
|
||||||
# TODO: move this nana-demo section to the nana demo repository, and here only include that cmake file
|
# TODO: move this nana-demo section to the nana demo repository, and here only include that cmake file
|
||||||
|
|
||||||
if (BUILD_NANA_DEMOS)
|
if (BUILD_NANA_DEMOS)
|
||||||
set (CMAKE_INSTALL_PREFIX ${DEMO_BIN})
|
|
||||||
set(DEMO_BIN ${NANA_SOURCE_DIR}../nana-demo/bin)
|
|
||||||
set(CMAKE_INSTALL_PREFIX )
|
|
||||||
|
|
||||||
add_executable(calculator ../nana-demo/calculator.cpp)
|
|
||||||
set_property( TARGET calculator PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(calculator ${PROJECT_NAME} )
|
|
||||||
install(TARGETS calculator RUNTIME DESTINATION &{DEMO_BIN})
|
|
||||||
|
|
||||||
if (BUILD_FreeMe)
|
set (demos calculator notepad widget_show widget_show2 )
|
||||||
add_executable(FreeMe ../nana-demo/FreeMe.cpp)
|
# Pending: file_explorer FreeMe
|
||||||
set_property( TARGET FreeMe PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(FreeMe ${PROJECT_NAME} )
|
|
||||||
install(TARGETS FreeMe RUNTIME DESTINATION &{DEMO_BIN})
|
|
||||||
endif (BUILD_FreeMe)
|
|
||||||
|
|
||||||
add_executable(notepad ../nana-demo/notepad.cpp)
|
foreach ( demo ${demos})
|
||||||
set_property( TARGET notepad PROPERTY CXX_STANDARD 14 )
|
add_executable(${demo} "../nana-demo/${demo}.cpp")
|
||||||
target_link_libraries(notepad ${PROJECT_NAME} )
|
set_property( TARGET ${demo} PROPERTY CXX_STANDARD 14 )
|
||||||
install(TARGETS notepad RUNTIME DESTINATION &{DEMO_BIN})
|
target_link_libraries(${demo} ${PROJECT_NAME})
|
||||||
|
install(TARGETS ${demo} RUNTIME DESTINATION "../nana-demo/")
|
||||||
|
message("... to build: ../nana-demo/${demo}.cpp" )
|
||||||
|
endforeach( demo ${demos})
|
||||||
|
|
||||||
add_executable(widget_show ../nana-demo/widget_show.cpp)
|
|
||||||
set_property( TARGET widget_show PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(widget_show ${PROJECT_NAME})
|
|
||||||
install(TARGETS widget_show RUNTIME DESTINATION &{DEMO_BIN})
|
|
||||||
|
|
||||||
add_executable(widget_show2 ../nana-demo/widget_show2.cpp)
|
set (demos a_group_impl animate-bmp audio_player audio_player_simple background-effects categ clicked
|
||||||
set_property( TARGET widget_show2 PROPERTY CXX_STANDARD 14 )
|
decore dock drag-button draw example.button example_combox example_listbox example_menu
|
||||||
target_link_libraries(widget_show2 ${PROJECT_NAME})
|
filebox-txt folder_tree folder_tree_nana folder_tree_std framework_design_1 framework_design_2 framework_design_3
|
||||||
install(TARGETS widget_show2 RUNTIME DESTINATION &{DEMO_BIN})
|
group HelloWord helloword_quit inputbox label_listener lambda_event.Cpp11 listbox_inline_widget listbox_Resolver loader_1 loader_2
|
||||||
|
mbox menu_debug menu_popuper modal_form MontiHall place_login png screen stretch_image
|
||||||
|
threading thread-pool various_events window-dragger windows-subclassing
|
||||||
|
)
|
||||||
|
# Pending:
|
||||||
|
|
||||||
|
foreach ( demo ${demos})
|
||||||
|
add_executable(${demo} "../nana-demo/Examples/${demo}.cpp")
|
||||||
|
set_property( TARGET ${demo} PROPERTY CXX_STANDARD 14 )
|
||||||
|
target_link_libraries(${demo} ${PROJECT_NAME})
|
||||||
|
install(TARGETS ${demo} RUNTIME DESTINATION "../nana-demo/Examples/")
|
||||||
|
|
||||||
if (OFF) # temporal: we need to adapt the use of filesystem to nana v1.03 (no file iterator)
|
message("... to build: ../nana-demo/Examples/${demo}.cpp" )
|
||||||
|
endforeach( demo ${demos})
|
||||||
|
|
||||||
add_executable(file_explorer ../nana-demo/file_explorer.cpp)
|
endif (BUILD_NANA_DEMOS)
|
||||||
set_property( TARGET file_explorer PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(file_explorer ${PROJECT_NAME} )
|
|
||||||
install(TARGETS file_explorer RUNTIME DESTINATION &{DEMO_BIN})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
endif(OFF)
|
|
||||||
|
|
||||||
add_executable(a_group_impl ../nana-demo/Examples/a_group_impl.cpp)
|
|
||||||
set_property( TARGET a_group_impl PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(a_group_impl ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(animate-bmp ../nana-demo/Examples/animate-bmp.cpp)
|
|
||||||
set_property( TARGET animate-bmp PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(animate-bmp ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(background-effects ../nana-demo/Examples/background-effects.cpp)
|
|
||||||
set_property( TARGET background-effects PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(background-effects ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(categ ../nana-demo/Examples/categ.cpp)
|
|
||||||
set_property( TARGET categ PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(categ ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(clicked ../nana-demo/Examples/clicked.cpp)
|
|
||||||
set_property( TARGET clicked PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(clicked ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(decore ../nana-demo/Examples/decore.cpp)
|
|
||||||
set_property( TARGET decore PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(decore ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(dock ../nana-demo/Examples/dock.cpp)
|
|
||||||
set_property( TARGET dock PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(dock ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(drag-button ../nana-demo/Examples/drag-button.cpp)
|
|
||||||
set_property( TARGET drag-button PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(drag-button ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(draw ../nana-demo/Examples/draw.cpp)
|
|
||||||
set_property( TARGET draw PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(draw ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(example_combox ../nana-demo/Examples/example_combox.cpp)
|
|
||||||
set_property( TARGET example_combox PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(example_combox ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(example_listbox ../nana-demo/Examples/example_listbox.cpp)
|
|
||||||
set_property( TARGET example_listbox PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(example_listbox ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(example_menu ../nana-demo/Examples/example_menu.cpp)
|
|
||||||
set_property( TARGET example_menu PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(example_menu ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(filebox-txt ../nana-demo/Examples/filebox-txt.cpp)
|
|
||||||
set_property( TARGET filebox-txt PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(filebox-txt ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(folder_tree ../nana-demo/Examples/folder_tree.cpp)
|
|
||||||
set_property( TARGET folder_tree PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(folder_tree ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(folder_tree_nana ../nana-demo/Examples/folder_tree_nana.cpp)
|
|
||||||
set_property( TARGET folder_tree_nana PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(folder_tree_nana ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(folder_tree_std ../nana-demo/Examples/folder_tree_std.cpp)
|
|
||||||
set_property( TARGET folder_tree_std PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(folder_tree_std ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(listbox_Resolver ../nana-demo/Examples/listbox_Resolver.cpp)
|
|
||||||
set_property( TARGET listbox_Resolver PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(listbox_Resolver ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(framework_design_2 ../nana-demo/Examples/framework_design_2.cpp)
|
|
||||||
set_property( TARGET framework_design_2 PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(framework_design_2 ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(framework_design_3 ../nana-demo/Examples/framework_design_3.cpp)
|
|
||||||
set_property( TARGET framework_design_3 PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(framework_design_3 ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(group ../nana-demo/Examples/group.cpp)
|
|
||||||
set_property( TARGET group PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(group ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(HelloWord ../nana-demo/Examples/HelloWord.cpp)
|
|
||||||
set_property( TARGET HelloWord PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(HelloWord ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(listbox_inline_widget ../nana-demo/Examples/listbox_inline_widget.cpp)
|
|
||||||
set_property( TARGET listbox_inline_widget PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(listbox_inline_widget ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(inputbox ../nana-demo/Examples/inputbox.cpp)
|
|
||||||
set_property( TARGET inputbox PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(inputbox ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(label_listener ../nana-demo/Examples/label_listener.cpp)
|
|
||||||
set_property( TARGET label_listener PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(label_listener ${PROJECT_NAME})
|
|
||||||
|
|
||||||
add_executable(lambda_event.Cpp11 ../nana-demo/Examples/lambda_event.Cpp11.cpp)
|
|
||||||
set_property( TARGET lambda_event.Cpp11 PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(lambda_event.Cpp11 ${PROJECT_NAME})
|
|
||||||
|
|
||||||
if (ENABLE_AUDIO)
|
|
||||||
add_executable(audio_player ../nana-demo/Examples/audio_player.cpp)
|
|
||||||
set_property( TARGET audio_player PROPERTY CXX_STANDARD 14 )
|
|
||||||
target_link_libraries(audio_player ${PROJECT_NAME} )
|
|
||||||
endif(ENABLE_AUDIO)
|
|
||||||
|
|
||||||
# TODO: make it automatic to select each demo and example and build each.
|
|
||||||
#set(NANA_DEMOS_DIR ${CMAKE_SOURCE_DIR}/../nana-demo)
|
|
||||||
#set(NANA_EXAMPLES_DIR ${CMAKE_SOURCE_DIR}/../Examples/nana-demo/)
|
|
||||||
# https://cmake.org/cmake/help/v3.3/command/file.html?highlight=glob#file
|
|
||||||
#file( GLOB_RECURSE DEMO_SOURCES RELATIVE ../nana-demo *.cpp )
|
|
||||||
|
|
||||||
#foreach( demofile ${DEMO_SOURCES} )
|
|
||||||
# string( REPLACE ".cpp" "" demoname ${demofile} )
|
|
||||||
# add_executable( ${demoname} ${demofile} )
|
|
||||||
# set_property( TARGET ${demoname} PROPERTY CXX_STANDARD 14 )
|
|
||||||
# target_link_libraries(${demoname} ${PROJECT_NAME} )# X11 Xft ${NANA_JPEG_LIB} ${NANA_PNG_LIB})
|
|
||||||
#endforeach( demofile ${DEMO_SOURCES} )
|
|
||||||
|
|
||||||
endif(BUILD_NANA_DEMOS)
|
|
||||||
|
|
||||||
|
|
||||||
# set compile flags
|
# set compile flags
|
||||||
@ -395,3 +264,4 @@ message ( "CMAKE_COMPILER_IS_GNUCXX= " ${CMAKE_COMPILER_IS_GNUCXX})
|
|||||||
message ( "CMAKE_EXE_LINKER_FLAGS = " ${CMAKE_EXE_LINKER_FLAGS})
|
message ( "CMAKE_EXE_LINKER_FLAGS = " ${CMAKE_EXE_LINKER_FLAGS})
|
||||||
message ( "NANA_LINKS = " ${NANA_LINKS})
|
message ( "NANA_LINKS = " ${NANA_LINKS})
|
||||||
message ( "ENABLE_AUDIO = " ${ENABLE_AUDIO})
|
message ( "ENABLE_AUDIO = " ${ENABLE_AUDIO})
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Nana C++ Library
|
# Nana C++ Library
|
||||||
[Linux (gcc 5, including demos) ](https://travis-ci.org/cnjinhao/nana)
|
[Linux (gcc 5.2.1 and 4.9.2)](https://travis-ci.org/cnjinhao/nana) including [(nana-demos)](https://github.com/qPCR4vir/nana-demo)
|
||||||
|
|
||||||
[Windows (VC2015) ](https://ci.appveyor.com/project/qPCR4vir/nana)
|
[Windows (Microsoft (R) Build Engine version 14.0.24720.0) ](https://ci.appveyor.com/project/qPCR4vir/nana)
|
||||||
|
|
||||||
[](LICENSE_1_0.txt)
|
[](LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
|||||||
@ -249,6 +249,9 @@
|
|||||||
<ClCompile Include="..\..\source\threads\pool.cpp" />
|
<ClCompile Include="..\..\source\threads\pool.cpp" />
|
||||||
<ClCompile Include="..\..\source\unicode_bidi.cpp" />
|
<ClCompile Include="..\..\source\unicode_bidi.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\include\nana\filesystem\filesystem_selector.hpp" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
|||||||
@ -49,6 +49,9 @@
|
|||||||
<Filter Include="Source Files\paint\detail">
|
<Filter Include="Source Files\paint\detail">
|
||||||
<UniqueIdentifier>{53feb93f-2b86-4bf5-b2f3-f60ef1bbbf76}</UniqueIdentifier>
|
<UniqueIdentifier>{53feb93f-2b86-4bf5-b2f3-f60ef1bbbf76}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Header Files\filesystem">
|
||||||
|
<UniqueIdentifier>{6caffbf6-c023-4dbf-ba69-cdb49feddb5d}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\source\any.cpp">
|
<ClCompile Include="..\..\source\any.cpp">
|
||||||
@ -280,4 +283,9 @@
|
|||||||
<Filter>Source Files\gui\detail</Filter>
|
<Filter>Source Files\gui\detail</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\include\nana\filesystem\filesystem_selector.hpp">
|
||||||
|
<Filter>Header Files\filesystem</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@ -40,18 +40,14 @@
|
|||||||
|
|
||||||
#include <nana/deploy.hpp>
|
#include <nana/deploy.hpp>
|
||||||
|
|
||||||
// namespace std { namespace experimental { namespace filesystem { inline namespace v1 {
|
namespace nana { namespace experimental { namespace filesystem
|
||||||
|
|
||||||
namespace nana { namespace experimental {
|
|
||||||
|
|
||||||
#ifndef CXX_NO_INLINE_NAMESPACE
|
|
||||||
inline namespace v1
|
|
||||||
{
|
{
|
||||||
|
#ifndef CXX_NO_INLINE_NAMESPACE
|
||||||
|
inline namespace v1
|
||||||
|
{
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace filesystem
|
enum class file_type
|
||||||
{
|
|
||||||
enum class file_type
|
|
||||||
{
|
{
|
||||||
none = 0, ///< has not been determined or an error occurred while trying to determine
|
none = 0, ///< has not been determined or an error occurred while trying to determine
|
||||||
not_found = -1, ///< Pseudo-type: file was not found. Is not considered an error
|
not_found = -1, ///< Pseudo-type: file was not found. Is not considered an error
|
||||||
|
|||||||
44
include/nana/filesystem/filesystem_ext.hpp
Normal file
44
include/nana/filesystem/filesystem_ext.hpp
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* Nana C++ Library(http://www.nanapro.org)
|
||||||
|
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
|
||||||
|
*
|
||||||
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*
|
||||||
|
* @file nana\filesystem\filesystem_ext.hpp
|
||||||
|
* @autor by Ariel Vina-Rodriguez:
|
||||||
|
* @brief Some convenient extensions to the filesystem library.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NANA_FILESYSTEM_EXT_HPP
|
||||||
|
#define NANA_FILESYSTEM_EXT_HPP
|
||||||
|
|
||||||
|
namespace nana {namespace experimental {namespace filesystem {namespace ext {
|
||||||
|
#if defined(NANA_WINDOWS)
|
||||||
|
constexpr auto def_root = "C:";
|
||||||
|
constexpr auto def_rootstr = "C:\\";
|
||||||
|
constexpr auto def_rootname = "Local Drive(C:)";
|
||||||
|
#elif defined(NANA_LINUX)
|
||||||
|
constexpr auto def_root = "/";
|
||||||
|
constexpr auto def_rootstr = "/";
|
||||||
|
constexpr auto def_rootname = "Root/";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// nana::experimental::filesystem::path_user()); // REPLACE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! to filesystem_ext.hhp
|
||||||
|
|
||||||
|
template<class DI> // DI = directory_iterator from std, boost, or nana
|
||||||
|
class directory_only_iterator : public DI
|
||||||
|
{
|
||||||
|
// if (!this->is_directory()) continue;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class DI> // DI = directory_iterator from std, boost, or nana
|
||||||
|
class regular_file_only_iterator : public DI
|
||||||
|
{
|
||||||
|
// if (this->is_directory()) continue;
|
||||||
|
};
|
||||||
|
|
||||||
|
}}}}
|
||||||
|
#endif //NANA_FILESYSTEM_EXT_HPP
|
||||||
83
include/nana/filesystem/filesystem_selector.hpp
Normal file
83
include/nana/filesystem/filesystem_selector.hpp
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/**
|
||||||
|
* Nana C++ Library(http://www.nanapro.org)
|
||||||
|
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
|
||||||
|
*
|
||||||
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*
|
||||||
|
* @file nana\filesystem\filesystem_selector.hpp
|
||||||
|
* @autor by Ariel Vina-Rodriguez:
|
||||||
|
* @brief A "ISO C++" filesystem Implementation selector
|
||||||
|
* The ISO C++ File System Technical Specification is optional.
|
||||||
|
* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf
|
||||||
|
* This is not a workaround, but an user option.
|
||||||
|
* The library maybe available in the std library in use or from Boost (almost compatible)
|
||||||
|
* http://www.boost.org/doc/libs/1_60_0/libs/filesystem/doc/index.htm
|
||||||
|
* or you can choose to use the (partial, but functional) implementation provided by nana.
|
||||||
|
* If you include the file <nana/filesystem/filesystem_selector.hpp>
|
||||||
|
* The selected option will be set by nana into std::experimental::filesystem
|
||||||
|
* By default Nana will use the ISO TS if available, or nana if not.
|
||||||
|
* Boost will be use only if explicitily changed
|
||||||
|
* nana Now mimic std::experimental::filesystem::v1 (boost v3)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NANA_FILESYSTEM_SELECTOR
|
||||||
|
#define NANA_FILESYSTEM_SELECTOR
|
||||||
|
|
||||||
|
#include <nana/config.hpp>
|
||||||
|
|
||||||
|
#if defined(NANA_BOOST_FILESYSTEM_AVAILABLE) && ( defined(NANA_BOOST_FILESYSTEM_FORCE) || (defined(STD_FILESYSTEM_NOT_SUPPORTED) && defined(NANA_BOOST_FILESYSTEM_PREFERRED) ) )
|
||||||
|
|
||||||
|
# include <boost/filesystem.hpp>
|
||||||
|
|
||||||
|
// add boost::filesystem into std::experimental::filesystem
|
||||||
|
namespace std {
|
||||||
|
namespace experimental {
|
||||||
|
namespace filesystem {
|
||||||
|
|
||||||
|
# ifdef CXX_NO_INLINE_NAMESPACE
|
||||||
|
using namespace boost::experimental::filesystem;
|
||||||
|
# else
|
||||||
|
using namespace boost::experimental::filesystem::v3;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
} // filesystem
|
||||||
|
} // experimental
|
||||||
|
} // std
|
||||||
|
|
||||||
|
|
||||||
|
#elif defined(STD_FILESYSTEM_NOT_SUPPORTED)
|
||||||
|
|
||||||
|
# include <nana/filesystem/filesystem.hpp>
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
namespace experimental {
|
||||||
|
namespace filesystem {
|
||||||
|
|
||||||
|
# ifdef CXX_NO_INLINE_NAMESPACE
|
||||||
|
using namespace nana::experimental::filesystem;
|
||||||
|
# else
|
||||||
|
using namespace nana::experimental::filesystem::v1;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
} // filesystem
|
||||||
|
} // experimental
|
||||||
|
} // std
|
||||||
|
|
||||||
|
#else
|
||||||
|
# include <filesystem>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __cpp_lib_experimental_filesystem
|
||||||
|
# define __cpp_lib_experimental_filesystem 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif // NANA_FILESYSTEM_SELECTOR
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -37,12 +37,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace nana { namespace experimental {
|
namespace nana { namespace experimental { namespace filesystem
|
||||||
#ifndef CXX_NO_INLINE_NAMESPACE
|
|
||||||
inline namespace v1 {
|
|
||||||
#endif
|
|
||||||
namespace filesystem
|
|
||||||
{
|
{
|
||||||
|
#ifndef CXX_NO_INLINE_NAMESPACE
|
||||||
|
inline namespace v1 {
|
||||||
|
#endif
|
||||||
|
|
||||||
//class filesystem_error
|
//class filesystem_error
|
||||||
filesystem_error::filesystem_error(const std::string& msg, std::error_code err)
|
filesystem_error::filesystem_error(const std::string& msg, std::error_code err)
|
||||||
: std::system_error(err, msg)
|
: std::system_error(err, msg)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user