osuplusplus/include/util_stream_ops.hpp
jacekpoz c5491dbc9f
refactor a huge part of the code
this allows for creating only input and output streams and allows me to
finally print out the generated config struct
2024-04-20 13:37:06 +02:00

25 lines
627 B
C++

#pragma once
#include <concepts>
#include <sstream>
#include <vector>
#include <SFML/Graphics/Color.hpp>
inline std::ostream &operator<<(std::ostream &stream, const sf::Color &color) {
stream << "Color(" << color.r << ", " << color.g << ", " << color.b << ", " << color.a << ")";
return stream;
}
template <typename T>
inline std::ostream &operator<<(std::ostream &stream, const std::vector<T> &vec) {
stream << "[";
for (size_t i = 0; i < vec.size(); ++i) {
stream << vec.at(i);
if (i != vec.size() - 1) {
stream << ", ";
}
}
stream << "]";
return stream;
}