8000 GitHub - Sudo-Rahman/rclone_cpp: rclone_cpp is a C++ library for rclone. Execute rclone commands, add parser to transform the output of command on object, add options to the command, etc.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rclone_cpp is a C++ library for rclone. Execute rclone commands, add parser to transform the output of command on object, add options to the command, etc.

License

Notifications You must be signed in to change notification settings

Sudo-Rahman/rclone_cpp

Repository files navigation

rclone_cpp Build and Test

rclone_cpp is a C++ library for rclone. Execute rclone commands, add parser to transform the output of command on object, add options to the command, etc.

Features

Most of commands of rclone are supported.

  • version
  • listremotes
  • delete remote
  • config
  • lsjson
  • lsf
  • ls
  • lsl
  • lsd
  • lsf
  • copyto
  • moveto
  • delete
  • mkdir
  • cat
  • about
  • size
  • tree
  • bisync
  • cleanup
  • copyurl
  • check

How to it works

"process" class contains all functions for execute command, get output string, exit code, etc. You can add options to the command using the "basic_option" class. or create your own option class by inheriting from the " basic_option" class. If you want to transform the output of command on object, "parsers" contains many parser for parse the output of command, but if you want to create your own parser, you can do it by inheriting from the "basic_parser" class.

Installation

Dependencies

Build

git clone https://github.com/Sudo-Rahman/rclone_cpp.git
cd rclone_cpp
conan install . --build=missing
conan create .

After this, the library will be available in your local conan cache.

Import

You need to use conan to import the library in cmake.

ConanFile.txt

[requires]
rclone_cpp/[>=0.1.0]

[generators]
CMakeDeps
CMakeToolchain

CmakeLists.txt

find_package(rclone_cpp)

target_link_libraries(your_target PRIVATE rclone_cpp::rclone_cpp)

Usage

#include <iostream>
#include <iridium/rclone.hpp>

auto main() -> int
{
	process::initialize();

	auto rclone = ir::process();

	auto remote = ire::remote::create_shared_ptr("test", ire::remote::remote_type::google_drive, "");
	auto root_file = ire::file{
					nullptr, "/", 0, true, std::chrono::system_clock::now(),
					remote
			};

	process::add_global_option(iro::listing::fast_list());


    auto f_parser = irp::file_parser::ptr(&root_file,
                            [](const ire::file &file)
                            {
                                std::cout << file << std::endl;
                            },   irp::file_parser::json);

	rclone.lsjson(root_file)
			.every_line_parser(f_parser)
			.execute()
			.wait_for_start()
			.wait_for_finish();
			
	return 0;
}

About

rclone_cpp is a C++ library for rclone. Execute rclone commands, add parser to transform the output of command on object, add options to the command, etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0