<commit_before>/*
 * cportconf_file.hpp
 *
 *  Created on: 16.10.2014
 *      Author: andreas
 */

#ifndef CPORTCONF_FILE_HPP_
#define CPORTCONF_FILE_HPP_

#include <string>
#include <ostream>
#include <libconfig.h++>
#include <roflibs/ethcore/cportdb.hpp>
#include <roflibs/netlink/cconfig.hpp>

namespace roflibs {
namespace ethernet {

class cportdb_file : public cportdb {
public:

	/**
	 *
	 */
	cportdb_file() { read_config(); };

	/**
	 *
	 */
	virtual ~cportdb_file() {};

private:

	/**
	 *
	 */
	void
	read_config();

	/**
	 *
	 */
	void
	parse_datapath(ethcore::cconfig& config, libconfig::Setting& datapath);

	/**
	 *
	 */
	void
	parse_datapath_phy_port(
			ethcore::cconfig& config, libconfig::Setting& port,
			const rofl::cdpid& dpid, uint16_t pvid);

	/**
	 *
	 */
	void
	parse_datapath_eth_endpnt(
			ethcore::cconfig& config, libconfig::Setting& endpnt,
			const rofl::cdpid& dpid, uint16_t pvid);

private:

	static const std::string 		ETHCORE_CONFIG_DPT_LIST;
	static const std::string 		DEFAULT_CONFIG_FILE;
	static const uint16_t			DEFAULT_PORT_VID;

	std::string 					config_file;
	uint16_t						port_vid;
};

}; // end of namespace ethernet
}; // end of namespace roflibs

#endif /* CPORTCONF_FILE_HPP_ */
<commit_msg>cportdb_file => output operator implemented<commit_after>/*
 * cportconf_file.hpp
 *
 *  Created on: 16.10.2014
 *      Author: andreas
 */

#ifndef CPORTCONF_FILE_HPP_
#define CPORTCONF_FILE_HPP_

#include <string>
#include <ostream>
#include <libconfig.h++>
#include <roflibs/ethcore/cportdb.hpp>
#include <roflibs/netlink/cconfig.hpp>

namespace roflibs {
namespace ethernet {

class cportdb_file : public cportdb {
public:

	/**
	 *
	 */
	cportdb_file() { read_config(); };

	/**
	 *
	 */
	virtual ~cportdb_file() {};

private:

	/**
	 *
	 */
	void
	read_config();

	/**
	 *
	 */
	void
	parse_datapath(ethcore::cconfig& config, libconfig::Setting& datapath);

	/**
	 *
	 */
	void
	parse_datapath_phy_port(
			ethcore::cconfig& config, libconfig::Setting& port,
			const rofl::cdpid& dpid, uint16_t pvid);

	/**
	 *
	 */
	void
	parse_datapath_eth_endpnt(
			ethcore::cconfig& config, libconfig::Setting& endpnt,
			const rofl::cdpid& dpid, uint16_t pvid);

public:

	friend std::ostream&
	operator<< (std::ostream& os, const cportdb_file& portdb) {
		os << dynamic_cast<const cportdb&>( portdb );
		return os;
	};

private:

	static const std::string 		ETHCORE_CONFIG_DPT_LIST;
	static const std::string 		DEFAULT_CONFIG_FILE;
	static const uint16_t			DEFAULT_PORT_VID;

	std::string 					config_file;
	uint16_t						port_vid;
};

}; // end of namespace ethernet
}; // end of namespace roflibs

#endif /* CPORTCONF_FILE_HPP_ */

{'fraction_non_alphanumeric': 0.1357516828721017, 'fraction_numerical': 0.011967090501121914, 'mean_word_length': 3.8724954462659382, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 15, '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': '7374574', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1034, 'n_words': 200}