<commit_before>#include <iostream>

#include <SFML/Graphics.hpp>

void printUsage(std::string const & filename)
{
	std::cout << "Usage:\n"
		<< "\t" << filename << " <model.b3d>" << std::endl;
}

int main(int argc, char * argv[])
{
	std::vector<std::string> const arguments(argv, argv + argc);
	if (arguments.size() < 2) {
		printUsage(arguments[0]);
		std::exit(1);
	}

	sf::ContextSettings contextSettings;
	contextSettings.depthBits = 24;
	contextSettings.stencilBits = 0;
	contextSettings.antialiasingLevel = 0;
	contextSettings.majorVersion = 2;
	contextSettings.minorVersion = 1;

	std::string title = ".b3d Preview: ";
	title += arguments[1];

	sf::RenderWindow window(
		sf::VideoMode(800, 600, 32), title, sf::Style::Default, contextSettings);

	while (window.isOpen()) {
		sf::Event event;
		while (window.pollEvent(event)) {
			if (event.type == sf::Event::Closed) {
				window.close();
			}
		}

		window.clear();

		window.display();
	}

	return 0;
}
<commit_msg>Little changes for b3dpreview tool<commit_after>// Build me:
// g++ -std=c++14 -Wall -Wextra -Wpedantic -I../source/ ./b3dpreview.cpp ../source/common/ByteBuffer.cpp ../source/common/FileSystem.cpp ../source/common/RingBuffer.cpp -o b3dpreview -lsfml-system -lsfml-graphics -lsfml-window

#include <iostream>

#include <SFML/Graphics.hpp>

#include "common/FileSystem.h"
#include "common/ByteBuffer.h"

class Model
{
public:
	Model(std::string const & filename) {
		loadFromFile(filename);
	}

	void loadFromFile(std::string const & filename) {
		ByteBuffer buffer(fs::getFileSize(filename));
		if (!fs::loadFile(filename, buffer)) {
			std::exit(1);
		}
	}
};

void showModel(Model const &) {
	// sf::ContextSettings contextSettings;
	// contextSettings.depthBits = 24;
	// contextSettings.stencilBits = 0;
	// contextSettings.antialiasingLevel = 0;
	// contextSettings.majorVersion = 2;
	// contextSettings.minorVersion = 1;

	// std::string title = ".b3d Preview: ";
	// title += arguments[1];

	// sf::RenderWindow window(
	// 	sf::VideoMode(800, 600, 32), title, sf::Style::Default, contextSettings);

	// while (window.isOpen()) {
	// 	sf::Event event;
	// 	while (window.pollEvent(event)) {
	// 		if (event.type == sf::Event::Closed) {
	// 			window.close();
	// 		}
	// 	}

	// 	window.clear();

	// 	window.display();
	// }
}

void printUsage(std::string const & filename) {
	std::cout << "Usage:\n"
		<< "\t" << filename << " <model.b3d>" << std::endl;
}

int main(int argc, char * argv[]) {
	std::vector<std::string> const arguments(argv, argv + argc);
	if (arguments.size() < 2) {
		printUsage(arguments[0]);
		std::exit(1);
	}

	Model model(arguments[1]);
	showModel(model);

	return 0;
}

{'fraction_non_alphanumeric': 0.18558625840179238, 'fraction_numerical': 0.018297236743838687, 'mean_word_length': 4.007476635514019, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 11, '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': '7517733', 'n_tokens_mistral': 1035, 'n_tokens_neox': 952, 'n_words': 187}