<commit_before>#pragma once

#include "string_view.hh"

class ArgvParser {
	uint argc_;
	char** argv_;

public:
	ArgvParser(int argc, char** argv)
	   : argc_(std::max(argc - 1, 0)), argv_(argv + 1) {}

	ArgvParser(const ArgvParser&) = default;
	ArgvParser(ArgvParser&&) noexcept = default;
	ArgvParser& operator=(const ArgvParser&) = default;
	ArgvParser& operator=(ArgvParser&&) noexcept = default;

	uint size() const noexcept { return argc_; }

	CStringView operator[](uint n) const noexcept {
		return (n < argc_ ? CStringView(argv_[n]) : CStringView());
	}

	CStringView next() const noexcept { return operator[](0); }

	CStringView extract_next() noexcept {
		if (argc_ > 0) {
			--argc_;
			return CStringView(argv_++[0]);
		} else {
			return {};
		}
	}
};
<commit_msg>ArgvParser: made it not skip the first argument and made it accept const char**<commit_after>#pragma once

#include "string_view.hh"

class ArgvParser {
	uint argc_;
	const char* const* argv_;

public:
	ArgvParser(int argc, const char* const* argv)
	   : argc_(std::max(argc, 0)), argv_(argv) {}

	ArgvParser(const ArgvParser&) = default;
	ArgvParser(ArgvParser&&) noexcept = default;
	ArgvParser& operator=(const ArgvParser&) = default;
	ArgvParser& operator=(ArgvParser&&) noexcept = default;

	uint size() const noexcept { return argc_; }

	CStringView operator[](uint n) const noexcept {
		return (n < argc_ ? CStringView(argv_[n]) : CStringView());
	}

	CStringView next() const noexcept { return operator[](0); }

	CStringView extract_next() noexcept {
		if (argc_ > 0) {
			--argc_;
			return CStringView(argv_++[0]);
		} else {
			return {};
		}
	}
};

{'fraction_non_alphanumeric': 0.1446886446886447, 'fraction_numerical': 0.006105006105006105, 'mean_word_length': 4.593856655290103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '623069', 'n_tokens_mistral': 606, 'n_tokens_neox': 573, 'n_words': 149}