LCOV - code coverage report
Current view: top level - comphelper/source/streaming - basicio.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 66 72 91.7 %
Date: 2012-08-25 Functions: 12 14 85.7 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     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                 :            : #include <comphelper/basicio.hxx>
      21                 :            : 
      22                 :            : //.........................................................................
      23                 :            : namespace comphelper
      24                 :            : {
      25                 :            : //.........................................................................
      26                 :            : 
      27                 :            : //------------------------------------------------------------------------------
      28                 :          4 : const staruno::Reference<stario::XObjectOutputStream>& operator << (
      29                 :            :         const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream,
      30                 :            :         const starawt::FontDescriptor& _rFont)
      31                 :            : {
      32                 :          4 :     _rxOutStream->writeUTF( _rFont.Name );
      33                 :          4 :     _rxOutStream->writeShort( _rFont.Height );
      34                 :          4 :     _rxOutStream->writeShort( _rFont.Width );
      35                 :          4 :     _rxOutStream->writeUTF( _rFont.StyleName );
      36                 :          4 :     _rxOutStream->writeShort( _rFont.Family );
      37                 :          4 :     _rxOutStream->writeShort( _rFont.CharSet );
      38                 :          4 :     _rxOutStream->writeShort( _rFont.Pitch );
      39                 :          4 :     _rxOutStream->writeDouble( _rFont.CharacterWidth );
      40                 :          4 :     _rxOutStream->writeDouble( _rFont.Weight );
      41                 :          4 :     _rxOutStream->writeShort( static_cast< sal_Int16 >(_rFont.Slant) );
      42                 :          4 :     _rxOutStream->writeShort( _rFont.Underline );
      43                 :          4 :     _rxOutStream->writeShort( _rFont.Strikeout );
      44                 :          4 :     _rxOutStream->writeDouble( _rFont.Orientation );
      45                 :          4 :     _rxOutStream->writeBoolean( _rFont.Kerning );
      46                 :          4 :     _rxOutStream->writeBoolean( _rFont.WordLineMode );
      47                 :          4 :     _rxOutStream->writeShort( _rFont.Type );
      48                 :          4 :     return _rxOutStream;
      49                 :            : }
      50                 :            : 
      51                 :            : // FontDescriptor
      52                 :            : //------------------------------------------------------------------------------
      53                 :          4 : const staruno::Reference<stario::XObjectInputStream>& operator >> (
      54                 :            :         const staruno::Reference<stario::XObjectInputStream>& _rxInStream,
      55                 :            :         starawt::FontDescriptor& _rFont)
      56                 :            : {
      57                 :            :     // schreiben des Fontdescriptors
      58                 :          4 :     _rFont.Name = _rxInStream->readUTF();
      59                 :          4 :     _rFont.Height = _rxInStream->readShort();
      60                 :          4 :     _rFont.Width = _rxInStream->readShort();
      61                 :          4 :     _rFont.StyleName = _rxInStream->readUTF();
      62                 :          4 :     _rFont.Family = _rxInStream->readShort();
      63                 :          4 :     _rFont.CharSet = _rxInStream->readShort();
      64                 :          4 :     _rFont.Pitch = _rxInStream->readShort();
      65                 :          4 :     _rFont.CharacterWidth = static_cast< float >(_rxInStream->readDouble());
      66                 :          4 :     _rFont.Weight = static_cast< float >(_rxInStream->readDouble());
      67                 :          4 :     _rFont.Slant = (starawt::FontSlant)_rxInStream->readShort();
      68                 :          4 :     _rFont.Underline = _rxInStream->readShort();
      69                 :          4 :     _rFont.Strikeout = _rxInStream->readShort();
      70                 :          4 :     _rFont.Orientation = static_cast< float >(_rxInStream->readDouble());
      71                 :          4 :     _rFont.Kerning = _rxInStream->readBoolean();
      72                 :          4 :     _rFont.WordLineMode = _rxInStream->readBoolean();
      73                 :          4 :     _rFont.Type = _rxInStream->readShort();
      74                 :          4 :     return _rxInStream;
      75                 :            : }
      76                 :            : 
      77                 :            : //------------------------------------------------------------------------------
      78                 :          2 : const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Bool& _rVal)
      79                 :            : {
      80                 :          2 :     _rVal = _rxInStream->readBoolean();
      81                 :          2 :     return _rxInStream;
      82                 :            : }
      83                 :            : 
      84                 :            : //------------------------------------------------------------------------------
      85                 :          2 : const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Bool _bVal)
      86                 :            : {
      87                 :          2 :     _rxOutStream->writeBoolean(_bVal);
      88                 :          2 :     return _rxOutStream;
      89                 :            : }
      90                 :            : 
      91                 :            : //------------------------------------------------------------------------------
      92                 :        198 : const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, ::rtl::OUString& rStr)
      93                 :            : {
      94                 :        198 :     rStr = _rxInStream->readUTF();
      95                 :        198 :     return _rxInStream;
      96                 :            : }
      97                 :            : 
      98                 :            : //------------------------------------------------------------------------------
      99                 :        198 : const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, const ::rtl::OUString& rStr)
     100                 :            : {
     101                 :        198 :     _rxOutStream->writeUTF(rStr);
     102                 :        198 :     return _rxOutStream;
     103                 :            : }
     104                 :            : 
     105                 :            : //------------------------------------------------------------------------------
     106                 :         10 : const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Int16& _rValue)
     107                 :            : {
     108                 :         10 :     _rValue = _rxInStream->readShort();
     109                 :         10 :     return _rxInStream;
     110                 :            : }
     111                 :            : 
     112                 :            : //------------------------------------------------------------------------------
     113                 :         10 : const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Int16 _nValue)
     114                 :            : {
     115                 :         10 :     _rxOutStream->writeShort(_nValue);
     116                 :         10 :     return _rxOutStream;
     117                 :            : }
     118                 :            : 
     119                 :            : //------------------------------------------------------------------------------
     120                 :          4 : const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_uInt16& _rValue)
     121                 :            : {
     122                 :          4 :     _rValue = _rxInStream->readShort();
     123                 :          4 :     return _rxInStream;
     124                 :            : }
     125                 :            : 
     126                 :            : //------------------------------------------------------------------------------
     127                 :          4 : const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_uInt16 _nValue)
     128                 :            : {
     129                 :          4 :     _rxOutStream->writeShort(_nValue);
     130                 :          4 :     return _rxOutStream;
     131                 :            : }
     132                 :            : 
     133                 :            : //------------------------------------------------------------------------------
     134                 :          0 : const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_uInt32& _rValue)
     135                 :            : {
     136                 :          0 :     _rValue = _rxInStream->readLong();
     137                 :          0 :     return _rxInStream;
     138                 :            : }
     139                 :            : 
     140                 :            : //------------------------------------------------------------------------------
     141                 :          0 : const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_uInt32 _nValue)
     142                 :            : {
     143                 :          0 :     _rxOutStream->writeLong(_nValue);
     144                 :          0 :     return _rxOutStream;
     145                 :            : }
     146                 :            : 
     147                 :            : //------------------------------------------------------------------------------
     148                 :          4 : const staruno::Reference<stario::XObjectInputStream>& operator >> (const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Int32& _rValue)
     149                 :            : {
     150                 :          4 :     _rValue = _rxInStream->readLong();
     151                 :          4 :     return _rxInStream;
     152                 :            : }
     153                 :            : 
     154                 :            : //------------------------------------------------------------------------------
     155                 :          4 : const staruno::Reference<stario::XObjectOutputStream>& operator << (const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream, sal_Int32 _nValue)
     156                 :            : {
     157                 :          4 :     _rxOutStream->writeLong(_nValue);
     158                 :          4 :     return _rxOutStream;
     159                 :            : }
     160                 :            : 
     161                 :            : //.........................................................................
     162                 :            : }   // namespace comphelper
     163                 :            : //.........................................................................
     164                 :            : 
     165                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10