From 8d2ec2fbd147167d2d747163dcd2b61b8bb01423 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 19 Jan 2016 01:34:07 +0800 Subject: [PATCH] update experimental::filesystem and remove file_iterator --- build/codeblocks/nana.cbp | 2 +- build/codeblocks/nana.depend | 822 ++++++++++++++++-- build/vc2013/nana.vcxproj | 2 - build/vc2013/nana.vcxproj.filters | 6 - build/vc2015/nana.vcxproj | 1 - build/vc2015/nana.vcxproj.filters | 3 - include/nana/config.hpp | 16 +- include/nana/deploy.hpp | 4 +- include/nana/filesystem/file_iterator.hpp | 254 ------ include/nana/filesystem/filesystem.hpp | 295 ++----- include/nana/filesystem/fs_utility.hpp | 4 +- include/nana/gui/filebox.hpp | 2 +- include/nana/gui/programming_interface.hpp | 3 - include/nana/internationalization.hpp | 4 +- include/nana/paint/image.hpp | 3 +- include/nana/system/shared_wrapper.hpp | 7 +- source/filesystem/file_iterator.cpp | 41 - source/filesystem/filesystem.cpp | 369 +++++++- source/filesystem/fs_utility.cpp | 55 +- source/gui/detail/native_window_interface.cpp | 20 +- source/gui/filebox.cpp | 112 +-- source/gui/programming_interface.cpp | 18 - 22 files changed, 1255 insertions(+), 788 deletions(-) delete mode 100644 include/nana/filesystem/file_iterator.hpp delete mode 100644 source/filesystem/file_iterator.cpp diff --git a/build/codeblocks/nana.cbp b/build/codeblocks/nana.cbp index e0d020a6..b5d4b09b 100644 --- a/build/codeblocks/nana.cbp +++ b/build/codeblocks/nana.cbp @@ -51,7 +51,7 @@ - + diff --git a/build/codeblocks/nana.depend b/build/codeblocks/nana.depend index bc77979b..765af40b 100644 --- a/build/codeblocks/nana.depend +++ b/build/codeblocks/nana.depend @@ -548,7 +548,7 @@ -1439496157 source:d:\git.repo\nana\source\audio\detail\audio_stream.cpp +1452100459 source:d:\git.repo\nana\source\audio\detail\audio_stream.cpp @@ -556,7 +556,7 @@ -1353253406 source:d:\git.repo\nana\source\audio\player.cpp +1452100459 source:d:\git.repo\nana\source\audio\player.cpp @@ -570,12 +570,13 @@ -1439496157 source:d:\git.repo\nana\source\charset.cpp +1452100459 source:d:\git.repo\nana\source\charset.cpp + @@ -585,12 +586,16 @@ -1439496157 source:d:\git.repo\nana\source\deploy.cpp +1452100459 source:d:\git.repo\nana\source\deploy.cpp + + + + 1439496157 source:d:\git.repo\nana\source\detail\platform_spec_selector.cpp @@ -636,9 +641,9 @@ 1365203878 source:d:\git.repo\nana\source\filesystem\file_iterator.cpp -1365203878 source:d:\git.repo\nana\source\filesystem\fs_utility.cpp +1453128389 source:d:\git.repo\nana\source\filesystem\fs_utility.cpp - + @@ -653,7 +658,7 @@ -1444647306 source:d:\git.repo\nana\source\gui\animation.cpp +1449510853 source:d:\git.repo\nana\source\gui\animation.cpp @@ -676,8 +681,8 @@ -1444585389 source:d:\git.repo\nana\source\gui\detail\bedrock_pi.cpp - +1447167067 source:d:\git.repo\nana\source\gui\detail\bedrock_pi.cpp + @@ -721,7 +726,7 @@ -1444567878 source:d:\git.repo\nana\source\gui\detail\color_schemes.cpp +1447167067 source:d:\git.repo\nana\source\gui\detail\color_schemes.cpp @@ -737,7 +742,7 @@ 1408986718 source:d:\git.repo\nana\source\gui\detail\element_store.cpp -1444470665 source:d:\git.repo\nana\source\gui\detail\events_operation.cpp +1447167067 source:d:\git.repo\nana\source\gui\detail\events_operation.cpp 1444647213 source:d:\git.repo\nana\source\gui\detail\native_window_interface.cpp @@ -751,17 +756,17 @@ -1439496158 d:\git.repo\nana\source\paint\detail\image_ico.hpp +1452100459 d:\git.repo\nana\source\paint\detail\image_ico.hpp -1439496157 source:d:\git.repo\nana\source\gui\detail\window_layout.cpp +1451801884 source:d:\git.repo\nana\source\gui\detail\window_layout.cpp -1444657627 source:d:\git.repo\nana\source\gui\detail\window_manager.cpp +1451801884 source:d:\git.repo\nana\source\gui\detail\window_manager.cpp @@ -774,10 +779,11 @@ -1444585885 source:d:\git.repo\nana\source\gui\dragger.cpp +1452100459 source:d:\git.repo\nana\source\gui\dragger.cpp + -1444647322 source:d:\git.repo\nana\source\gui\drawing.cpp +1447167067 source:d:\git.repo\nana\source\gui\drawing.cpp @@ -786,7 +792,7 @@ -1444585885 source:d:\git.repo\nana\source\gui\element.cpp +1452100459 source:d:\git.repo\nana\source\gui\element.cpp @@ -796,10 +802,11 @@ -1439496157 source:d:\git.repo\nana\source\gui\filebox.cpp +1453128893 source:d:\git.repo\nana\source\gui\filebox.cpp + @@ -808,7 +815,7 @@ - + @@ -816,7 +823,7 @@ 1439496157 source:d:\git.repo\nana\source\gui\layout_utility.cpp -1444585885 source:d:\git.repo\nana\source\gui\msgbox.cpp +1452100459 source:d:\git.repo\nana\source\gui\msgbox.cpp @@ -835,7 +842,7 @@ -1444647352 source:d:\git.repo\nana\source\gui\notifier.cpp +1452100459 source:d:\git.repo\nana\source\gui\notifier.cpp @@ -844,11 +851,11 @@ - + -1444657299 source:d:\git.repo\nana\source\gui\programming_interface.cpp +1453128389 source:d:\git.repo\nana\source\gui\programming_interface.cpp @@ -866,13 +873,13 @@ -1444647437 source:d:\git.repo\nana\source\gui\state_cursor.cpp +1447167068 source:d:\git.repo\nana\source\gui\state_cursor.cpp -1439496158 source:d:\git.repo\nana\source\gui\timer.cpp +1449510853 source:d:\git.repo\nana\source\gui\timer.cpp @@ -880,20 +887,21 @@ + -1444585886 source:d:\git.repo\nana\source\gui\tooltip.cpp +1452100459 source:d:\git.repo\nana\source\gui\tooltip.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\button.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\button.cpp -1439829040 source:d:\git.repo\nana\source\gui\widgets\categorize.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\categorize.cpp @@ -901,13 +909,13 @@ -1439829040 source:d:\git.repo\nana\source\gui\widgets\checkbox.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\checkbox.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\combox.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\combox.cpp @@ -917,13 +925,13 @@ -1439829040 source:d:\git.repo\nana\source\gui\widgets\date_chooser.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\date_chooser.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\float_listbox.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\float_listbox.cpp @@ -933,13 +941,13 @@ 1408985395 source:d:\git.repo\nana\source\gui\widgets\frame.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\group.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\group.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\label.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\label.cpp @@ -947,7 +955,7 @@ -1439496158 source:d:\git.repo\nana\source\gui\widgets\listbox.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\listbox.cpp @@ -960,7 +968,7 @@ -1439828820 source:d:\git.repo\nana\source\gui\widgets\menu.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\menu.cpp @@ -968,11 +976,11 @@ -1439496158 source:d:\git.repo\nana\source\gui\widgets\menubar.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\menubar.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\panel.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\panel.cpp 1439496158 source:d:\git.repo\nana\source\gui\widgets\picture.cpp @@ -984,11 +992,11 @@ 1439496158 source:d:\git.repo\nana\source\gui\widgets\progress.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\scroll.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\scroll.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\skeletons\text_editor.cpp +1452536705 source:d:\git.repo\nana\source\gui\widgets\skeletons\text_editor.cpp @@ -1000,17 +1008,17 @@ -1439496158 source:d:\git.repo\nana\source\gui\widgets\slider.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\slider.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\spinbox.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\spinbox.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\textbox.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\textbox.cpp @@ -1018,12 +1026,12 @@ -1439496158 source:d:\git.repo\nana\source\gui\widgets\toolbar.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\toolbar.cpp -1439496158 source:d:\git.repo\nana\source\gui\widgets\treebox.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\treebox.cpp @@ -1031,36 +1039,38 @@ -1439746410 source:d:\git.repo\nana\source\gui\widgets\widget.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\widget.cpp -1408984042 source:d:\git.repo\nana\source\gui\wvl.cpp +1447167068 source:d:\git.repo\nana\source\gui\wvl.cpp + -1425221155 source:d:\git.repo\nana\source\internationalization.cpp +1452100459 source:d:\git.repo\nana\source\internationalization.cpp - - + + + 1423350893 source:d:\git.repo\nana\source\paint\detail\image_process_provider.cpp -1439496158 source:d:\git.repo\nana\source\paint\detail\native_paint_interface.cpp - +1452100459 source:d:\git.repo\nana\source\paint\detail\native_paint_interface.cpp + -1439746289 source:d:\git.repo\nana\source\paint\graphics.cpp - +1452100459 source:d:\git.repo\nana\source\paint\graphics.cpp + @@ -1071,8 +1081,8 @@ -1439496158 source:d:\git.repo\nana\source\paint\image.cpp - +1452100460 source:d:\git.repo\nana\source\paint\image.cpp + @@ -1080,78 +1090,81 @@ + "detail/image_jpeg.hpp" "detail/image_png.hpp" "detail/image_bmp.hpp" "detail/image_ico.hpp" -1439687843 d:\git.repo\nana\source\paint\detail\image_png.hpp - - +1447167068 d:\git.repo\nana\source\paint\detail\image_png.hpp + "image_pixbuf.hpp" + - -1439496158 d:\git.repo\nana\source\paint\detail\image_bmp.hpp - +1452100459 d:\git.repo\nana\source\paint\detail\image_bmp.hpp + "image_pixbuf.hpp" 1376313789 source:d:\git.repo\nana\source\paint\image_process_selector.cpp -1439496158 source:d:\git.repo\nana\source\paint\pixel_buffer.cpp - +1447167068 source:d:\git.repo\nana\source\paint\pixel_buffer.cpp + + -1423350893 source:d:\git.repo\nana\source\paint\text_renderer.cpp - +1452100460 source:d:\git.repo\nana\source\paint\text_renderer.cpp + -1439496158 source:d:\git.repo\nana\source\system\dataexch.cpp +1452100460 source:d:\git.repo\nana\source\system\dataexch.cpp + -1387007333 source:d:\git.repo\nana\source\system\platform.cpp +1452100460 source:d:\git.repo\nana\source\system\platform.cpp + -1365203879 source:d:\git.repo\nana\source\system\shared_wrapper.cpp +1447169804 source:d:\git.repo\nana\source\system\shared_wrapper.cpp -1342280997 source:d:\git.repo\nana\source\system\timepiece.cpp +1447168921 source:d:\git.repo\nana\source\system\timepiece.cpp -1386165989 source:d:\git.repo\nana\source\threads\pool.cpp +1449510853 source:d:\git.repo\nana\source\threads\pool.cpp - + @@ -1164,7 +1177,7 @@ 1439496158 source:d:\git.repo\nana\source\unicode_bidi.cpp -1439830958 source:d:\git.repo\nana\source\gui\widgets\tabbar.cpp +1452100459 source:d:\git.repo\nana\source\gui\widgets\tabbar.cpp @@ -1173,11 +1186,12 @@ -1444658359 source:d:\git.repo\nana\source\gui\place.cpp +1452100459 source:d:\git.repo\nana\source\gui\place.cpp + @@ -1190,7 +1204,7 @@ "place_parts.hpp" -1444585885 d:\git.repo\nana\source\gui\place_parts.hpp +1452100459 d:\git.repo\nana\source\gui\place_parts.hpp @@ -1198,3 +1212,661 @@ +1418083945 d:\git.repo\nana\include\nana\any.hpp + + + +1345180256 d:\git.repo\nana\include\nana\audio\detail\audio_device.hpp + + + + + + +1453135618 d:\git.repo\nana\include\nana\deploy.hpp + + + + + + + + + +1453135601 d:\git.repo\nana\include\nana\config.hpp + + + +1451801884 d:\git.repo\nana\include\nana\verbose_preprocessor.hpp + +1452100458 d:\git.repo\nana\include\nana\charset.hpp + + +1449510853 d:\git.repo\nana\include\nana\audio\detail\buffer_preparation.hpp + + + + + + + + + + + + +1452100458 d:\git.repo\nana\include\nana\audio\detail\audio_stream.hpp + + + +1449510853 d:\git.repo\nana\include\nana\std_thread.hpp + + + + +1449510853 d:\git.repo\nana\include\nana\std_mutex.hpp + + + + + + + + + + + + + + +1449510853 d:\git.repo\nana\include\nana\std_condition_variable.hpp + + + + +1452100458 d:\git.repo\nana\include\nana\system\platform.hpp + + +1452100458 d:\git.repo\nana\include\nana\audio\player.hpp + + + +1452100458 d:\git.repo\nana\include\nana\traits.hpp + + +1452100458 d:\git.repo\nana\include\nana\basic_types.hpp + + + +1439496155 d:\git.repo\nana\include\nana\datetime.hpp + + +1447169930 d:\git.repo\nana\include\nana\detail\platform_spec_selector.hpp + + + + +1452100458 d:\git.repo\nana\include\nana\detail\win32\platform_spec.hpp + + + + + + + + +1447694839 d:\git.repo\nana\include\nana\gui\basis.hpp + "../basic_types.hpp" + "../traits.hpp" + +1453125056 d:\git.repo\nana\include\nana\paint\image.hpp + "graphics.hpp" + + +1452100458 d:\git.repo\nana\include\nana\paint\graphics.hpp + "../basic_types.hpp" + "../gui/basis.hpp" + "pixel_buffer.hpp" + + +1447167067 d:\git.repo\nana\include\nana\paint\pixel_buffer.hpp + + + +1453129811 d:\git.repo\nana\include\nana\filesystem\filesystem.hpp + + + + + + + + + +1409500994 d:\git.repo\nana\include\nana\gui\detail\event_code.hpp + +1452100458 d:\git.repo\nana\include\nana\detail\linux_x11\platform_spec.hpp + + + + + + + + + + + + + + + "msg_packet.hpp" + + + + +1452100458 d:\git.repo\nana\include\nana\detail\linux_x11\msg_packet.hpp + + + + +1452100459 source:d:\git.repo\nana\source\detail\platform_spec_posix.cpp + + + + + + + + + + + + + + "x11/msg_dispatcher.hpp" + +1447167067 d:\git.repo\nana\include\nana\gui\detail\bedrock.hpp + "general_events.hpp" + "color_schemes.hpp" + "internal_scope_guard.hpp" + +1452100458 d:\git.repo\nana\include\nana\gui\detail\general_events.hpp + + "event_code.hpp" + "internal_scope_guard.hpp" + + + + + +1410789890 d:\git.repo\nana\include\nana\gui\detail\internal_scope_guard.hpp + +1447167067 d:\git.repo\nana\include\nana\gui\detail\color_schemes.hpp + "widget_colors.hpp" + +1423350891 d:\git.repo\nana\include\nana\gui\detail\widget_colors.hpp + + + +1452100458 d:\git.repo\nana\include\nana\gui\detail\basic_window.hpp + "drawer.hpp" + "events_holder.hpp" + "widget_colors.hpp" + "widget_notifier_interface.hpp" + + + + +1447167067 d:\git.repo\nana\include\nana\gui\detail\drawer.hpp + + "general_events.hpp" + + + +1409768997 d:\git.repo\nana\include\nana\gui\detail\events_holder.hpp + + +1452100458 d:\git.repo\nana\include\nana\gui\detail\widget_notifier_interface.hpp + + + +1447167067 d:\git.repo\nana\include\nana\gui\effects.hpp + + + +1449510853 d:\git.repo\nana\include\nana\gui\detail\window_manager.hpp + + "window_layout.hpp" + "event_code.hpp" + "inner_fwd.hpp" + + + + +1413471439 d:\git.repo\nana\include\nana\gui\detail\window_layout.hpp + + + +1439496155 d:\git.repo\nana\include\nana\gui\detail\inner_fwd.hpp + + +1449510999 d:\git.repo\nana\source\detail\x11\msg_dispatcher.hpp + + + + + + + + + + +1452100459 source:d:\git.repo\nana\source\detail\platform_spec_windows.cpp + + + + + +1453128389 d:\git.repo\nana\include\nana\filesystem\fs_utility.hpp + + + +1447167067 d:\git.repo\nana\include\nana\gui\animation.hpp + + + + +1413449218 d:\git.repo\nana\include\nana\gui\drawing.hpp + "widgets/widget.hpp" + "../traits.hpp" + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\widget.hpp + "../basis.hpp" + "../programming_interface.hpp" + + + + +1453128389 d:\git.repo\nana\include\nana\gui\programming_interface.hpp + + "effects.hpp" + "detail/general_events.hpp" + "detail/color_schemes.hpp" + + + +1453116049 d:\git.repo\nana\include\nana\internationalization.hpp + "basic_types.hpp" + + + + + +1398298742 d:\git.repo\nana\include\nana\system\timepiece.hpp + +1452100458 d:\git.repo\nana\include\nana\gui\detail\native_window_interface.hpp + "../basis.hpp" + + +1447167067 d:\git.repo\nana\include\nana\gui\detail\bedrock_pi_data.hpp + + "color_schemes.hpp" + "events_operation.hpp" + "window_manager.hpp" + + +1449510853 d:\git.repo\nana\include\nana\gui\detail\events_operation.hpp + + + + + + +1447167067 d:\git.repo\nana\include\nana\gui\wvl.hpp + "programming_interface.hpp" + "screen.hpp" + "widgets/form.hpp" + "drawing.hpp" + "msgbox.hpp" + "place.hpp" + +1439496156 d:\git.repo\nana\include\nana\gui\screen.hpp + "basis.hpp" + + + +1439496156 d:\git.repo\nana\include\nana\gui\widgets\form.hpp + "widget.hpp" + +1452100458 d:\git.repo\nana\include\nana\gui\msgbox.hpp + + +1452100458 d:\git.repo\nana\include\nana\gui\place.hpp + + + + + +1439496155 d:\git.repo\nana\include\nana\gui\detail\inner_fwd_implement.hpp + "inner_fwd.hpp" + "basic_window.hpp" + "../../paint/graphics.hpp" + + +1439496155 d:\git.repo\nana\include\nana\gui\layout_utility.hpp + "basis.hpp" + +1412237320 d:\git.repo\nana\include\nana\gui\detail\element_store.hpp + + + + + +1447167067 d:\git.repo\nana\include\nana\gui\element.hpp + + + + + +1447167067 d:\git.repo\nana\include\nana\pat\cloneable.hpp + + + + +1452100459 source:d:\git.repo\nana\source\gui\detail\bedrock_posix.cpp + + + + + + + + + + + +1452100459 source:d:\git.repo\nana\source\gui\detail\bedrock_windows.cpp + + + + + + + + + + + + + + +1411474310 d:\git.repo\nana\include\nana\gui.hpp + "gui/wvl.hpp" + +1408991732 d:\git.repo\nana\include\nana\gui\detail\dynamic_drawing_object.hpp + + + +1447167067 d:\git.repo\nana\include\nana\gui\detail\effects_renderer.hpp + + + + + + +1453130060 source:d:\git.repo\nana\source\filesystem\filesystem.cpp + + + + + + + + + + + + + + + +1449510853 d:\git.repo\nana\include\nana\gui\detail\handle_manager.hpp + + + + + + + +1452100458 d:\git.repo\nana\include\nana\gui\dragger.hpp + "basis.hpp" + "../basic_types.hpp" + "../traits.hpp" + +1453128800 d:\git.repo\nana\include\nana\gui\filebox.hpp + + + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\label.hpp + "widget.hpp" + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\button.hpp + "widget.hpp" + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\listbox.hpp + "widget.hpp" + "detail/inline_widget.hpp" + + + + + + +1439496156 d:\git.repo\nana\include\nana\gui\widgets\detail\inline_widget.hpp + "../../basis.hpp" + +1447167067 d:\git.repo\nana\include\nana\pat\abstract_factory.hpp + "cloneable.hpp" + + +1398298742 d:\git.repo\nana\include\nana\concepts.hpp + + +1439496157 d:\git.repo\nana\include\nana\key_type.hpp + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\categorize.hpp + + + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\textbox.hpp + + "skeletons/textbase_export_interface.hpp" + "skeletons/text_editor_part.hpp" + +1423350891 d:\git.repo\nana\include\nana\gui\widgets\skeletons\textbase_export_interface.hpp + +1447167068 d:\git.repo\nana\include\nana\gui\widgets\skeletons\text_editor_part.hpp + "../../detail/widget_colors.hpp" + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\treebox.hpp + "widget.hpp" + "detail/compset.hpp" + "detail/tree_cont.hpp" + + + + + +1408985780 d:\git.repo\nana\include\nana\gui\widgets\detail\compset.hpp + + +1452100603 d:\git.repo\nana\include\nana\gui\widgets\detail\tree_cont.hpp + + +1423350891 d:\git.repo\nana\include\nana\gui\timer.hpp + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\combox.hpp + "widget.hpp" + "float_listbox.hpp" + "skeletons/text_editor_part.hpp" + + + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\float_listbox.hpp + "widget.hpp" + + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\spinbox.hpp + "widget.hpp" + "skeletons/text_editor_part.hpp" + +1439496156 d:\git.repo\nana\include\nana\gui\widgets\panel.hpp + "widget.hpp" + + +1439496156 d:\git.repo\nana\include\nana\gui\widgets\picture.hpp + "widget.hpp" + +1452100458 d:\git.repo\nana\include\nana\gui\notifier.hpp + + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\tabbar.hpp + "widget.hpp" + + + +1452100458 d:\git.repo\nana\include\nana\paint\text_renderer.hpp + + +1415011754 d:\git.repo\nana\include\nana\gui\state_cursor.hpp + + +1452100757 d:\git.repo\nana\include\nana\gui\tooltip.hpp + "widgets/widget.hpp" + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\checkbox.hpp + "widget.hpp" + + + +1452100458 d:\git.repo\nana\include\nana\system\dataexch.hpp + + +1452100621 d:\git.repo\nana\include\nana\gui\widgets\skeletons\text_editor.hpp + "textbase.hpp" + "text_editor_part.hpp" + + + +1452536138 d:\git.repo\nana\include\nana\gui\widgets\skeletons\textbase.hpp + + + + "textbase_export_interface.hpp" + + + + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\scroll.hpp + "widget.hpp" + + +1385896991 d:\git.repo\nana\include\nana\unicode_bidi.hpp + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\date_chooser.hpp + "widget.hpp" + + +1439496156 d:\git.repo\nana\include\nana\gui\widgets\frame.hpp + "widget.hpp" + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\group.hpp + + + +1452100631 d:\git.repo\nana\include\nana\gui\widgets\skeletons\text_token_stream.hpp + + + + + + + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\menu.hpp + "widget.hpp" + + + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\menubar.hpp + "widget.hpp" + "menu.hpp" + +1439496156 d:\git.repo\nana\include\nana\gui\widgets\progress.hpp + "widget.hpp" + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\slider.hpp + "widget.hpp" + + +1452100458 d:\git.repo\nana\include\nana\gui\widgets\toolbar.hpp + "widget.hpp" + +1382463882 d:\git.repo\nana\include\nana\paint\detail\image_process_provider.hpp + + + + + +1423350892 d:\git.repo\nana\include\nana\paint\image_process_interface.hpp + + + +1447167067 d:\git.repo\nana\include\nana\paint\detail\image_processor.hpp + "../image_process_interface.hpp" + + + + +1452100458 d:\git.repo\nana\include\nana\paint\detail\native_paint_interface.hpp + + +1452100458 d:\git.repo\nana\include\nana\paint\detail\image_impl_interface.hpp + "../image.hpp" + +1447167068 d:\git.repo\nana\source\paint\detail\image_jpeg.hpp + "image_pixbuf.hpp" + + + + + +1447167068 d:\git.repo\nana\source\paint\detail\image_pixbuf.hpp + + + +1398298742 d:\git.repo\nana\include\nana\paint\image_process_selector.hpp + "detail/image_process_provider.hpp" + +1453136647 d:\git.repo\nana\include\nana\system\shared_wrapper.hpp + + + + +1399048525 d:\git.repo\nana\include\nana\threads\pool.hpp + + + + diff --git a/build/vc2013/nana.vcxproj b/build/vc2013/nana.vcxproj index 82ed86e6..2771c133 100644 --- a/build/vc2013/nana.vcxproj +++ b/build/vc2013/nana.vcxproj @@ -189,7 +189,6 @@ - @@ -275,7 +274,6 @@ - diff --git a/build/vc2013/nana.vcxproj.filters b/build/vc2013/nana.vcxproj.filters index 1d5d8d11..14265033 100644 --- a/build/vc2013/nana.vcxproj.filters +++ b/build/vc2013/nana.vcxproj.filters @@ -111,9 +111,6 @@ Source Files\nana\filesystem - - Source Files\nana\filesystem - Source Files\nana\filesystem @@ -616,9 +613,6 @@ Header Files\filesystem - - Header Files\filesystem - Header Files\filesystem diff --git a/build/vc2015/nana.vcxproj b/build/vc2015/nana.vcxproj index 139797f3..100336ef 100644 --- a/build/vc2015/nana.vcxproj +++ b/build/vc2015/nana.vcxproj @@ -183,7 +183,6 @@ - diff --git a/build/vc2015/nana.vcxproj.filters b/build/vc2015/nana.vcxproj.filters index 9781e955..2ab6736a 100644 --- a/build/vc2015/nana.vcxproj.filters +++ b/build/vc2015/nana.vcxproj.filters @@ -84,9 +84,6 @@ Source Files\audio - - Source Files\filesystem - Source Files\filesystem diff --git a/include/nana/config.hpp b/include/nana/config.hpp index 696492de..3b0a85dd 100644 --- a/include/nana/config.hpp +++ b/include/nana/config.hpp @@ -1,7 +1,7 @@ /** * Nana Configuration * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) + * 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 @@ -134,13 +134,13 @@ //but if USE_github_com_meganz_mingw_std_threads is enabled, //boost.thread will be replaced with meganz's mingw-std-threads. // https://github.com/meganz/mingw-std-threads - #if !defined( USE_github_com_meganz_mingw_std_threads ) - //#define USE_github_com_meganz_mingw_std_threads - #endif - #if !defined(STD_make_unique_NOT_SUPPORTED) - #define STD_make_unique_NOT_SUPPORTED - #endif //STD_make_unique_NOT_SUPPORTED + #if !defined( USE_github_com_meganz_mingw_std_threads ) + //#define USE_github_com_meganz_mingw_std_threads + #endif + #endif + #if (__GNUC_MINOR__ < 9) + #define STD_MAKE_UNIQUE_NOT_SUPPORTED #endif #if defined(NANA_MINGW) @@ -218,4 +218,4 @@ #endif -#endif // NANA_CONFIG_HPP \ No newline at end of file +#endif // NANA_CONFIG_HPP diff --git a/include/nana/deploy.hpp b/include/nana/deploy.hpp index 8d9f2cb3..3765c3db 100644 --- a/include/nana/deploy.hpp +++ b/include/nana/deploy.hpp @@ -1,7 +1,7 @@ /* * The Deploy Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) + * 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 @@ -154,7 +154,7 @@ namespace nana #define NANA_RGB(a) (((DWORD)(a) & 0xFF)<<16) | ((DWORD)(a) & 0xFF00) | (((DWORD)(a) & 0xFF0000) >> 16 ) -#if defined(STD_make_unique_NOT_SUPPORTED) +#ifdef STD_MAKE_UNIQUE_NOT_SUPPORTED // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3656.htm #include diff --git a/include/nana/filesystem/file_iterator.hpp b/include/nana/filesystem/file_iterator.hpp deleted file mode 100644 index 26df3f10..00000000 --- a/include/nana/filesystem/file_iterator.hpp +++ /dev/null @@ -1,254 +0,0 @@ -/* - * A File Iterator Implementation - * Copyright(C) 2003-2015 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: filesystem/file_iterator.hpp - * @description: - * file_iterator is a toolkit for applying each file and directory in a - * specified path. - */ - -#ifndef NANA_FILESYSTEM_FILE_ITERATOR_HPP -#define NANA_FILESYSTEM_FILE_ITERATOR_HPP -#include -#include - -#include - -#ifdef NANA_WINDOWS - #include - typedef HANDLE find_handle_t; -#elif defined(NANA_LINUX) || defined(NANA_MACOS) - #include - #include - #include - typedef DIR* find_handle_t; -#endif - -namespace nana -{ -namespace filesystem -{ - struct fileinfo - { - fileinfo(); -#ifdef NANA_WINDOWS - fileinfo(const WIN32_FIND_DATA& wfd); -#elif defined(NANA_POSIX) - fileinfo(const std::string& filename, const struct stat &); -#endif - ::std::string name; - - unsigned long size; - bool directory; - }; - - template - class basic_file_iterator - :public std::iterator - { - public: - typedef FileInfo value_type; - - basic_file_iterator():end_(true), handle_(nullptr){} - - basic_file_iterator(const std::string& file_path) - :end_(false), handle_(nullptr) - { - _m_prepare(file_path); - } - - const value_type& - operator*() const { return value_; } - - const value_type* - operator->() const { return &(operator*()); } - - basic_file_iterator& operator++() - { _m_read(); return *this; } - - basic_file_iterator operator++(int) - { - basic_file_iterator tmp = *this; - _m_read(); - return tmp; - } - - bool equal(const basic_file_iterator& x) const - { - if(end_ && (end_ == x.end_)) return true; - return (value_.name == x.value_.name); - } - private: - template - static bool _m_ignore(const Char * p) - { - while(*p == '.') - ++p; - return (*p == 0); - } - - void _m_prepare(const std::string& file_path) - { - #if defined(NANA_WINDOWS) - auto pat = utf8_cast(file_path); - DWORD attr = ::GetFileAttributes(pat.data()); - if((attr != INVALID_FILE_ATTRIBUTES) && (attr & FILE_ATTRIBUTE_DIRECTORY)) - pat += L"\\*"; - - ::HANDLE handle = ::FindFirstFile(pat.data(), &wfd_); - - if(handle == INVALID_HANDLE_VALUE) - { - end_ = true; - return; - } - - while(_m_ignore(wfd_.cFileName)) - { - if(::FindNextFile(handle, &wfd_) == 0) - { - end_ = true; - ::FindClose(handle); - return; - } - } - value_ = value_type(wfd_); - #elif defined(NANA_LINUX) || defined(NANA_MACOS) - path_ = file_path; - if(path_.size() && path_.back() != '/') - path_ += '/'; - auto handle = opendir(path_.c_str()); - - end_ = true; - if(handle) - { - struct dirent * dnt = readdir(handle); - if(dnt) - { - while(_m_ignore(dnt->d_name)) - { - dnt = readdir(handle); - if(dnt == 0) - { - closedir(handle); - return; - } - } - - struct stat fst; - if(stat((path_ + dnt->d_name).c_str(), &fst) == 0) - { - value_ = value_type(dnt->d_name, fst); - } - else - { - value_.name = nana::charset(dnt->d_name); - value_.size = 0; - value_.directory = false; - } - end_ = false; - } - } - #endif - if(false == end_) - { - find_ptr_ = std::shared_ptr(new find_handle_t(handle), inner_handle_deleter()); - handle_ = handle; - } - } - - void _m_read() - { - if(handle_) - { - #if defined(NANA_WINDOWS) - if(::FindNextFile(handle_, &wfd_) != 0) - { - while(_m_ignore(wfd_.cFileName)) - { - if(::FindNextFile(handle_, &wfd_) == 0) - { - end_ = true; - return; - } - } - value_ = value_type(wfd_); - } - else - end_ = true; - #elif defined(NANA_LINUX) || defined(NANA_MACOS) - struct dirent * dnt = readdir(handle_); - if(dnt) - { - while(_m_ignore(dnt->d_name)) - { - dnt = readdir(handle_); - if(dnt == 0) - { - end_ = true; - return; - } - } - struct stat fst; - if(stat((path_ + "/" + dnt->d_name).c_str(), &fst) == 0) - value_ = value_type(nana::charset(dnt->d_name), fst); - else - value_.name = nana::charset(dnt->d_name); - } - else - end_ = true; - #endif - } - } - private: - struct inner_handle_deleter - { - void operator()(find_handle_t * handle) - { - if(handle && *handle) - { - #if defined(NANA_WINDOWS) - ::FindClose(*handle); - #elif defined(NANA_LINUX) || defined(NANA_MACOS) - ::closedir(*handle); - #endif - } - delete handle; - } - }; - private: - bool end_; - -#if defined(NANA_WINDOWS) - WIN32_FIND_DATA wfd_; -#else - std::string path_; -#endif - std::shared_ptr find_ptr_; - - find_handle_t handle_; - value_type value_; - }; - - template - inline bool operator==(const basic_file_iterator & x, const basic_file_iterator & y) - { - return x.equal(y); - } - - template - inline bool operator!=(const basic_file_iterator & x, const basic_file_iterator & y) - { - return !x.equal(y); - } - - typedef basic_file_iterator file_iterator; -}//end namespace filesystem -}//end namespace nana - -#endif diff --git a/include/nana/filesystem/filesystem.hpp b/include/nana/filesystem/filesystem.hpp index 6425f922..f157aadd 100644 --- a/include/nana/filesystem/filesystem.hpp +++ b/include/nana/filesystem/filesystem.hpp @@ -8,9 +8,6 @@ * http://www.boost.org/LICENSE_1_0.txt) * * @file: nana/filesystem/filesystem.hpp - * @description: - * file_iterator is a toolkit for applying each file and directory in a - * specified path. * Modiffied by Ariel Vina-Rodriguez: * Now mimic std::experimental::filesystem::v1 (boost v3) * and need VC2015 or a C++11 compiler. With a few correction will be compiler by VC2013 @@ -32,6 +29,8 @@ #ifndef NANA_FILESYSTEM_HPP #define NANA_FILESYSTEM_HPP +#include +#include #include #include #include @@ -40,16 +39,6 @@ #include -#ifdef NANA_WINDOWS - #include - typedef HANDLE find_handle_t; -#elif defined(NANA_LINUX) || defined(NANA_MACOS) - #include - #include - #include - typedef DIR* find_handle_t; -#endif - // namespace std { namespace experimental { namespace filesystem { inline namespace v1 { namespace nana { namespace experimental @@ -80,19 +69,6 @@ namespace filesystem //enum class copy_options; //enum class directory_options; - // class filesystem_error; - enum class error { none = 0 }; // deprecate ?? - - struct attribute // deprecate ?? - { - uintmax_t size {}; - bool directory{}; - tm modified {}; - - attribute() {} ; - attribute( uintmax_t size, bool is_directory) :size{size}, directory{is_directory} {} - }; - struct space_info { uintmax_t capacity; @@ -141,7 +117,7 @@ namespace filesystem #endif using string_type = std::basic_string; - path(); + path() = default; template path(const Source& source) @@ -149,6 +125,7 @@ namespace filesystem _m_assign(source); } + int compare(const path& other) const; bool empty() const; @@ -157,8 +134,14 @@ namespace filesystem path parent_path() const; file_type what() const; + //decomposition path filename() const; + //modifiers + path& remove_filename(); + + + const value_type*c_str() const; const string_type& native() const; operator string_type() const; @@ -166,6 +149,23 @@ namespace filesystem std::string string() const; std::wstring wstring() const; std::string u8string() const; + + //appends + path& operator/=(const path& other); + + template + path& operator/=(const Source& source) + { + path other(source); + return this->operator/=(other); + } + + template + path& append(const Source& source) + { + path other(source); + return this->operator/=(other); + } private: void _m_assign(const std::string& source_utf8); void _m_assign(const std::wstring& source); @@ -177,35 +177,49 @@ namespace filesystem bool operator!=(const path& lhs, const path& rhs); bool operator<(const path& lhs, const path& rhs); bool operator>(const path& lhs, const path& rhs); + path operator/(const path& lhs, const path& rhs); - - struct directory_entry + class filesystem_error + : public std::system_error { - using path_type = filesystem::path; - path_type m_path; + public: + explicit filesystem_error(const std::string& msg, std::error_code); - attribute attr{}; - //file_status m_status; + filesystem_error(const std::string& msg, const path& path1, std::error_code err); + filesystem_error(const std::string& msg, const path& path1, const path& path2, std::error_code err); - directory_entry(){} - directory_entry(const path_type& p, bool is_directory, uintmax_t size) - :m_path{p}, attr{size, is_directory} - {} + const path& path1() const; //noexcept + const path& path2() const; //noexcept + private: + path path1_; + path path2_; + }; - void assign (const path_type& p){ m_path=p;} - void replace_filename(const path_type& p){ m_path=p;} - //file_status status() const; + class directory_entry + { + public: + directory_entry() = default; + explicit directory_entry(const path&); - operator const path_type&() const {return m_path;}; - const path_type& path() const {return m_path;} + //modifiers + void assign(const path&); + void replace_filename(const path&); + + //observers + file_status status() const; + operator const filesystem::path&() const; + const filesystem::path& path() const; + private: + filesystem::path path_; }; /// an iterator for a sequence of directory_entry elements representing the files in a directory, not an recursive_directory_iterator //template class directory_iterator :public std::iterator { + using find_handle = void*; public: using value_type = directory_entry ; typedef ptrdiff_t difference_type; @@ -213,35 +227,20 @@ namespace filesystem typedef const directory_entry& reference; typedef std::input_iterator_tag iterator_category; - directory_iterator():end_(true), handle_(nullptr){} - directory_iterator(const path& file_path) { _m_prepare(file_path); } + directory_iterator(); + directory_iterator(const path& file_path); - const value_type& - operator*() const { return value_; } + const value_type& operator*() const; + const value_type* operator->() const; - const value_type* - operator->() const { return &(operator*()); } + directory_iterator& operator++(); + directory_iterator operator++(int); - directory_iterator& operator++() - { _m_read(); return *this; } - - directory_iterator operator++(int) - { - directory_iterator tmp = *this; - _m_read(); - return tmp; - } - - bool equal(const directory_iterator& x) const - { - if(end_ && (end_ == x.end_)) return true; - return (value_.path().filename() == x.value_.path().filename()); - } + bool equal(const directory_iterator& x) const; - // enable directory_iterator range-based for statements - directory_iterator begin( ) { return *this; } - directory_iterator end( ) { return {}; } + directory_iterator begin(); + directory_iterator end(); private: template @@ -252,150 +251,14 @@ namespace filesystem return (*p == 0); } - void _m_prepare(const path& file_path) - { - auto path_ = file_path.native(); - #if defined(NANA_WINDOWS) - auto pat = path_; - DWORD attr = ::GetFileAttributes(pat.data()); - if((attr != INVALID_FILE_ATTRIBUTES) && (attr & FILE_ATTRIBUTE_DIRECTORY)) - pat += L"\\*"; - - ::HANDLE handle = ::FindFirstFile(pat.data(), &wfd_); - - if(handle == INVALID_HANDLE_VALUE) - { - end_ = true; - return; - } - - while(_m_ignore(wfd_.cFileName)) - { - if(::FindNextFile(handle, &wfd_) == 0) - { - end_ = true; - ::FindClose(handle); - return; - } - } - - value_ = value_type(path(wfd_.cFileName), - (FILE_ATTRIBUTE_DIRECTORY & wfd_.dwFileAttributes) == FILE_ATTRIBUTE_DIRECTORY, - wfd_.nFileSizeLow); - - #elif defined(NANA_POSIX) - if(path_.size() && (path_[path_.size() - 1] != '/')) - path_ += '/'; - find_handle_t handle = opendir(path_.c_str()); - end_ = true; - if(handle) - { - struct dirent * dnt = readdir(handle); - if(dnt) - { - while(_m_ignore(dnt->d_name)) - { - dnt = readdir(handle); - if(dnt == 0) - { - closedir(handle); - return; - } - } - - struct stat fst; - bool is_directory = false; - unsigned size = 0; - if(stat((path_ + dnt->d_name).c_str(), &fst) == 0) - { - is_directory = (0 != S_ISDIR(fst.st_mode)); - size = fst.st_size; - } - value_ = value_type(static_cast(nana::charset(dnt->d_name)), is_directory, size); - end_ = false; - } - } - #endif - if(false == end_) - { - find_ptr_ = std::shared_ptr(new find_handle_t(handle), inner_handle_deleter()); - handle_ = handle; - } - } - - void _m_read() - { - if(handle_) - { - #if defined(NANA_WINDOWS) - if(::FindNextFile(handle_, &wfd_) != 0) - { - while(_m_ignore(wfd_.cFileName)) - { - if(::FindNextFile(handle_, &wfd_) == 0) - { - end_ = true; - return; - } - } - value_ = value_type(path(wfd_.cFileName), - (FILE_ATTRIBUTE_DIRECTORY & wfd_.dwFileAttributes) == FILE_ATTRIBUTE_DIRECTORY, - wfd_.nFileSizeLow); - } - else - end_ = true; - #elif defined(NANA_LINUX) || defined(NANA_MACOS) - struct dirent * dnt = readdir(handle_); - if(dnt) - { - while(_m_ignore(dnt->d_name)) - { - dnt = readdir(handle_); - if(dnt == 0) - { - end_ = true; - return; - } - } - - std::wstring d_name = nana::charset(dnt->d_name, nana::unicode::utf8); - struct stat fst; - if(stat((path_ + "/" + dnt->d_name).c_str(), &fst) == 0) - value_ = value_type(std::move(d_name), (0 != S_ISDIR(fst.st_mode)), fst.st_size); - else - value_.m_path = path(std::move(d_name)); - } - else - end_ = true; - #endif - } - } - private: - struct inner_handle_deleter - { - void operator()(find_handle_t * handle) - { - if(handle && *handle) - { - #if defined(NANA_WINDOWS) - ::FindClose(*handle); - #elif defined(NANA_LINUX) || defined(NANA_MACOS) - ::closedir(*handle); - #endif - } - delete handle; - } - }; + void _m_prepare(const path& file_path); + void _m_read(); private: bool end_{false}; - -#if defined(NANA_WINDOWS) - WIN32_FIND_DATA wfd_; -#endif path::string_type path_; - std::shared_ptr find_ptr_; - find_handle_t handle_{nullptr}; + std::shared_ptr find_ptr_; + find_handle handle_{nullptr}; value_type value_; }; @@ -420,24 +283,30 @@ namespace filesystem file_status status(const path& p); + std::uintmax_t file_size(const path& p); + //uintmax_t file_size(const path& p, error_code& ec) noexcept; + inline bool is_directory(file_status s) { return s.type() == file_type::directory ;} bool is_directory(const path& p); - inline bool is_directory(const directory_entry& d) { return d.attr.directory; } + inline bool is_directory(const directory_entry& d) + { + return is_directory(d.status()); + } //bool is_directory(const path& p, error_code& ec) noexcept; //bool is_regular_file(file_status s) noexcept; inline bool is_empty(const path& p) { - directory_iterator d(p) ; - return d->attr.directory ? d == directory_iterator() - : d->attr.size == 0; + auto fs = status(p); + + if (is_directory(fs)) + return (directory_iterator() == directory_iterator(p)); + + return (file_size(p) == 0); } //bool is_empty(const path& p, error_code& ec) noexcept; - std::uintmax_t file_size(const path& p); - //uintmax_t file_size(const path& p, error_code& ec) noexcept; - bool create_directories(const path& p); //bool create_directories(const path& p, error_code& ec) noexcept; diff --git a/include/nana/filesystem/fs_utility.hpp b/include/nana/filesystem/fs_utility.hpp index 7ddd4298..923be5ce 100644 --- a/include/nana/filesystem/fs_utility.hpp +++ b/include/nana/filesystem/fs_utility.hpp @@ -26,11 +26,9 @@ namespace filesystem bool modified_file_time(const ::std::string& file, struct tm&); - std::wstring path_user(); + std::string path_user(); bool rmfile(const char* file_utf8); - bool rmdir(const char* dir, bool fails_if_not_empty); - }//end namespace filesystem }//end namespace nana diff --git a/include/nana/gui/filebox.hpp b/include/nana/gui/filebox.hpp index 7d8b1b85..3a9b9f4c 100644 --- a/include/nana/gui/filebox.hpp +++ b/include/nana/gui/filebox.hpp @@ -1,7 +1,7 @@ /* * Filebox * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) + * 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 diff --git a/include/nana/gui/programming_interface.hpp b/include/nana/gui/programming_interface.hpp index 1faba2a9..4585ed0c 100644 --- a/include/nana/gui/programming_interface.hpp +++ b/include/nana/gui/programming_interface.hpp @@ -313,9 +313,6 @@ namespace API void eat_tabstop(window, bool); window move_tabstop(window, bool next); ///< Sets the focus to the window which tabstop is near to the specified window. - //bool glass_window(window); //deprecated - //bool glass_window(window, bool); //deprecated - /// Sets the window active state. If a window active state is false, the window will not obtain the focus when a mouse clicks on it wich will be obteined by take_if_has_active_false. void take_active(window, bool has_active, window take_if_has_active_false); diff --git a/include/nana/internationalization.hpp b/include/nana/internationalization.hpp index e1e2cbe3..3e6c967b 100644 --- a/include/nana/internationalization.hpp +++ b/include/nana/internationalization.hpp @@ -1,7 +1,7 @@ /* * An Implementation of i18n * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2014 Jinhao(cnjinhao@hotmail.com) + * 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 @@ -123,7 +123,7 @@ namespace nana std::string eval() const override { - std::wstringstream ss; + std::stringstream ss; ss << fn_(); return ss.str(); } diff --git a/include/nana/paint/image.hpp b/include/nana/paint/image.hpp index e3f0e37e..4a443b02 100644 --- a/include/nana/paint/image.hpp +++ b/include/nana/paint/image.hpp @@ -15,7 +15,8 @@ #define NANA_PAINT_IMAGE_HPP #include "graphics.hpp" -#include "../filesystem/filesystem.hpp" + +#include namespace nana { diff --git a/include/nana/system/shared_wrapper.hpp b/include/nana/system/shared_wrapper.hpp index 57754a6b..b1737cc2 100644 --- a/include/nana/system/shared_wrapper.hpp +++ b/include/nana/system/shared_wrapper.hpp @@ -1,6 +1,6 @@ /* * Operation System Shared Linkage Library Wrapper Implementation - * Copyright(C) 2003 Jinhao + * Copyright(C) 2003-2016 Jinhao * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -13,7 +13,7 @@ #define NANA_SYSTEM_SHARED_WRAPPER_HPP #include -#include +#include #include @@ -69,7 +69,8 @@ namespace system { typedef typename function_ptr::type fptr_type; - if(nana::traits::is_function_pointer::value == false) + //if(nana::traits::is_function_pointer::value == false) + if (::std::is_function::type>::value == false) throw std::invalid_argument("shared_wrapper::symbols, template<_Function> is not a function type or a function pointer type"); if(symbol == 0) diff --git a/source/filesystem/file_iterator.cpp b/source/filesystem/file_iterator.cpp deleted file mode 100644 index c570f5ce..00000000 --- a/source/filesystem/file_iterator.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * A File Iterator Implementation - * Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com)(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/file_iterator.cpp - * @description: - * file_iterator is a toolkit for applying each file and directory in a - * specified path. - */ - -#include - -namespace nana -{ -namespace filesystem -{ - //struct fileinfo - fileinfo::fileinfo() - :size(0), directory(false) - {} -#if defined(NANA_WINDOWS) - fileinfo::fileinfo(const WIN32_FIND_DATA& wfd) - : name(utf8_cast(wfd.cFileName)), size(wfd.nFileSizeLow), - directory((FILE_ATTRIBUTE_DIRECTORY & wfd.dwFileAttributes) == FILE_ATTRIBUTE_DIRECTORY) - { - } -#elif defined(NANA_LINUX) || defined(NANA_MACOS) - fileinfo::fileinfo(const ::std::string& name, const struct stat& fst) - :name(name), size(fst.st_size), directory(0 != S_ISDIR(fst.st_mode)) - { - } -#endif - //end struct fileinfo - -}//end namespace filesystem -}//end namespace nana - diff --git a/source/filesystem/filesystem.cpp b/source/filesystem/filesystem.cpp index 471c718e..0b32df7d 100644 --- a/source/filesystem/filesystem.cpp +++ b/source/filesystem/filesystem.cpp @@ -24,7 +24,7 @@ #include #include -#elif defined(NANA_LINUX) || defined(NANA_MACOS) +#elif defined(NANA_POSIX) #include #include #include @@ -36,9 +36,38 @@ #include #endif + namespace nana { namespace experimental { namespace filesystem { + //class filesystem_error + filesystem_error::filesystem_error(const std::string& msg, std::error_code err) + : std::system_error(err, msg) + {} + + filesystem_error::filesystem_error(const std::string& msg, const path& path1, std::error_code err) + : std::system_error(err, msg), + path1_(path1) + {} + + filesystem_error::filesystem_error(const std::string& msg, const path& path1, const path& path2, std::error_code err) + : std::system_error(err, msg), + path1_(path1), + path2_(path2) + {} + + const path& filesystem_error::path1() const + { + return path1_; + } + + const path&filesystem_error::path2() const + { + return path2_; + } + //end class filesystem_error + + //Because of No wide character version of POSIX #if defined(NANA_LINUX) || defined(NANA_MACOS) const char* splstr = "/"; @@ -72,9 +101,7 @@ namespace nana { namespace experimental { } //end filestatus - //class path - path::path() {} - + //class path int path::compare(const path& p) const { return pathstr_.compare(p.pathstr_); @@ -158,6 +185,41 @@ namespace nana { namespace experimental { return{ pathstr_ }; } + path& path::remove_filename() + { +#ifdef NANA_WINDOWS + wchar_t seps[] = L"/\\"; +#else + char seps[] = "/\\"; +#endif + auto pos = pathstr_.find_last_of(seps); + if (pos != pathstr_.npos) + { + pos = pathstr_.find_last_not_of(seps, pos); + if (pos != pathstr_.npos) + { +#ifdef NANA_WINDOWS + if (pathstr_[pos] == L':') + { + pathstr_.erase(pos + 1); + pathstr_ += L'\\'; + + return *this; + } +#endif + ++pos; + } + else + pos = 0; + } + else + pos = 0; + + pathstr_.erase(pos); + + return *this; + } + const path::value_type* path::c_str() const { return native().c_str(); @@ -188,6 +250,36 @@ namespace nana { namespace experimental { return to_utf8(pathstr_); } + path & path::operator/=(const path& p) + { + if (p.empty()) + return *this; + + if (this == &p) + { + auto other = p.pathstr_; + if ((other.front() != '/') && (other.front() == path::preferred_separator)) + { + if (!this->pathstr_.empty() && (pathstr_.back() != '/' && pathstr_.back() == path::preferred_separator)) + pathstr_.append(path::preferred_separator, 1); + } + + pathstr_ += other; + } + else + { + auto & other = p.pathstr_; + if ((other.front() != '/') && (other.front() == path::preferred_separator)) + { + if (!this->pathstr_.empty() && (pathstr_.back() != '/' && pathstr_.back() == path::preferred_separator)) + pathstr_.append(path::preferred_separator, 1); + } + + pathstr_ += p.pathstr_; + } + return *this; + } + void path::_m_assign(const std::string& source_utf8) { #if defined(NANA_WINDOWS) @@ -227,52 +319,251 @@ namespace nana { namespace experimental { return (rhs.compare(lhs) < 0); } + path operator/(const path& lhs, const path& rhs) + { + auto path = lhs; + return (path /= rhs); + } + + //class directory_entry + directory_entry::directory_entry(const filesystem::path& p) + :path_{ p } + {} + + //modifiers + void directory_entry::assign(const filesystem::path& p) + { + path_ = p; + } + + void directory_entry::replace_filename(const filesystem::path& p) + { + path_ = path_.parent_path() / p; + } + + //observers + file_status directory_entry::status() const + { + return filesystem::status(path_); + } + + directory_entry::operator const filesystem::path&() const + { + return path_; + } + + const path& directory_entry::path() const + { + return path_; + } + //end class directory_entry + + + //class directory_iterator + struct inner_handle_deleter + { + void operator()(void** handle) + { +#if defined(NANA_WINDOWS) + ::FindClose(*handle); +#elif defined(NANA_LINUX) || defined(NANA_MACOS) + ::closedir(*reinterpret_cast(handle)); +#endif + } + }; + + directory_iterator::directory_iterator() + : end_(true), + handle_(nullptr) + {} + + directory_iterator::directory_iterator(const path& file_path) + { + _m_prepare(file_path); + } + + const directory_iterator::value_type& directory_iterator::operator*() const { return value_; } + + const directory_iterator::value_type* + directory_iterator::operator->() const { return &(operator*()); } + + directory_iterator& directory_iterator::operator++() + { + _m_read(); return *this; + } + + directory_iterator directory_iterator::operator++(int) + { + directory_iterator tmp = *this; + _m_read(); + return tmp; + } + + bool directory_iterator::equal(const directory_iterator& x) const + { + if (end_ && (end_ == x.end_)) return true; + return (value_.path().filename() == x.value_.path().filename()); + } + + + // enable directory_iterator range-based for statements + directory_iterator directory_iterator::begin() { return *this; } + directory_iterator directory_iterator::end() { return{}; } + + void directory_iterator::_m_prepare(const path& file_path) + { + path_ = file_path.native(); +#if defined(NANA_WINDOWS) + if (!path_.empty() && (path_.back() != L'/' && path_.back() != L'\\')) + path_ += L'\\'; + + auto pat = path_; + DWORD attr = ::GetFileAttributes(pat.data()); + if ((attr != INVALID_FILE_ATTRIBUTES) && (attr & FILE_ATTRIBUTE_DIRECTORY)) + pat += L"*"; + + WIN32_FIND_DATAW wfd; + ::HANDLE handle = ::FindFirstFile(pat.data(), &wfd); + + if (handle == INVALID_HANDLE_VALUE) + { + end_ = true; + return; + } + + while (_m_ignore(wfd.cFileName)) + { + if (::FindNextFile(handle, &wfd) == 0) + { + end_ = true; + ::FindClose(handle); + return; + } + } + + value_ = value_type(path(path_ + wfd.cFileName)); + +#elif defined(NANA_POSIX) + if (path_.size() && (path_.back() != '/')) + path_ += '/'; + auto handle = opendir(path_.c_str()); + end_ = true; + if (handle) + { + struct dirent * dnt = readdir(handle); + if (dnt) + { + while (_m_ignore(dnt->d_name)) + { + dnt = readdir(handle); + if (dnt == 0) + { + closedir(handle); + return; + } + } + + value_ = value_type(path_ + dnt->d_name); + end_ = false; + } + } +#endif + if (false == end_) + { + find_ptr_ = std::shared_ptr(new find_handle(handle), inner_handle_deleter()); + handle_ = handle; + } + } + + void directory_iterator::_m_read() + { + if (handle_) + { +#if defined(NANA_WINDOWS) + WIN32_FIND_DATAW wfd; + if (::FindNextFile(handle_, &wfd) != 0) + { + while (_m_ignore(wfd.cFileName)) + { + if (::FindNextFile(handle_, &wfd) == 0) + { + end_ = true; + return; + } + } + value_ = value_type(path(path_ + wfd.cFileName)); + } + else + end_ = true; +#elif defined(NANA_POSIX) + struct dirent * dnt = readdir(reinterpret_cast(handle_)); + if (dnt) + { + while (_m_ignore(dnt->d_name)) + { + dnt = readdir(reinterpret_cast(handle_)); + if (!dnt) + { + end_ = true; + return; + } + } + + value_ = value_type(path(path_ + dnt->d_name)); + } + else + end_ = true; +#endif + } + } + //end class directory_iterator + namespace detail { - //rm_dir_recursive - //@brief: remove a directory, if it is not empty, recursively remove it's subfiles and sub directories - template - bool rm_dir_recursive(const CharT* dir) + //rm_dir_recursive + //@brief: remove a directory, if it is not empty, recursively remove it's subfiles and sub directories + template + bool rm_dir_recursive(const CharT* dir) + { + std::vector files; + std::basic_string path = dir; + path += '\\'; + + std::copy(directory_iterator(dir), directory_iterator(), std::back_inserter(files)); + + for (auto & f : files) { - std::vector files; - std::basic_string path = dir; - path += '\\'; + auto subpath = path + f.path().filename().native(); - std::copy(directory_iterator(dir), directory_iterator(), std::back_inserter(files)); - - for (auto & f : files) - { - auto subpath = path + f.path().filename().native(); - if (f.attr.directory) - rm_dir_recursive(subpath.c_str()); - else - rmfile(subpath.c_str()); - } - - return rmdir(dir, true); + if (is_directory(f)) + rm_dir_recursive(subpath.c_str()); + else + rmfile(subpath.c_str()); } + return rmdir(dir, true); + } #if defined(NANA_WINDOWS) - void filetime_to_c_tm(FILETIME& ft, struct tm& t) + void filetime_to_c_tm(FILETIME& ft, struct tm& t) + { + FILETIME local_file_time; + if (::FileTimeToLocalFileTime(&ft, &local_file_time)) { - FILETIME local_file_time; - if (::FileTimeToLocalFileTime(&ft, &local_file_time)) - { - SYSTEMTIME st; - ::FileTimeToSystemTime(&local_file_time, &st); - t.tm_year = st.wYear - 1900; - t.tm_mon = st.wMonth - 1; - t.tm_mday = st.wDay; - t.tm_wday = st.wDayOfWeek - 1; - t.tm_yday = nana::date::day_in_year(st.wYear, st.wMonth, st.wDay); + SYSTEMTIME st; + ::FileTimeToSystemTime(&local_file_time, &st); + t.tm_year = st.wYear - 1900; + t.tm_mon = st.wMonth - 1; + t.tm_mday = st.wDay; + t.tm_wday = st.wDayOfWeek - 1; + t.tm_yday = nana::date::day_in_year(st.wYear, st.wMonth, st.wDay); - t.tm_hour = st.wHour; - t.tm_min = st.wMinute; - t.tm_sec = st.wSecond; - } + t.tm_hour = st.wHour; + t.tm_min = st.wMinute; + t.tm_sec = st.wSecond; } + } #endif - }//end namespace detail + }//end namespace detail bool not_found_error(int errval) { diff --git a/source/filesystem/fs_utility.cpp b/source/filesystem/fs_utility.cpp index 8b25d289..c56ac523 100644 --- a/source/filesystem/fs_utility.cpp +++ b/source/filesystem/fs_utility.cpp @@ -1,6 +1,6 @@ /* * A FileSystem Utility Implementation - * Copyright(C) 2003-2013 Jinhao(cnjinhao@hotmail.com) + * 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 @@ -12,7 +12,6 @@ */ #include -#include #include #include #if defined(NANA_WINDOWS) @@ -53,27 +52,6 @@ namespace filesystem namespace detail { - //rm_dir_recursive - //@brief: remove a directory, if it is not empty, recursively remove it's subfiles and sub directories - bool rm_dir_recursive(std::string&& dir) - { - std::vector files; - auto path = dir; - path += '\\'; - - std::copy(file_iterator(dir), file_iterator(), std::back_inserter(files)); - - for(auto & f : files) - { - if(f.directory) - rm_dir_recursive(path + f.name); - else - rmfile((path + f.name).c_str()); - } - - return rmdir(dir.c_str(), true); - } - #if defined(NANA_WINDOWS) void filetime_to_c_tm(FILETIME& ft, struct tm& t) { @@ -150,41 +128,18 @@ namespace filesystem #endif } - bool rmdir(const char* dir, bool fails_if_not_empty) - { - bool ret = false; - if(dir) - { -#if defined(NANA_WINDOWS) - ret = (::RemoveDirectory(utf8_cast(dir).c_str()) == TRUE); - if(!fails_if_not_empty && (::GetLastError() == ERROR_DIR_NOT_EMPTY)) - ret = detail::rm_dir_recursive(dir); -#elif defined(NANA_LINUX) || defined(NANA_MACOS) - std::string mbstr = nana::charset(dir); - if(::rmdir(mbstr.c_str())) - { - if(!fails_if_not_empty && (errno == EEXIST || errno == ENOTEMPTY)) - ret = detail::rm_dir_recursive(dir); - } - else - ret = true; -#endif - } - return ret; - } - - std::wstring path_user() + std::string path_user() { #if defined(NANA_WINDOWS) wchar_t path[MAX_PATH]; if(SUCCEEDED(SHGetFolderPath(0, CSIDL_PROFILE, 0, SHGFP_TYPE_CURRENT, path))) - return path; + return to_utf8(path); #elif defined(NANA_LINUX) || defined(NANA_MACOS) const char * s = ::getenv("HOME"); if(s) - return nana::charset(std::string(s, std::strlen(s)), nana::unicode::utf8); + return s; #endif - return std::wstring(); + return std::string(); } }//end namespace filesystem }//end namespace nana diff --git a/source/gui/detail/native_window_interface.cpp b/source/gui/detail/native_window_interface.cpp index d310d223..ea84c1d3 100644 --- a/source/gui/detail/native_window_interface.cpp +++ b/source/gui/detail/native_window_interface.cpp @@ -158,7 +158,7 @@ namespace nana{ { #if defined(NANA_WINDOWS) typedef HMONITOR (__stdcall * MonitorFromPointT)(POINT,DWORD); - + MonitorFromPointT mfp = reinterpret_cast(::GetProcAddress(::GetModuleHandleA("User32.DLL"), "MonitorFromPoint")); if(mfp) { @@ -473,13 +473,13 @@ namespace nana{ auto & atombase = restrict::spec.atombase(); ::XSetTransientForHint(disp, reinterpret_cast(wd), owner); ::XChangeProperty(disp, reinterpret_cast(wd), - atombase.net_wm_state, XA_ATOM, sizeof(int) * 8, + atombase.net_wm_state, XA_ATOM, sizeof(int) * 8, PropModeReplace, reinterpret_cast(&atombase.net_wm_state_modal), 1); } } #endif - + void native_interface::enable_dropfiles(native_window_type wd, bool enb) { #if defined(NANA_WINDOWS) @@ -505,7 +505,7 @@ namespace nana{ } ::XSelectInput(restrict::spec.open_display(), reinterpret_cast(wd), mask); -#endif +#endif } bool native_interface::window_icon(native_window_type wd, const nana::paint::image& sml_icon, const ::nana::paint::image& big_icon) @@ -1117,9 +1117,9 @@ namespace nana{ native_string_type str; //One for NULL terminator which GetWindowText will write. str.resize(length+1); - + ::GetWindowText(reinterpret_cast(wd), &(str[0]), static_cast(str.size())); - + //Remove the null terminator writtien by GetWindowText str.resize(length); @@ -1207,9 +1207,9 @@ namespace nana{ Window parent; Window * children; unsigned size; - + platform_scope_guard lock; - + if(0 != ::XQueryTree(restrict::spec.open_display(), reinterpret_cast(wd), &root, &parent, &children, &size)) { @@ -1226,7 +1226,7 @@ namespace nana{ auto prev = ::SetParent(reinterpret_cast(child), reinterpret_cast(new_parent)); if (prev) - ::PostMessage(prev, WM_CHANGEUISTATE, UIS_INITIALIZE, NULL); + ::PostMessage(prev, /*WM_CHANGEUISTATE*/0x0127, /*UIS_INITIALIZE*/ 3, 0); ::SetWindowPos(reinterpret_cast(child), NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED); @@ -1239,7 +1239,7 @@ namespace nana{ if(returns_previous) prev = parent_window(child); - ::XReparentWindow(restrict::spec.open_display(), + ::XReparentWindow(restrict::spec.open_display(), reinterpret_cast(child), reinterpret_cast(new_parent), 0, 0); return prev; diff --git a/source/gui/filebox.cpp b/source/gui/filebox.cpp index bd63a010..f73b1ce7 100644 --- a/source/gui/filebox.cpp +++ b/source/gui/filebox.cpp @@ -1,7 +1,7 @@ /* * Filebox * Nana C++ Library(http://www.nanapro.org) -* Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) +* 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 @@ -17,7 +17,7 @@ #if defined(NANA_WINDOWS) #include -#elif defined(NANA_LINUX) || defined(NANA_MACOS) +#elif defined(NANA_POSIX) #include #include #include @@ -25,7 +25,7 @@ #include #include #include - #include + #include #include #include #include @@ -33,7 +33,7 @@ namespace nana { -#if defined(NANA_LINUX) || defined(NANA_MACOS) +#if defined(NANA_POSIX) class filebox_implement : public form { @@ -421,8 +421,6 @@ namespace nana void _m_init_tree() { - using namespace nana::filesystem; - //The path in linux is starting with the character '/', the name of root key should be //"FS.HOME", "FS.ROOT". Because a key of the tree widget should not be '/' nodes_.home = tree_.insert("FS.HOME", "Home"); @@ -430,28 +428,27 @@ namespace nana nodes_.filesystem = tree_.insert("FS.ROOT", "Filesystem"); nodes_.filesystem.value(kind::filesystem); - file_iterator end; - for(file_iterator i(to_nstring(path_user())); i != end; ++i) + namespace fs = ::nana::experimental::filesystem; + + std::vector paths; + paths.emplace_back(nana::filesystem::path_user()); + paths.emplace_back("/"); + + fs::directory_iterator end; + for (auto & p : paths) { - if((false == i->directory) || (i->name.size() && i->name[0] == '.')) continue; - - item_proxy node = tree_.insert(nodes_.home, i->name, i->name); - if(false == node.empty()) + for (fs::directory_iterator i(p); i != end; ++i) { - node.value(kind::filesystem); - break; - } - } + auto name = i->path().filename().native(); + if (!is_directory(i->status()) || (name.size() && name[0] == '.')) + continue; - for(file_iterator i("/"); i != end; ++i) - { - if((false == i->directory) || (i->name.size() && i->name[0] == '.')) continue; - - item_proxy node = tree_.insert(nodes_.filesystem, i->name, i->name); - if(false == node.empty()) - { - node.value(kind::filesystem); - break; + item_proxy node = tree_.insert(nodes_.filesystem, name, name); + if (false == node.empty()) + { + node.value(kind::filesystem); + break; + } } } @@ -494,29 +491,31 @@ namespace nana file_container_.clear(); - using namespace nana::filesystem; - file_iterator end; - for(file_iterator i(path); i != end; ++i) - { - if((i->name.size() == 0) || (i->name[0] == '.')) - continue; - item_fs m; - m.name = i->name; + namespace fs = ::nana::experimental::filesystem; + + fs::directory_iterator end; + for(fs::directory_iterator i(path); i != end; ++i) + { + auto name = i->path().filename().native(); + if(name.empty() || (name.front() == '.')) + continue; + + item_fs m; + m.name = name; - namespace fs = ::nana::experimental::filesystem; auto fattr = fs::status(path + m.name); if(fattr.type() != fs::file_type::not_found && fattr.type() != fs::file_type::unknown) { m.bytes = fs::file_size(path + m.name); m.directory = fs::is_directory(fattr); - modified_file_time(path + m.name, m.modified_time); + ::nana::filesystem::modified_file_time(path + m.name, m.modified_time); } else { m.bytes = 0; - m.directory = i->directory; - modified_file_time(path + i->name, m.modified_time); + m.directory = fs::is_directory(*i); + ::nana::filesystem::modified_file_time(path + i->path().filename().native(), m.modified_time); } file_container_.push_back(m); @@ -554,11 +553,13 @@ namespace nana if(head.size() == 0 || head[head.size() - 1] != '/') head += '/'; - nana::filesystem::file_iterator end; - for(nana::filesystem::file_iterator i(head); i != end; ++i) + namespace fs = ::nana::experimental::filesystem; + + fs::directory_iterator end; + for(fs::directory_iterator i(head); i != end; ++i) { - if(i->directory) - path_.childset(i->name, 0); + if(is_directory(*i)) + path_.childset(i->path().filename().native(), 0); } auto cat_path = path_.caption(); if(cat_path.size() && cat_path[cat_path.size() - 1] != '/') @@ -574,10 +575,10 @@ namespace nana (head += folder) += '/'; path_.caption(cat_path); - for(nana::filesystem::file_iterator i(head); i != end; ++i) + for(fs::directory_iterator i(head); i != end; ++i) { - if(i->directory) - path_.childset(i->name, 0); + if (is_directory(*i)) + path_.childset(i->path().filename().native(), 0); } if(pos == path.npos) @@ -809,18 +810,25 @@ namespace nana auto path = tree_.make_key_path(node, "/") + "/"; _m_resolute_path(path); - nana::filesystem::file_iterator end; - for(nana::filesystem::file_iterator i(path); i != end; ++i) + namespace fs = ::nana::experimental::filesystem; + + fs::directory_iterator end; + for (fs::directory_iterator i{path}; i != end; ++i) { - if((false == i->directory) || (i->name.size() && i->name[0] == '.')) continue; - auto child = node.append(i->name, i->name, kind::filesystem); + auto name = i->path().filename().native(); + if((!is_directory(*i)) || (name.size() && name[0] == '.')) + continue; + + auto child = node.append(name, name, kind::filesystem); if(!child.empty()) { - for(nana::filesystem::file_iterator u(path + i->name); u != end; ++u) + for(fs::directory_iterator u(i->path()); u != end; ++u) { - if(false == u->directory || (u->name.size() && u->name[0] == '.')) continue; + auto uname = i->path().filename().native(); + if ((!is_directory(*i)) || (uname.size() && uname[0] == '.')) + continue; - child.append(u->name, u->name, kind::filesystem); + child.append(uname, uname, kind::filesystem); break; } } @@ -1047,7 +1055,7 @@ namespace nana wfile.resize(std::wcslen(wfile.data())); impl_->file = utf8_cast(wfile); -#elif defined(NANA_LINUX) || defined(NANA_MACOS) +#elif defined(NANA_POSIX) filebox_implement fb(impl_->owner, impl_->open_or_save, impl_->title); if(impl_->filters.size()) diff --git a/source/gui/programming_interface.cpp b/source/gui/programming_interface.cpp index 2185ebd9..df81e737 100644 --- a/source/gui/programming_interface.cpp +++ b/source/gui/programming_interface.cpp @@ -1168,24 +1168,6 @@ namespace API return reinterpret_cast(ts_wd); } - /* - //glass_window deprecated - //@brief: Test a window whether it is a glass attribute. - bool glass_window(window wd) - { - return (bground_mode::basic == effects_bground_mode(wd)); - } - - bool glass_window(window wd, bool isglass) //deprecated - { - if(isglass) - effects_bground(wd, effects::bground_transparent(0), 0); - else - effects_bground_remove(wd); - return true; - } - */ - void take_active(window wd, bool active, window take_if_active_false) { auto const iwd = reinterpret_cast(wd);