FIX crash in VS consistently using filesysten_ext
This commit is contained in:
@@ -59,6 +59,7 @@
|
||||
|
||||
# define constexpr const //no support of constexpr until Visual C++ 2015 ? const ??
|
||||
# endif
|
||||
# undef STD_FILESYSTEM_NOT_SUPPORTED
|
||||
#elif defined(__GNUC__)
|
||||
# if (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
|
||||
# define noexcept //no support of noexcept until GCC 4.6
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
#ifndef NANA_FILESYSTEM_HPP
|
||||
#define NANA_FILESYSTEM_HPP
|
||||
|
||||
//#undef NANA_USING_NANA_FILESYSTEM
|
||||
#if NANA_USING_NANA_FILESYSTEM
|
||||
|
||||
#include <nana/push_ignore_diagnostic>
|
||||
|
||||
#include <string>
|
||||
@@ -233,18 +236,18 @@ namespace nana { namespace experimental { namespace filesystem
|
||||
{
|
||||
public:
|
||||
directory_entry() = default;
|
||||
explicit directory_entry(const path&);
|
||||
explicit directory_entry(const ::nana::experimental::filesystem::path&);
|
||||
|
||||
//modifiers
|
||||
void assign(const path&);
|
||||
void replace_filename(const path&);
|
||||
void assign(const ::nana::experimental::filesystem::path&);
|
||||
void replace_filename(const ::nana::experimental::filesystem::path&);
|
||||
|
||||
//observers
|
||||
file_status status() const;
|
||||
operator const path&() const { return path_; };
|
||||
const path& path() const;
|
||||
operator const filesystem::path&() const { return path_; };
|
||||
const filesystem::path& path() const;
|
||||
private:
|
||||
filesystem::path path_;
|
||||
::nana::experimental::filesystem::path path_;
|
||||
};
|
||||
|
||||
/// InputIterator that iterate over the sequence of directory_entry elements representing the files in a directory, not an recursive_directory_iterator
|
||||
@@ -414,3 +417,4 @@ namespace nana { namespace experimental { namespace filesystem
|
||||
|
||||
#include <nana/pop_ignore_diagnostic>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
#ifndef NANA_FILESYSTEM_EXT_HPP
|
||||
#define NANA_FILESYSTEM_EXT_HPP
|
||||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
|
||||
#include <nana/filesystem/filesystem_selector.hpp>
|
||||
|
||||
namespace nana
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#if (defined(NANA_FILESYSTEM_FORCE) || ( (defined(STD_FILESYSTEM_NOT_SUPPORTED) && !defined(BOOST_FILESYSTEM_AVAILABLE)) && !(defined(BOOST_FILESYSTEM_FORCE) || defined(STD_FILESYSTEM_FORCE)) ) )
|
||||
|
||||
#undef NANA_USING_NANA_FILESYSTEM
|
||||
#define NANA_USING_NANA_FILESYSTEM true
|
||||
# include <nana/filesystem/filesystem.hpp>
|
||||
|
||||
namespace std {
|
||||
@@ -46,14 +48,14 @@ namespace std {
|
||||
# else
|
||||
using namespace nana::experimental::filesystem::v1;
|
||||
# endif
|
||||
#undef NANA_USING_NANA_FILESYSTEM
|
||||
#define NANA_USING_NANA_FILESYSTEM true
|
||||
} // filesystem
|
||||
} // experimental
|
||||
} // std
|
||||
|
||||
#elif (defined(BOOST_FILESYSTEM_AVAILABLE) && ( defined(BOOST_FILESYSTEM_FORCE) || ( defined(STD_FILESYSTEM_NOT_SUPPORTED) && !defined(STD_FILESYSTEM_FORCE) ) ))
|
||||
|
||||
#undef NANA_USING_BOOST_FILESYSTEM
|
||||
#define NANA_USING_BOOST_FILESYSTEM true
|
||||
# include <boost/filesystem.hpp>
|
||||
|
||||
// add boost::filesystem into std::experimental::filesystem
|
||||
@@ -61,17 +63,15 @@ namespace std {
|
||||
namespace experimental {
|
||||
namespace filesystem {
|
||||
using namespace boost::filesystem;
|
||||
#undef NANA_USING_BOOST_FILESYSTEM
|
||||
#define NANA_USING_BOOST_FILESYSTEM true
|
||||
} // filesystem
|
||||
} // experimental
|
||||
} // std
|
||||
|
||||
#else
|
||||
|
||||
# include <experimental/filesystem>
|
||||
#undef NANA_USING_STD_FILESYSTEM
|
||||
#define NANA_USING_STD_FILESYSTEM true
|
||||
# include <experimental/filesystem>
|
||||
#endif
|
||||
|
||||
#ifndef __cpp_lib_experimental_filesystem
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
* Filebox
|
||||
* Nana C++ Library(http://www.nanapro.org)
|
||||
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com)
|
||||
@@ -7,7 +7,9 @@
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* @file: nana/gui/filebox.hpp
|
||||
* @file nana/gui/filebox.hpp
|
||||
* @author Jinhao
|
||||
* @brief a dialog to chose file(s), implemented "native" in windows but using nana for X11
|
||||
*/
|
||||
|
||||
#ifndef NANA_GUI_FILEBOX_HPP
|
||||
@@ -37,18 +39,20 @@ namespace nana
|
||||
/// Change owner window
|
||||
void owner(window);
|
||||
|
||||
/// specify a title for the dialog
|
||||
/// Set a new title for the dialog
|
||||
/// @param string a text for title
|
||||
/// @return old title.
|
||||
::std::string title( ::std::string new_title); ///< . Set a new title for the dialog and \return the old title
|
||||
/// @return the old title.
|
||||
::std::string title( ::std::string new_title);
|
||||
|
||||
/** @brief specify a suggestion directory
|
||||
* @param string a path of initial directory
|
||||
/** @brief Suggest initial path used to locate a directory when the filebox starts.
|
||||
* @param string initial_directory a path of initial directory
|
||||
* @note the behavior of init_path is different between Win7 and Win2K/XP/Vista, but its behavior under Linux is conformed with Win7.
|
||||
*/
|
||||
filebox& init_path(const ::std::string&); ///< Suggested init path used to locate a directory when the filebox starts.
|
||||
filebox& init_path(const ::std::string& initial_directory);
|
||||
|
||||
filebox& init_file(const ::std::string&); ///< Init file, if it contains a path, the init path is replaced by the path of init file.
|
||||
/// \brief Add a filetype filter.
|
||||
|
||||
/// \brief Add a filetype filter.
|
||||
/// To specify multiple filter in a single description, use a semicolon to separate the patterns(for example,"*.TXT;*.DOC;*.BAK").
|
||||
filebox& add_filter(const ::std::string& description, ///< for example. "Text File"
|
||||
const ::std::string& filetype ///< filter pattern(for example, "*.TXT")
|
||||
@@ -68,8 +72,7 @@ namespace nana
|
||||
/// Display the filebox dialog
|
||||
bool show() const;
|
||||
|
||||
/// Display the filebox dialog
|
||||
/// A function object method alternative to show()
|
||||
/// a function object method alternative to show() to display the filebox dialog,
|
||||
bool operator()() const
|
||||
{
|
||||
return show();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define NANA_PAINT_DETAIL_IMAGE_IMPL_INTERFACE_HPP
|
||||
|
||||
#include "../image.hpp"
|
||||
#include <nana/filesystem/filesystem.hpp>
|
||||
#include <nana/filesystem/filesystem_ext.hpp>
|
||||
|
||||
namespace nana{ namespace paint{
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace nana{ namespace paint{
|
||||
public:
|
||||
typedef nana::paint::graphics& graph_reference;
|
||||
virtual ~image_impl_interface() = 0; //The destructor is defined in ../image.cpp
|
||||
virtual bool open(const nana::experimental::filesystem::path& file) = 0;
|
||||
virtual bool open(const std::experimental::filesystem::path& file) = 0;
|
||||
virtual bool open(const void* data, std::size_t bytes) = 0; // reads image from memory
|
||||
virtual bool alpha_channel() const = 0;
|
||||
virtual bool empty() const = 0;
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
#ifndef NANA_PAINT_GRAPHICS_HPP
|
||||
#define NANA_PAINT_GRAPHICS_HPP
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "../basic_types.hpp"
|
||||
#include "../gui/basis.hpp"
|
||||
#include "pixel_buffer.hpp"
|
||||
#include <memory>
|
||||
|
||||
namespace nana
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user