Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.9 KiB

  1. /*--------------------------------------------------------------------------*
  2. *
  3. * Microsoft Windows
  4. * Copyright (C) Microsoft Corporation, 1992 - 1999
  5. *
  6. * File: stgio.h
  7. *
  8. * Contents: Interface file structured storage I/O utilities
  9. *
  10. * History: 25-Jun-98 jeffro Created
  11. *
  12. *--------------------------------------------------------------------------*/
  13. #ifndef STGIO_H
  14. #define STGIO_H
  15. #pragma once
  16. #include <objidl.h> // for IStream
  17. #include <string> // for std::string, std::wstring
  18. #include <list> // for std::list
  19. #include <vector> // for std::vector
  20. #include <deque> // for std::deque
  21. #include <map> // for std::map, std::multimap
  22. #include <set> // for std::set, std::multiset
  23. #define DeclareStreamOperators(type) \
  24. IStream& operator>> (IStream& stm, type& t); \
  25. IStream& operator<< (IStream& stm, type t);
  26. #define DeclareStreamOperatorsByRef(type) \
  27. IStream& operator>> (IStream& stm, type& t); \
  28. IStream& operator<< (IStream& stm, const type& t);
  29. /*
  30. * Writing these small types by value allows convenient usage with
  31. * literals and constants like:
  32. *
  33. * str << (char) 'a';
  34. *
  35. * instead of the bulkier and less convenient:
  36. *
  37. * char ch = 'a';
  38. * str << ch;
  39. */
  40. DeclareStreamOperators (bool);
  41. DeclareStreamOperators ( char);
  42. DeclareStreamOperators (unsigned char);
  43. DeclareStreamOperators ( short);
  44. DeclareStreamOperators (unsigned short);
  45. DeclareStreamOperators ( int);
  46. DeclareStreamOperators (unsigned int);
  47. DeclareStreamOperators ( long);
  48. DeclareStreamOperators (unsigned long);
  49. DeclareStreamOperators ( __int64);
  50. DeclareStreamOperators (unsigned __int64);
  51. DeclareStreamOperators (float);
  52. DeclareStreamOperators (double);
  53. DeclareStreamOperators (long double);
  54. /*
  55. * These are relatively large and unlikely to be used with literals,
  56. * so write by const reference
  57. */
  58. DeclareStreamOperatorsByRef (CLSID);
  59. DeclareStreamOperatorsByRef (std::string);
  60. DeclareStreamOperatorsByRef (std::wstring);
  61. template<class T1, class T2>
  62. IStream& operator>> (IStream& stm, std::pair<T1, T2>& p);
  63. template<class T1, class T2>
  64. IStream& operator<< (IStream& stm, const std::pair<T1, T2>& p);
  65. template<class T, class Al>
  66. IStream& operator>> (IStream& stm, std::list<T, Al>& l);
  67. template<class T, class Al>
  68. IStream& operator<< (IStream& stm, const std::list<T, Al>& l);
  69. template<class T, class Al>
  70. IStream& operator>> (IStream& stm, std::deque<T, Al>& d);
  71. template<class T, class Al>
  72. IStream& operator<< (IStream& stm, const std::deque<T, Al>& d);
  73. template<class T, class Al>
  74. IStream& operator>> (IStream& stm, std::vector<T, Al>& v);
  75. template<class T, class Al>
  76. IStream& operator<< (IStream& stm, const std::vector<T, Al>& v);
  77. template<class T, class Pr, class Al>
  78. IStream& operator>> (IStream& stm, std::set<T, Pr, Al>& s);
  79. template<class T, class Pr, class Al>
  80. IStream& operator<< (IStream& stm, const std::set<T, Pr, Al>& s);
  81. template<class T, class Pr, class Al>
  82. IStream& operator>> (IStream& stm, std::multiset<T, Pr, Al>& s);
  83. template<class T, class Pr, class Al>
  84. IStream& operator<< (IStream& stm, const std::multimap<T, Pr, Al>& s);
  85. template<class K, class T, class Pr, class Al>
  86. IStream& operator>> (IStream& stm, std::map<K, T, Pr, Al>& m);
  87. template<class K, class T, class Pr, class Al>
  88. IStream& operator<< (IStream& stm, const std::map<K, T, Pr, Al>& m);
  89. template<class K, class T, class Pr, class Al>
  90. IStream& operator>> (IStream& stm, std::multimap<K, T, Pr, Al>& m);
  91. template<class K, class T, class Pr, class Al>
  92. IStream& operator<< (IStream& stm, const std::multimap<K, T, Pr, Al>& m);
  93. #include "stgio.inl"
  94. #endif /* STGIO_H */