GithubHelp home page GithubHelp logo

sudo-rahman / rclone_cpp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 308 KB

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: MIT License

CMake 1.15% C++ 96.80% Python 2.05%

rclone_cpp's Introduction

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;
}

rclone_cpp's People

Contributors

sudo-rahman avatar phaired avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.