D.S

dev.mysql.com

MySQL: client/infix_ostream_it.h Source File

MySQL: client/infix_ostream_it.h Source File MySQL  8.0.0 Source Code Documentation Main Page Related Pages Modules Namespaces Classes Files File List File Members infix_ostream_it.h Go to the documentation of this file. 1 /* 2  Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 3  4  This program is free software; you can redistribute it and/or modify 5  it under the terms of the GNU General Public License as published by 6  the Free Software Foundation; version 2 of the License. 7  8  This program is distributed in the hope that it will be useful, 9  but WITHOUT ANY WARRANTY; without even the implied warranty of 10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11  GNU General Public License for more details. 12  13  You should have received a copy of the GNU General Public License 14  along with this program; if not, write to the Free Software 15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 17 #ifndef INFIX_OSTREAM_IT_INCLUDED 18 #define INFIX_OSTREAM_IT_INCLUDED 19 #include <ostream> 20 #include <iterator> 21 #include <string> 22  23 template <class T > 24  class infix_ostream_iterator : 25  public std::iterator<std::output_iterator_tag, T > 26 { 27 public: 28   infix_ostream_iterator (std::ostream &s) 29  : m_os (&s) 30  {} 31  32   infix_ostream_iterator (std::ostream &s, const char *d) 33  : m_os (&s), m_delimiter (d) 34  {} 35  36   infix_ostream_iterator<T > & operator= (T const &item) 37  { 38  * m_os << m_curr_delimiter << item; 39  m_curr_delimiter = m_delimiter ; 40  return *this; 41  } 42  43   infix_ostream_iterator<T > & operator* () 44  { 45  return *this; 46  } 47  48   infix_ostream_iterator<T > & operator++ () 49  { 50  return *this; 51  } 52  53   infix_ostream_iterator<T > & operator++ (int) 54  { 55  return *this; 56  } 57 private: 58   std::ostream * m_os ; 59   std::string m_curr_delimiter ; 60   std::string m_delimiter ; 61 }; 62  63 #endif 64  infix_ostream_iterator::m_delimiter std::string m_delimiter Definition: infix_ostream_it.h:60 infix_ostream_iterator::m_os std::ostream * m_os Definition: infix_ostream_it.h:58 infix_ostream_iterator::operator* infix_ostream_iterator< T > & operator*() Definition: infix_ostream_it.h:43 infix_ostream_iterator Definition: infix_ostream_it.h:24 infix_ostream_iterator::infix_ostream_iterator infix_ostream_iterator(std::ostream &s) Definition: infix_ostream_it.h:28 infix_ostream_iterator::operator= infix_ostream_iterator< T > & operator=(T const &item) Definition: infix_ostream_it.h:36 infix_ostream_iterator::operator++ infix_ostream_iterator< T > & operator++(int) Definition: infix_ostream_it.h:53 infix_ostream_iterator::infix_ostream_iterator infix_ostream_iterator(std::ostream &s, const char *d) Definition: infix_ostream_it.h:32 infix_ostream_iterator::operator++ infix_ostream_iterator< T > & operator++() Definition: infix_ostream_it.h:48 infix_ostream_iterator::m_curr_delimiter std::string m_curr_delimiter Definition: infix_ostream_it.h:59 client infix_ostream_it.h Generated by 1.8.11