1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef CSV_CSV_OSTREAM_HXX 25 #define CSV_CSV_OSTREAM_HXX 26 27 // USED SERVICES 28 // BASE CLASSES 29 // COMPONENTS 30 // PARAMETERS 31 32 33 34 #ifndef CSV_NO_IOSTREAMS 35 36 #include <iostream> 37 38 39 namespace csv 40 { 41 42 typedef std::ios ios; 43 typedef std::ostream ostream; 44 45 } // namespace csv 46 47 48 #else 49 50 #include <cosv/tpl/dyn.hxx> 51 52 namespace csv 53 { 54 55 class StreamStr; 56 57 class ios 58 { 59 public: 60 enum seek_dir 61 { 62 beg=0, 63 cur=1, 64 end=2 65 }; 66 }; 67 68 class ostream : public ios 69 { 70 public: 71 typedef ostream self; 72 73 virtual ~ostream(); 74 75 self & operator<<( 76 const char * i_s ); 77 self & operator<<( 78 char i_c ); 79 self & operator<<( 80 unsigned char i_c ); 81 self & operator<<( 82 signed char i_c ); 83 84 self & operator<<( 85 short i_n ); 86 self & operator<<( 87 unsigned short i_n ); 88 self & operator<<( 89 int i_n ); 90 self & operator<<( 91 unsigned int i_n ); 92 self & operator<<( 93 long i_n ); 94 self & operator<<( 95 unsigned long i_n ); 96 97 self & operator<<( 98 float i_n ); 99 self & operator<<( 100 double i_n ); 101 102 self & seekp( 103 intt i_nOffset, 104 seek_dir i_eStart = ios::beg ); 105 protected: 106 ostream( 107 uintt i_nStartSize ); 108 const StreamStr & Data() const; 109 110 private: 111 Dyn<StreamStr> pData; 112 }; 113 114 115 116 inline const StreamStr & Data() const117ostream::Data() const 118 { return *pData; } 119 120 121 } // namespace csv 122 123 124 #endif 125 126 127 128 129 #endif 130 131