0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00
openvpn3/openvpn/common/ostream.hpp
James Yonan 4d9a751af2 Added head comments to all source files.
Minor reorganization of unicode code.
2012-11-23 06:18:43 +00:00

28 lines
652 B
C++

//
// ostream.hpp
// OpenVPN
//
// Copyright (c) 2012 OpenVPN Technologies, Inc. All rights reserved.
//
// A helper macro for setting up an arbitrary class
// to support stringstream concatenation using <<
#ifndef OPENVPN_COMMON_OSTREAM_H
#define OPENVPN_COMMON_OSTREAM_H
#include <ostream>
#include <string>
#define OPENVPN_OSTREAM(TYPE, TO_STRING) \
template <typename Elem, typename Traits> \
std::basic_ostream<Elem, Traits>& operator<<( \
std::basic_ostream<Elem, Traits>& os, const TYPE& addr) \
{ \
std::string s = addr.TO_STRING(); \
os << s; \
return os; \
}
#endif // OPENVPN_COMMON_OSTREAM_H