Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.
/ xtd_io Public archive

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.

License

Notifications You must be signed in to change notification settings

gammasoft71/xtd_io

Repository files navigation

io

xtd_io was merged into xtd.

Build Status Build status Reference Guide Documentation Website license

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.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published