Skip to content
xtd.io is a modern c++17 library, that allow reading and writing to files and data streams, and that provide basic file and directory support, for Windows, macOS, Linux, iOS and android.
C++ Shell CMake Batchfile Io
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs/pictures
examples
scripts Update git_pull_submodules.sh Oct 25, 2019
src Update xtd_tunit Dec 29, 2019
tests Update manual_tests.cpp Jul 22, 2019
.appveyor.yml first commit Mar 6, 2019
.codecov.yml first commit Mar 6, 2019
.codedocs first commit Mar 6, 2019
.doxygen.txt
.gitignore first commit Mar 6, 2019
.gitmodules review folders Oct 24, 2019
.travis.yml first commit Mar 6, 2019
CMakeLists.txt review folders Oct 24, 2019
LICENSE.md first commit Mar 6, 2019
README.md Replace io and io.hpp files by xtd.io and xtd.io.hpp Jul 11, 2019
install first commit Mar 6, 2019
install.cmd

README.md

tunit

Build Status Build status codecov Documented Documentation Website license Download xtd.io c++17 Windows macOS Linux iOS android

xtd.io is a modern c++17 library, that allow reading and writing to files and data streams, and that provide basic file and directory support, for Windows, macOS, Linux, iOS and android.

Features

  • File : Provides methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of std::basic_fstream objects.
  • Path : Performs operations on std::basic_string instances that contain file or directory path information. These operations are performed in a cross-platform manner. For more information see xtd.io website (or markdown documentations) and Reference Guide.

Examples

The classic first application 'Hello World'.

src/tunit_hello_world.cpp:

#include <xtd/xtd.io>
#include <iostream>
#include <string>

using namespace std;
using namespace xtd::io;

// The main entry point for the application.
int main(int argc, char* argv[]) {
  string file_name = path::combine(path::get_temp_path(), "file.txt");
  
  file::write_all_text(file_name, "Hello, World!");
  cout << file::read_all_text(file_name) << endl;
  
  file::remove(file_name);
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.3)

project(io_hello_world)
find_package(xtd.io REQUIRED)
add_executable(${PROJECT_NAME} src/io_hello_world.cpp)
target_link_libraries(${PROJECT_NAME} xtd.io)

Output:

Hello, World!

For more examples see examples

Download and install

Before running examples you must download and install tunit. To download and install it read downloads file.


© 2019 Gammasoft.

You can’t perform that action at this time.