/**
 * File:   session.h
 * Author: Alexander Ksenofontov <aksenofo@yahoo.ru>
 *
 * Created on August 12, 2016, 14:13 PM
 */

#pragma once

#include <string>
#include <nan.h>
#include "tohaux.h"
#include "declarations.h"

class Session : public Nan::ObjectWrap {

public:
    struct remote_info {
	std::string http_url_;
	std::string torrent_url_;
	std::string local_root_;
    };

public:

    Session( const remote_info& ri)
    : ri_(ri)
    {}

    static NAN_MODULE_INIT(Init);

    static NAN_METHOD(New); // constructor

    static NAN_METHOD(Synchronize); // constructor

    static Nan::Persistent<v8::Function> constructor;

    DECL_READONLY_STR(Session, HttpUrl, ri_.http_url_);
    DECL_READONLY_STR(Session, TorrentUrl, ri_.torrent_url_);
    DECL_READONLY_STR(Session, LocalRoot, ri_.local_root_);

private:
    remote_info ri_;
};
