/*--------------------------------------------------------------------------* * * Microsoft Windows * Copyright (C) Microsoft Corporation, 1992 - 1999 * * File: stgio.h * * Contents: Interface file structured storage I/O utilities * * History: 25-Jun-98 jeffro Created * *--------------------------------------------------------------------------*/ #ifndef STGIO_H #define STGIO_H #pragma once #include // for IStream #include // for std::string, std::wstring #include // for std::list #include // for std::vector #include // for std::deque #include // for std::map, std::multimap #include // for std::set, std::multiset #define DeclareStreamOperators(type) \ IStream& operator>> (IStream& stm, type& t); \ IStream& operator<< (IStream& stm, type t); #define DeclareStreamOperatorsByRef(type) \ IStream& operator>> (IStream& stm, type& t); \ IStream& operator<< (IStream& stm, const type& t); /* * Writing these small types by value allows convenient usage with * literals and constants like: * * str << (char) 'a'; * * instead of the bulkier and less convenient: * * char ch = 'a'; * str << ch; */ DeclareStreamOperators (bool); DeclareStreamOperators ( char); DeclareStreamOperators (unsigned char); DeclareStreamOperators ( short); DeclareStreamOperators (unsigned short); DeclareStreamOperators ( int); DeclareStreamOperators (unsigned int); DeclareStreamOperators ( long); DeclareStreamOperators (unsigned long); DeclareStreamOperators ( __int64); DeclareStreamOperators (unsigned __int64); DeclareStreamOperators (float); DeclareStreamOperators (double); DeclareStreamOperators (long double); /* * These are relatively large and unlikely to be used with literals, * so write by const reference */ DeclareStreamOperatorsByRef (CLSID); DeclareStreamOperatorsByRef (std::string); DeclareStreamOperatorsByRef (std::wstring); template IStream& operator>> (IStream& stm, std::pair& p); template IStream& operator<< (IStream& stm, const std::pair& p); template IStream& operator>> (IStream& stm, std::list& l); template IStream& operator<< (IStream& stm, const std::list& l); template IStream& operator>> (IStream& stm, std::deque& d); template IStream& operator<< (IStream& stm, const std::deque& d); template IStream& operator>> (IStream& stm, std::vector& v); template IStream& operator<< (IStream& stm, const std::vector& v); template IStream& operator>> (IStream& stm, std::set& s); template IStream& operator<< (IStream& stm, const std::set& s); template IStream& operator>> (IStream& stm, std::multiset& s); template IStream& operator<< (IStream& stm, const std::multimap& s); template IStream& operator>> (IStream& stm, std::map& m); template IStream& operator<< (IStream& stm, const std::map& m); template IStream& operator>> (IStream& stm, std::multimap& m); template IStream& operator<< (IStream& stm, const std::multimap& m); #include "stgio.inl" #endif /* STGIO_H */