int_list_parser.hpp 843 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
/*******************************************************************************
 * Copyright 2019 UChicago Argonne, LLC.
 * (c.f. AUTHORS, LICENSE)
 *
 * This file is part of the Argo containers project.
 * For more info, see https://xgitlab.cels.anl.gov/argo/containers
 *
 * SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/

Swann Perarnau's avatar
Swann Perarnau committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#ifndef __INT_LIST_PARSER_HPP__
#define __INT_LIST_PARSER_HPP__
#include <string>
#include <vector>

using std::string;
using std::vector;

class Int_list_parser
{
	private:
		bool _has_stride;

		void expand_range(const string& input, vector<int>& out);
				
	public:
		Int_list_parser();
		~Int_list_parser(){};
		void convert_to_comprehensive(const string& input, vector<int>& out,
				bool append=false);
};
#endif //__INT_LIST_PARSER_HPP__