mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-03-06 14:27:44 +00:00
Added Write() method to write buffer to an ostream, and added an ostream operator overload
This commit is contained in:
parent
1dc360a8b0
commit
5652aab91f
|
@ -4,6 +4,12 @@
|
|||
|
||||
namespace Util
|
||||
{
|
||||
std::ostream &operator<<(std::ostream &os, const Format &format)
|
||||
{
|
||||
format.Write(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
std::string ToLower(const std::string &str)
|
||||
{
|
||||
std::string tmp(str);
|
||||
|
|
|
@ -29,6 +29,11 @@ namespace Util
|
|||
return m_stream.str();
|
||||
}
|
||||
|
||||
void Write(std::ostream &os) const
|
||||
{
|
||||
os << m_stream.rdbuf();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
Format &Join(const T &collection)
|
||||
{
|
||||
|
@ -86,6 +91,7 @@ namespace Util
|
|||
}
|
||||
};
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const Format &format);
|
||||
std::string ToLower(const std::string &str);
|
||||
std::string TrimWhiteSpace(const std::string &str);
|
||||
std::string Hex(uint32_t n, size_t num_digits);
|
||||
|
@ -94,4 +100,5 @@ namespace Util
|
|||
std::string Hex(uint8_t n);
|
||||
} // Util
|
||||
|
||||
|
||||
#endif // INCLUDED_FORMAT_H
|
||||
|
|
Loading…
Reference in a new issue