/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2019 Danny Robson */ #include "emory/chunk/map.hpp" #include "emory/chunk/params.hpp" #include #include #include #include /////////////////////////////////////////////////////////////////////////////// enum { ARG_SELF, ARG_BITS, ARG_WINDOW, ARGS_MINIMUM, ARGS_INPUT, NUM_ARGS, }; //----------------------------------------------------------------------------- int main (int argc, char const **argv) { if (argc != NUM_ARGS) { std::cerr << "usage: " << argv[ARG_SELF] << " \n"; return EXIT_FAILURE; } emory::chunk::params const p { .bits = cruft::parse::from_string (argv[ARG_BITS ]), .window = cruft::parse::from_string (argv[ARG_WINDOW]), .minimum = cruft::parse::from_string (argv[ARGS_MINIMUM]), }; cruft::mapped_file data (argv[ARGS_INPUT]); emory::chunk::map src (data, p); std::cout << src.size () << " chunks\n"; }