ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
prn_t.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  *
7  * ADModelbuilder and associated libraries and documentations are
8  * provided under the general terms of the "BSD" license.
9  *
10  * License:
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are
14  * met:
15  *
16  * 1. Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  *
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in the
21  * documentation and/or other materials provided with the distribution.
22  *
23  * 3. Neither the name of the University of California, Otter Research,
24  * nor the ADMB Foundation nor the names of its contributors may be used
25  * to endorse or promote products derived from this software without
26  * specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  *
40  */
41 #include <string.h>
42 #include <stdlib.h>
43 #include <stdio.h>
44 
45 #ifdef __ZTC__
46  #include <fstream.hpp>
47 #else
48  #include <fstream.h>
49 #endif
50 
51 #ifndef PRN_T
52 #define PRN_T
53 class prnstream : public ofstream
54 {
55 private:
56  int count;
57  void outstr(const char*, const char q = '\0');
58 public:
59  prnstream(const char* fn);
60 
61  prnstream& put(char);
62 
63 // prnstream& operator << (const char);
64  prnstream& operator << (const char*);
65  prnstream& operator << (const int);
66  prnstream& operator << (const long);
67  prnstream& operator << (const float);
68  prnstream& operator << (const double);
69 
71 // prnstream& operator<< (ios& (*_f)(ios&));
72 };
73 
75  { return (*_f)(*this); }
76 
78 
79 #endif // #ifndef PRN_T
prnstream & put(char)
prnstream & operator<<(const char *)
int count
Definition: prn_t.h:56
prnstream & endl(prnstream &)
prnstream(const char *fn)
void outstr(const char *, const char q= '\0')