xref: /trunk/main/autodoc/inc/cosv/csv_ostream.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef CSV_CSV_OSTREAM_HXX
29 #define CSV_CSV_OSTREAM_HXX
30 
31 // USED SERVICES
32 	// BASE CLASSES
33 	// COMPONENTS
34 	// PARAMETERS
35 
36 
37 
38 #ifndef CSV_NO_IOSTREAMS
39 
40 #include <iostream>
41 
42 
43 namespace csv
44 {
45 
46 typedef std::ios        ios;
47 typedef std::ostream    ostream;
48 
49 }   // namespace csv
50 
51 
52 #else
53 
54 #include <cosv/tpl/dyn.hxx>
55 
56 namespace csv
57 {
58 
59 class StreamStr;
60 
61 class ios
62 {
63   public:
64     enum seek_dir
65     {
66         beg=0,
67         cur=1,
68         end=2
69     };
70 };
71 
72 class ostream : public ios
73 {
74   public:
75     typedef ostream     self;
76 
77     virtual             ~ostream();
78 
79     self &              operator<<(
80                             const char *        i_s );
81     self &              operator<<(
82                             char                i_c );
83     self &              operator<<(
84                             unsigned char       i_c );
85     self &              operator<<(
86                             signed char         i_c );
87 
88     self &              operator<<(
89                             short               i_n );
90     self &              operator<<(
91                             unsigned short      i_n );
92     self &              operator<<(
93                             int                 i_n );
94     self &              operator<<(
95                             unsigned int        i_n );
96     self &              operator<<(
97                             long                i_n );
98     self &              operator<<(
99                             unsigned long       i_n );
100 
101     self &              operator<<(
102                             float               i_n );
103     self &              operator<<(
104                             double              i_n );
105 
106     self &              seekp(
107                             intt                i_nOffset,
108                             seek_dir            i_eStart = ios::beg );
109   protected:
110                         ostream(
111                             uintt               i_nStartSize );
112     const StreamStr &   Data() const;
113 
114   private:
115     Dyn<StreamStr>      pData;
116 };
117 
118 
119 
120 inline const StreamStr &
121 ostream::Data() const
122     { return *pData; }
123 
124 
125 }   // namespace csv
126 
127 
128 #endif
129 
130 
131 
132 
133 #endif
134 
135