Skip to content

Commit

Permalink
[UPD] : update doc about file system interface
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Nov 25, 2023
1 parent a6e16c4 commit cc70088
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion ImGuiFileDialog
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,28 @@ to note :

</blockquote></details>

<details open><summary><h2>Api's C/C++ :</h2></summary><blockquote>
<details open><summary><h2>Custom FileSystem</h2></summary><blockquote>

### the C Api
you can use your custom file system interface.

by default IGFD come with the File System Interfaces for Dirent or std::filesystem
but you have now a FileSystem interface called IFileSystem who can be overrided with your needs
by ex for android, emscripten, or boost

2 steps :

1) create a include file who must contain :
- your override of IGFD::IFileSystem
- a define of your class name in FILE_SYSTEM_OVERRIDE (ex : #define FILE_SYSTEM_OVERRIDE FileSystemBoost)

2) define your file system include file path in the preprocessor var "CUSTOM_FILESYSTEM_INCLUDE"
ex : #define CUSTOM_FILESYSTEM_INCLUDE "src/FileSystemBoost.hpp"

you can check the DemoApp who is using an override for the Boost::filesystem

</blockquote></details>

<details open><summary><h2>C Api :</h2></summary><blockquote>

this api was sucessfully tested with CImGui

Expand Down
54 changes: 16 additions & 38 deletions cmake/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,19 @@ set(BOOST_FILESYSTEM_LIBRARIES
boost_type_traits
)

set_target_properties(boost_assert PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_atomic PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_chrono PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_container PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_context PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_contract PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_core PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_coroutine PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_date_time PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_exception PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_fiber PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_fiber_numa PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_filesystem PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_graph PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_iostreams PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_json PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_locale PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_log PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_log_setup PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_nowide PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_prg_exec_monitor PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_program_options PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_random PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_serialization PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_stacktrace_basic PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_stacktrace_noop PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_stacktrace_windbg PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_stacktrace_windbg_cached PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_system PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_test_exec_monitor PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_thread PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_timer PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_type_erasure PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_unit_test_framework PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_url PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_variant2 PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_wave PROPERTIES FOLDER 3rdparty/boost)
set_target_properties(boost_wserialization PROPERTIES FOLDER 3rdparty/boost)
## will serarhc for target with a particular prefix and will set destination folder
function(set_target_dir _PREFIX DIR TARGET_DIR)
get_property(TGTS DIRECTORY "${DIR}" PROPERTY BUILDSYSTEM_TARGETS)
string (REGEX MATCHALL "(^|;)${_PREFIX}[A-Za-z0-9_]*" _matchedVars "${TGTS}")
foreach (_var IN LISTS _matchedVars)
if (TARGET ${_var})
set_target_properties(${_var} PROPERTIES FOLDER ${TARGET_DIR})
endif()
endforeach()
get_property(SUBDIRS DIRECTORY "${DIR}" PROPERTY SUBDIRECTORIES)
foreach(SUBDIR IN LISTS SUBDIRS)
set_target_dir("${_PREFIX}" "${SUBDIR}" "${TARGET_DIR}")
endforeach()
endfunction()

set_target_dir(boost . 3rdparty/boost)

0 comments on commit cc70088

Please sign in to comment.