LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/cosv - std_outp.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 5 60.0 %
Date: 2012-12-27 Functions: 1 2 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef CSV_STD_OUTP_HXX
      21             : #define CSV_STD_OUTP_HXX
      22             : 
      23             : // USED SERVICES
      24             :     // BASE CLASSES
      25             :     // COMPONENTS
      26             : #include <cosv/csv_ostream.hxx>
      27             :     // PARAMETERS
      28             : 
      29             : 
      30             : 
      31             : 
      32             : namespace csv
      33             : {
      34             : 
      35             : #ifdef CSV_NO_IOSTREAMS
      36             : class redirect_out : public ostream
      37             : {
      38             :   public:
      39             :     virtual             ~redirect_out() {}
      40             : 
      41             :     void                re_endl()               { do_re_endl(); }
      42             :     void                re_flush()              { do_re_flush(); }
      43             : 
      44             :     static void         set_(
      45             :                             redirect_out &      o_rStdOut,
      46             :                             redirect_out &      o_rStdErr )
      47             :                                                 { pStdOut_ = &o_rStdOut;
      48             :                                                   pStdErr_ = &o_rStdErr; }
      49             : 
      50             :     static redirect_out &
      51             :                         std_()                  { return *pStdOut_; }
      52             :     static redirect_out &
      53             :                         err_()                  { return *pStdErr_; }
      54             :     static bool         useme_()                { return pStdOut_ != 0; }
      55             : 
      56             :   private:
      57             :     virtual void        do_re_endl() = 0;
      58             :     virtual void        do_re_flush() = 0;
      59             : 
      60             :     // DATA
      61             :     static redirect_out *
      62             :                         pStdOut_;
      63             :     static redirect_out *
      64             :                         pStdErr_;
      65             : };
      66             : #endif // defined(CSV_NO_IOSTREAMS)
      67             : 
      68             : 
      69             : inline ostream &
      70           0 : Cout()
      71             : {
      72             : 
      73             : #ifndef CSV_NO_IOSTREAMS
      74             : //    return redirect_out::useme_()
      75             : //            ?   (ostream&)( redirect_out::std_() )
      76             : //            :   (ostream&)( std::cout );
      77           0 :     return (ostream&)( std::cout );
      78             : #else
      79             :     csv_assert( redirect_out::useme_() );
      80             :     return redirect_out::std_();
      81             : #endif
      82             : }
      83             : 
      84             : inline ostream &
      85             : Cerr()
      86             : {
      87             : #ifndef CSV_NO_IOSTREAMS
      88             : //    return redirect_out::useme_()
      89             : //            ?   (ostream&)( redirect_out::err_() )
      90             : //            :   (ostream&)( std::cerr );
      91             :     return (ostream&)( std::cerr );
      92             : #else
      93             :     csv_assert( redirect_out::useme_() );
      94             :     return redirect_out::err_();
      95             : #endif
      96             : }
      97             : 
      98             : 
      99             : 
     100             : typedef void (*F_FLUSHING_FUNC)(ostream&);
     101             : 
     102             : void                Endl( ostream& );
     103             : 
     104             : void                Flush( ostream& );
     105             : 
     106             : 
     107             : }   // namespace csv
     108             : 
     109             : 
     110             : 
     111             : inline csv::ostream &
     112       12106 : operator<<( csv::ostream &          io_rStream,
     113             :             csv::F_FLUSHING_FUNC    i_fFlushingFunc )
     114             : {
     115             : #ifndef CSV_NO_IOSTREAMS
     116             : //    (*i_fFlushingFunc)( io_rStream, csv::redirect_out::useme_(), 0 );
     117       12106 :     (*i_fFlushingFunc)( io_rStream );
     118             : #else
     119             :     csv_assert( csv::redirect_out::useme_() );
     120             :     (*i_fFlushingFunc)( io_rStream, true, 0 );
     121             : #endif
     122       12106 :     return io_rStream;
     123             : }
     124             : 
     125             : 
     126             : #endif
     127             : 
     128             : 
     129             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10