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.

158 lines
5.7 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: platformstl/filesystem/pipe.hpp
  3. *
  4. * Purpose: Platform header for the pipe components.
  5. *
  6. * Created: 20th March 2005
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2005-2009, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. #ifndef PLATFORMSTL_INCL_PLATFORMSTL_FILESYSTEM_HPP_PIPE
  40. #define PLATFORMSTL_INCL_PLATFORMSTL_FILESYSTEM_HPP_PIPE
  41. /* File version */
  42. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  43. # define PLATFORMSTL_VER_PLATFORMSTL_FILESYSTEM_HPP_PIPE_MAJOR 2
  44. # define PLATFORMSTL_VER_PLATFORMSTL_FILESYSTEM_HPP_PIPE_MINOR 1
  45. # define PLATFORMSTL_VER_PLATFORMSTL_FILESYSTEM_HPP_PIPE_REVISION 1
  46. # define PLATFORMSTL_VER_PLATFORMSTL_FILESYSTEM_HPP_PIPE_EDIT 19
  47. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  48. /** \file platformstl/filesystem/pipe.hpp
  49. *
  50. * \brief [C++ only] Definition of the platformstl::pipe type
  51. * (\ref group__library__filesystem "File System" Library).
  52. *
  53. * When compiling on UNIX platforms, the platformstl::pipe
  54. * type resolves to the unixstl::pipe class. On Windows
  55. * platforms it resolves to the winstl::pipe class. It is
  56. * not defined for other platforms.
  57. */
  58. /* /////////////////////////////////////////////////////////////////////////
  59. * Includes
  60. */
  61. #ifndef PLATFORMSTL_INCL_PLATFORMSTL_HPP_PLATFORMSTL
  62. # include <platformstl/platformstl.hpp>
  63. #endif /* !PLATFORMSTL_INCL_PLATFORMSTL_HPP_PLATFORMSTL */
  64. #if defined(PLATFORMSTL_OS_IS_UNIX)
  65. # ifndef UNIXSTL_INCL_FILESYSTEM_UNIXSTL_HPP_PIPE
  66. # include <unixstl/filesystem/pipe.hpp>
  67. # endif /* !UNIXSTL_INCL_FILESYSTEM_UNIXSTL_HPP_PIPE */
  68. #elif defined(PLATFORMSTL_OS_IS_WINDOWS)
  69. # ifndef WINSTL_INCL_FILESYSTEM_WINSTL_HPP_PIPE
  70. # include <winstl/filesystem/pipe.hpp>
  71. # endif /* !WINSTL_INCL_FILESYSTEM_WINSTL_HPP_PIPE */
  72. #else /* ? operating system */
  73. # error Operating system not discriminated
  74. #endif /* operating system */
  75. /* /////////////////////////////////////////////////////////////////////////
  76. * Namespace
  77. */
  78. #if defined(_STLSOFT_NO_NAMESPACE) || \
  79. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  80. /* There is no stlsoft namespace, so must define ::platformstl */
  81. namespace platformstl
  82. {
  83. #else
  84. /* Define stlsoft::platformstl_project */
  85. namespace stlsoft
  86. {
  87. namespace platformstl_project
  88. {
  89. #endif /* _STLSOFT_NO_NAMESPACE */
  90. /* ////////////////////////////////////////////////////////////////////// */
  91. #if defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  92. /** \brief A facade for the platform's pipe functionality.
  93. *
  94. * \ingroup group__library__filesystem
  95. *
  96. * The class is not actually defined in the
  97. * \link ::platformstl platformstl\endlink namespace. Rather, it
  98. * resolves to the appropriate type for the given platform, relying on
  99. * \ref section__principle__conformance__intersecting_conformance "Intersecting Conformance"
  100. * of the resolved platform-specific types.
  101. *
  102. * When compiling on UNIX platforms, the platformstl::pipe
  103. * type resolves to the unixstl::pipe class. On Windows
  104. * platforms it resolves to the winstl::pipe class. It
  105. * is not defined for other platforms.
  106. */
  107. class pipe
  108. {};
  109. #elif defined(PLATFORMSTL_OS_IS_UNIX)
  110. # ifdef _UNIXSTL_NO_NAMESPACE
  111. using ::pipe;
  112. # else /* ? _UNIXSTL_NO_NAMESPACE */
  113. using ::unixstl::pipe;
  114. # endif /* _UNIXSTL_NO_NAMESPACE */
  115. #elif defined(PLATFORMSTL_OS_IS_WINDOWS)
  116. # ifdef _WINSTL_NO_NAMESPACE
  117. using ::pipe;
  118. # else /* ? _WINSTL_NO_NAMESPACE */
  119. using ::winstl::pipe;
  120. # endif /* _WINSTL_NO_NAMESPACE */
  121. #else /* ? operating system */
  122. # error Operating system not discriminated
  123. #endif /* operating system */
  124. /* ////////////////////////////////////////////////////////////////////// */
  125. #if defined(_STLSOFT_NO_NAMESPACE) || \
  126. defined(STLSOFT_DOCUMENTATION_SKIP_SECTION)
  127. } // namespace platformstl
  128. #else
  129. } // namespace platformstl_project
  130. } // namespace stlsoft
  131. #endif /* _STLSOFT_NO_NAMESPACE */
  132. /* ////////////////////////////////////////////////////////////////////// */
  133. #endif /* !PLATFORMSTL_INCL_PLATFORMSTL_FILESYSTEM_HPP_PIPE */
  134. /* ///////////////////////////// end of file //////////////////////////// */