00001 /* 00002 Copyright (c) 2005, Quentin Lequy and Romain Gaucher 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or 00006 without modification, are permitted provided that the following 00007 conditions are met: 00008 00009 * Redistributions of source code must retain the above copyright 00010 notice, this list of conditions and the following disclaimer. 00011 00012 * Redistributions in binary form must reproduce the above copyright 00013 notice, this list of conditions and the following disclaimer in the 00014 documentation and/or other materials provided with the distribution. 00015 00016 * Neither the name of Quentin Lequy or Romain Gaucher nor the names 00017 of its contributors may be used to endorse or promote products 00018 derived from this software without specific prior written permission. 00019 00020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00021 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00022 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00023 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00024 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00025 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00026 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00027 AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00028 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00029 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 */ 00031 00032 #include "Config.h" 00033 #include "latexFile.h" 00034 #include <string> 00035 #include <iostream> 00036 00037 namespace Modelib { 00038 00039 using namespace std; 00040 00047 LATEXFile& LATEXFile::operator<<(const Model& _m) 00048 { 00049 if (beauty == false) 00050 { 00051 latex << endl << "\\begin{lstlisting}"<<endl; 00052 latex << _m; 00053 latex << "\\end{lstlisting}" << endl; 00054 } 00055 latex.flush(); 00056 return (*this); 00057 } 00058 00065 LATEXFile& LATEXFile::operator<<(const std::string& _s) 00066 { 00067 latex << "\t"; 00068 if (isInSubsection) latex << "\t"; 00069 latex << _s << endl; 00070 latex.flush(); 00071 return (*this); 00072 } 00073 00080 LATEXFile& LATEXFile::operator<<(const float _f) 00081 { 00082 latex << _f; 00083 latex.flush(); 00084 return (*this); 00085 } 00086 00093 LATEXFile& LATEXFile::operator<<(const char _c) 00094 { 00095 latex << _c; 00096 latex.flush(); 00097 return (*this); 00098 } 00099 00106 LATEXFile& LATEXFile::operator<<(const int _i) 00107 { 00108 latex << _i; 00109 latex.flush(); 00110 return (*this); 00111 } 00112 00113 #ifdef COMPILE_FOR_PYTHON 00114 #include "py_latexFile.cxx" 00115 #endif 00116 00117 00118 }