/staticlib_tinydir

Staticlibs directory reader library

Primary LanguageC++Apache License 2.0Apache-2.0

tinydir library wrapper and file IO for Staticlibs

travis appveyor

This project is a part of Staticlibs.

This library implements filesystem directory reading, path manipulation and file IO operations, it is built on top of tinydir library. file_source and file_sink classes can be used as Source and Sink with staticlib_io API.

Link to the API documentation.

Usage example

List directory:

auto vec = sl::tinydir::list_directory("path/to/dir/");
for (auto& el : vec) {
    std::cout << el.filename() << std::endl;
    std::cout << el.filepath() << std::endl;
    std::cout << el.is_directory() << std::endl;
    std::cout << el.is_regular_file() << std::endl;
}

How to build

CMake is required for building.

pkg-config utility is used for dependency management. For Windows users ready-to-use binary version of pkg-config can be obtained from tools_windows_pkgconfig repository. See StaticlibsPkgConfig for Staticlibs-specific details about pkg-config usage.

To build the library on Windows using Visual Studio 2013 Express run the following commands using Visual Studio development command prompt (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts\VS2013 x86 Native Tools Command Prompt):

git clone https://github.com/staticlibs/staticlib_config.git
git clone https://github.com/staticlibs/staticlib_support.git
git clone https://github.com/staticlibs/staticlib_io.git
git clone https://github.com/staticlibs/staticlib_utils.git
git clone https://github.com/staticlibs/staticlib_tinydir.git
git clone https://github.com/staticlibs/tinydir.git
cd staticlib_tinydir
mkdir build
cd build
cmake ..
msbuild staticlib_tinydir.sln

See StaticlibsToolchains for more information about the toolchain setup and cross-compilation.

License information

This project is released under the Apache License 2.0.

Changelog

2019-04-05

  • version 1.2.6
  • minor windows fix

2019-03-25

  • version 1.2.5
  • allow to delete read-only files on Windows

2018-10-18

  • version 1.2.4
  • file_sink API minor changes

2018-10-18

  • version 1.2.3
  • file_sink write from file support

2018-09-05

  • version 1.2.2
  • use 644 permission for file_sink
  • symlinks support

2018-02-28

  • version 1.2.1
  • submodule dropped

2017-12-24

  • version 1.2.0
  • file IO operations
  • path manipulation operations
  • vs2017 support

2017-04-08

  • version 1.1.0
  • classes renamed

2016-09-06

  • version 1.0
  • initial public version