00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1999, 2002, 2005, 2006, 2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef LIBAEGIS_OUTPUT_MEMORY_H 00021 #define LIBAEGIS_OUTPUT_MEMORY_H 00022 00023 #include <common/nstring/accumulator.h> 00024 #include <libaegis/output.h> 00025 00030 class output_memory: 00031 public output 00032 { 00033 public: 00034 typedef aegis_shared_ptr<output_memory> mpointer; 00035 00039 virtual ~output_memory(); 00040 00041 private: 00046 output_memory(); 00047 00048 public: 00053 static mpointer create(); 00054 00065 void forward(output::pointer deeper); 00066 00076 nstring mkstr(); 00077 00078 protected: 00079 // See base class for documentation. 00080 nstring filename() const; 00081 00082 // See base class for documentation. 00083 const char *type_name() const; 00084 00085 // See base class for documentation. 00086 long ftell_inner() const; 00087 00088 // See base class for documentation. 00089 void write_inner(const void *data, size_t length); 00090 00091 // See base class for documentation. 00092 void end_of_line_inner(); 00093 00094 private: 00100 nstring_accumulator buffer; 00101 00105 output_memory(const output_memory &); 00106 00110 output_memory &operator=(const output_memory &); 00111 }; 00112 00113 #endif // LIBAEGIS_OUTPUT_MEMORY_H