Files
libbsarch/cpp/utils/convertible_ostream.hpp
T
Deorder 6dbe006156 Reorganized directories
Readded .editorconfig
C wrapper can be built again
Delphi library can be built again
Initial cleanup of cmake files
2020-08-22 02:48:32 +02:00

38 lines
1.1 KiB
C++

/* Copyright (C) 2019 G'k
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#pragma once
#include "convertible_string.hpp"
#include <iostream>
namespace libbsarch {
class convertible_ostream
{
public:
convertible_ostream &operator<<(const std::string &rh);
convertible_ostream &operator<<(const char *rh);
convertible_ostream &operator<<(const char rh);
convertible_ostream &operator<<(const std::wstring &rh);
convertible_ostream &operator<<(const void *rh);
convertible_ostream &operator<<(const convertible_string &rh);
template<typename number, //real type
typename = typename std::enable_if<std::is_arithmetic<number>::value, number>::type>
convertible_ostream &operator<<(const number &num)
{
std::cout << num;
return *this;
}
operator std::ostream &();
operator std::wostream &();
#ifdef QT
operator QDebug();
convertible_ostream &operator<<(const QString &rh);
#endif
};
} // namespace libbsarch