itkstringstream.cxx

来自「InsightToolkit-1.4.0(有大量的优化算法程序)」· CXX 代码 · 共 61 行

CXX
61
字号
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile: itkStringStream.cxx,v $
  Language:  C++
  Date:      $Date: 2003/09/10 14:30:12 $
  Version:   $Revision: 1.2 $

  Copyright (c) Insight Software Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#include "itkStringStream.h"
#include <iostream>

namespace itk
{

/**
 * Default constructor.  Use this to create a re-usable instance.
 */
StringStream::StringStream()
{
}


/**
 * Destructor will set the  result to the string value if an
 * interpreter was provided to the constructor, and GetString() and
 * Reset() were never called.
 */
StringStream::~StringStream() 
{
}


/**
 * Get the string that has been written to the stream.  This disables
 * further writing until Reset() is called.
 */
const char* StringStream::GetString()
{
  m_String = this->str();
  return m_String.c_str();
}


/**
 * Reset the stream to accept new input starting from an empty string.
 */
void StringStream::Reset()
{
  this->seekp(0, std::ios::beg);    
}

} // namespace itk

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?