sstream.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
  2. /******************************************************************************
  3. *
  4. * file: sstream.h
  5. *
  6. * Copyright (c) 2003, Michael E. Smoot .
  7. * Copyright (c) 2004, Michael E. Smoot, Daniel Aarno .
  8. * Copyright (c) 2017 Google Inc.
  9. * All rights reserved.
  10. *
  11. * See the file COPYING in the top directory of this distribution for
  12. * more information.
  13. *
  14. * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
  15. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. *
  22. *****************************************************************************/
  23. #ifndef TCLAP_SSTREAM_H
  24. #define TCLAP_SSTREAM_H
  25. #if !defined(HAVE_STRSTREAM)
  26. // Assume sstream is available if strstream is not specified
  27. // (https://sourceforge.net/p/tclap/bugs/23/)
  28. #define HAVE_SSTREAM
  29. #endif
  30. #if defined(HAVE_SSTREAM)
  31. #include <sstream>
  32. namespace TCLAP {
  33. typedef std::istringstream istringstream;
  34. typedef std::ostringstream ostringstream;
  35. }
  36. #elif defined(HAVE_STRSTREAM)
  37. #include <strstream>
  38. namespace TCLAP {
  39. typedef std::istrstream istringstream;
  40. typedef std::ostrstream ostringstream;
  41. }
  42. #else
  43. #error "Need a stringstream (sstream or strstream) to compile!"
  44. #endif
  45. #endif // TCLAP_SSTREAM_H