ADMB Documentation  11.1.2428
 All Classes Files Functions Variables Typedefs Friends Defines
prn_t.h
Go to the documentation of this file.
00001 /*
00002  * $Id: prn_t.h 1919 2014-04-22 22:02:01Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  *
00007  * ADModelbuilder and associated libraries and documentations are
00008  * provided under the general terms of the "BSD" license.
00009  *
00010  * License:
00011  *
00012  * Redistribution and use in source and binary forms, with or without
00013  * modification, are permitted provided that the following conditions are
00014  * met:
00015  *
00016  * 1. Redistributions of source code must retain the above copyright
00017  * notice, this list of conditions and the following disclaimer.
00018  *
00019  * 2.  Redistributions in binary form must reproduce the above copyright
00020  * notice, this list of conditions and the following disclaimer in the
00021  * documentation and/or other materials provided with the distribution.
00022  *
00023  * 3.  Neither the name of the  University of California, Otter Research,
00024  * nor the ADMB Foundation nor the names of its contributors may be used
00025  * to endorse or promote products derived from this software without
00026  * specific prior written permission.
00027  *
00028  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00029  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00030  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00031  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00032  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00033  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00034  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00035  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00036  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00038  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  */
00041 #include <string.h>
00042 #include <stdlib.h>
00043 #include <stdio.h>
00044 
00045 #ifdef __ZTC__
00046   #include <fstream.hpp>
00047 #else
00048   #include <fstream.h>
00049 #endif
00050 
00051 #ifndef PRN_T
00052 #define PRN_T
00053 class prnstream : public ofstream
00054 {
00055 private:
00056   int count;
00057   void outstr(const char*, const char q = '\0');
00058 public:
00059   prnstream(const char* fn);
00060 
00061   prnstream& put(char);
00062 
00063 //  prnstream& operator << (const char);
00064   prnstream& operator << (const char*);
00065   prnstream& operator << (const int);
00066   prnstream& operator << (const long);
00067   prnstream& operator << (const float);
00068   prnstream& operator << (const double);
00069 
00070   prnstream& operator<< (prnstream& (*fn)(prnstream &));
00071 //  prnstream& operator<< (ios& (*_f)(ios&));
00072 };
00073 
00074 inline prnstream& prnstream::operator<< (prnstream& (*_f)(prnstream &))
00075   { return (*_f)(*this); }
00076 
00077 prnstream& endl(prnstream&);
00078 
00079 #endif // #ifndef PRN_T