ximol/io.hpp

Go to the documentation of this file.
00001 /*****************************************************************************\
00002  *                                                                           *
00003  * library XiMoL                                                             *
00004  * Copyright (C) 2002, 2003, 2004 Florent Tournois                           *
00005  *                                                                           *
00006  * This library is free software; you can redistribute it and/or             *
00007  * modify it under the terms of the GNU Lesser General Public                *
00008  * License as published by the Free Software Foundation; either              *
00009  * version 2.1 of the License, or (at your option) any later version.        *
00010  *                                                                           *
00011  * This library is distributed in the hope that it will be useful,           *
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00014  * Lesser General Public License for more details.                           *
00015  *                                                                           *
00016  * You should have received a copy of the GNU Lesser General Public          *
00017  * License along with this library; if not, write to the Free Software       *
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA   *
00019  *                                                                           *
00020 \*****************************************************************************/
00021 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00022 /** \file 
00023         \brief GetFrom and PutTo operator for common char and xchar_t.
00024 
00025     \author Tournois Florent
00026         \version 1.0
00027 
00028     $Id: io.hpp,v 1.10 2004/02/22 10:27:32 tournois Exp $
00029     $Log: io.hpp,v $
00030     Revision 1.10  2004/02/22 10:27:32  tournois
00031     Add some doc.
00032 
00033     Revision 1.9  2004/02/22 09:54:19  tournois
00034     Change years on the copyright.
00035 
00036     Revision 1.8  2004/02/02 19:51:44  tournois
00037     Add a control_flow and finish the attribute tutorial.
00038 
00039     Revision 1.7  2004/01/27 21:49:51  tournois
00040     Add docs and tutorial.
00041 
00042     Revision 1.6  2003/11/27 15:31:55  hfp
00043     partially adapted to vc6.
00044 
00045     Revision 1.5  2003/11/18 18:54:51  tournois
00046     Add str_cast and drop the transformation.hpp file.
00047 
00048     Revision 1.4  2003/11/02 19:23:01  tournois
00049     Go to the boost coding standard.
00050     Change all name to lower case.
00051 
00052     Revision 1.3  2003/10/25 13:53:39  hfp
00053     review and separation
00054 
00055     Revision 1.2  2003/10/09 16:59:45  tournois
00056     add the stringstream initialisation.
00057     add some prolog test.
00058     Correct code for VC6.0.
00059 
00060     Revision 1.1  2003/09/24 08:28:17  tournois
00061     Create the namespace Encoders, Parser, Xml
00062     Change the library organization.
00063     add VC7.1 project for this organization.
00064 
00065   */
00066 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00067 #ifndef XIMOL_IO_HPP_
00068 #define XIMOL_IO_HPP_
00069 
00070 #include <ximol/stop_warnings.hpp>
00071 #include <ximol/export_defs.hpp>
00072 #include <ximol/typedefs.hpp>
00073 #include <ximol/macros.hpp>
00074 
00075 
00076 // forwarded declarations
00077 XIMOL_BEGIN_NAMESPACE
00078         class xostream;
00079         class xistream;
00080 XIMOL_END_NAMESPACE
00081 
00082 namespace std {
00083     XIMOL_EXPORT ostream& operator<<(ostream & os, const wchar_t * xc);
00084 //  XIMOL_EXPORT ostream& operator<<(ostream & os, const wchar_t xc);
00085 //      XIMOL_EXPORT ostream& operator<<(ostream & os, const wstring & wstr);
00086 
00087     XIMOL_EXPORT wostream& operator<<(wostream & wos, const char * c);
00088 //  XIMOL_EXPORT wostream& operator<<(wostream & wos, const char c);
00089 //  XIMOL_EXPORT wostream& operator<<(wostream & wos, const string & str);
00090 
00091 //    XIMOL_EXPORT istream& operator>>(istream & is, wchar_t & xc);
00092 //  XIMOL_EXPORT istream& operator>>(istream & is, wstring & wstr);
00093 
00094 //    XIMOL_EXPORT wistream& operator>>(wistream & wis, char & c);
00095 //  XIMOL_EXPORT wistream& operator>>(wistream & wis, string & str);
00096 }; // end of namespace std
00097 
00098 XIMOL_BEGIN_NAMESPACE // open the std namespace to put some classes
00099 
00100 //-----------------------------------------------------------------------------
00101 /// XML stream put to operator.
00102 /** @ingroup encoders 
00103     redefinition of the put to operator
00104    
00105     @param xos : the XML ostream
00106     @param c : char to put
00107    
00108     @return xostream&  : the XML stream in return.
00109 */
00110 //-----------------------------------------------------------------------------
00111 XIMOL_EXPORT
00112 xostream& operator<<(xostream& xos, const char c);
00113 
00114 //-----------------------------------------------------------------------------
00115 /// XML stream put to operator.
00116 /** @ingroup encoders 
00117     redefinition of the put to operator
00118    
00119     @param xos : the XML ostream
00120     @param c : char * to put
00121    
00122     @return xostream&  : the XML stream in return.
00123 */
00124 //-----------------------------------------------------------------------------
00125 XIMOL_EXPORT
00126 xostream& operator<<(xostream& xos, const char * c);
00127 
00128 //-----------------------------------------------------------------------------
00129 /// XML stream put to operator.
00130 /** @ingroup encoders 
00131     redefinition of the put to operator
00132    
00133     @param xos : the XML ostream
00134     @param c : char * to put
00135    
00136     @return xostream&  : the XML stream in return.
00137 */
00138 //-----------------------------------------------------------------------------
00139 XIMOL_EXPORT
00140 xostream& operator<<(xostream& xostream_, const std::string& str_);
00141 
00142 //-----------------------------------------------------------------------------
00143 /// XML stream put to operator.
00144 /** @ingroup encoders 
00145     redefinition of the put to operator
00146    
00147     @param xos : the XML ostream
00148     @param c : xchar_t to put
00149    
00150     @return xostream&  : the XML stream in return.
00151 */
00152 //-----------------------------------------------------------------------------
00153 //XIMOL_EXPORT
00154 //xostream& operator<<(xostream& xos, xchar_t c);
00155 
00156 //-----------------------------------------------------------------------------
00157 /// XML stream put to operator.
00158 /** @ingroup encoders 
00159     redefinition of the put to operator
00160    
00161     @param xos : the XML ostream
00162     @param c : xchar_t * to put
00163    
00164     @return xostream&  : the XML stream in return.
00165 */
00166 //-----------------------------------------------------------------------------
00167 XIMOL_EXPORT
00168 xostream& operator<<(xostream& xos, const xchar_t * c);
00169 
00170 //-----------------------------------------------------------------------------
00171 /// XML stream put to operator.
00172 /** @ingroup encoders 
00173     redefinition of the put to operator
00174    
00175     @param xos : the XML ostream
00176     @param c : xstring * to put
00177    
00178     @return xostream&  : the XML stream in return.
00179 */
00180 //-----------------------------------------------------------------------------
00181 XIMOL_TEMPLATE_NULL
00182 XIMOL_EXPORT
00183 xostream& operator<<(xostream& xos, const xstring& c);
00184 
00185 //-----------------------------------------------------------------------------
00186 /// XML stream get from operator.
00187 /** @ingroup encoders 
00188     redefinition of the get from operator
00189    
00190     @param xis : the XML istream
00191     @param c : char to get
00192    
00193     @return xistream&  : the XML stream in return.
00194 */
00195 //-----------------------------------------------------------------------------
00196 //XIMOL_EXPORT
00197 //xistream& operator>>(xistream& xis, char & c);
00198 
00199 //-----------------------------------------------------------------------------
00200 /// XML stream get from operator.
00201 /** @ingroup encoders 
00202     redefinition of the get from operator
00203    
00204     @param xis : the XML istream
00205     @param c : xchar_t to get
00206    
00207     @return xistream&  : the XML stream in return.
00208 */
00209 //-----------------------------------------------------------------------------
00210 //XIMOL_EXPORT
00211 //xistream& operator>>(xistream& xis, xchar_t & c);
00212 
00213 XIMOL_EXPORT xistream& operator>>(xistream& xis, bool           & c);
00214 XIMOL_EXPORT xistream& operator>>(xistream& xis, short          & c);
00215 XIMOL_EXPORT xistream& operator>>(xistream& xis, long           & c);
00216 XIMOL_EXPORT xistream& operator>>(xistream& xis, unsigned long  & c);
00217 XIMOL_EXPORT xistream& operator>>(xistream& xis, int            & c);
00218 XIMOL_EXPORT xistream& operator>>(xistream& xis, unsigned int   & c);
00219 XIMOL_EXPORT xistream& operator>>(xistream& xis, float          & c);
00220 XIMOL_EXPORT xistream& operator>>(xistream& xis, double         & c);
00221 XIMOL_EXPORT xistream& operator>>(xistream& xis, long double    & c);
00222 XIMOL_EXPORT xistream& operator>>(xistream& xis, ::std::wistream& (*fun)( ::std::wistream&));
00223 
00224 XIMOL_EXPORT xostream& operator<<(xostream& xos, bool           c);
00225 XIMOL_EXPORT xostream& operator<<(xostream& xos, short          c);
00226 XIMOL_EXPORT xostream& operator<<(xostream& xos, long           c);
00227 XIMOL_EXPORT xostream& operator<<(xostream& xos, unsigned long  c);
00228 XIMOL_EXPORT xostream& operator<<(xostream& xos, int            c);
00229 XIMOL_EXPORT xostream& operator<<(xostream& xos, unsigned int   c);
00230 XIMOL_EXPORT xostream& operator<<(xostream& xos, float          c);
00231 XIMOL_EXPORT xostream& operator<<(xostream& xos, double         c);
00232 XIMOL_EXPORT xostream& operator<<(xostream& xos, long double    c);
00233 XIMOL_EXPORT xostream& operator<<(xostream& xos, ::std::wostream& (*fun)( ::std::wostream&));
00234 
00235 XIMOL_END_NAMESPACE 
00236 
00237 #endif // #ifndef XIMOL_IO_HPP_


Donate to the XiMoL project SourceForge.net Logo If you have any questions about XiMoL, you could write to tournois@users.sourceforge.net.