LCOV - code coverage report
Current view: top level - basic/source/inc - image.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 6 7 85.7 %
Date: 2012-08-25 Functions: 6 7 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                 :            : #ifndef _SBIMAGE_HXX
      21                 :            : #define _SBIMAGE_HXX
      22                 :            : 
      23                 :            : #include "sbintern.hxx"
      24                 :            : #include <rtl/ustring.hxx>
      25                 :            : #include <filefmt.hxx>
      26                 :            : 
      27                 :            : // This class reads in the image that's been produced by the compiler
      28                 :            : // and manages the access to the single elements.
      29                 :            : 
      30                 :            : class SbiImage {
      31                 :            :     friend class SbiCodeGen;            // compiler classes, that the private-
      32                 :            : 
      33                 :            :     SbxArrayRef    rTypes;          // User defined types
      34                 :            :     SbxArrayRef    rEnums;          // Enum types
      35                 :            :     sal_uInt32*        pStringOff;      // StringId-Offsets
      36                 :            :     sal_Unicode*   pStrings;        // StringPool
      37                 :            :     char*          pCode;           // Code-Image
      38                 :            :     char*          pLegacyPCode;        // Code-Image
      39                 :            :     bool           bError;
      40                 :            :     sal_uInt16         nFlags;
      41                 :            :     short          nStrings;
      42                 :            :     sal_uInt32         nStringSize;
      43                 :            :     sal_uInt32         nCodeSize;
      44                 :            :     sal_uInt16         nLegacyCodeSize;
      45                 :            :     sal_uInt16         nDimBase;        // OPTION BASE value
      46                 :            :     rtl_TextEncoding eCharSet;
      47                 :            :                                     // temporary management-variable:
      48                 :            :     short          nStringIdx;
      49                 :            :     sal_uInt32         nStringOff;      // current Pos in the stringbuffer
      50                 :            :                                     // routines for the compiler:
      51                 :            :     void MakeStrings( short );      // establish StringPool
      52                 :            :     void AddString( const String& );
      53                 :            :     void AddCode( char*, sal_uInt32 );
      54                 :            :     void AddType(SbxObject *);
      55                 :            :     void AddEnum(SbxObject *);
      56                 :            : 
      57                 :            : public:
      58                 :            :     String aName;                   // macro name
      59                 :            :     ::rtl::OUString aOUSource;      // source code
      60                 :            :     String aComment;
      61                 :            :     bool   bInit;
      62                 :            :     bool   bFirstInit;
      63                 :            : 
      64                 :            :     SbiImage();
      65                 :            :    ~SbiImage();
      66                 :            :     void Clear();
      67                 :            :     bool Load( SvStream&, sal_uInt32& nVer );
      68                 :            :                             // nVer is set to version
      69                 :            :                             // of image
      70                 :            :     bool Save( SvStream&, sal_uInt32 = B_CURVERSION );
      71                 :         65 :     bool IsError()                  { return bError;    }
      72                 :            : 
      73                 :      14431 :     const char* GetCode() const     { return pCode;     }
      74                 :      52883 :     sal_uInt32      GetCodeSize() const { return nCodeSize; }
      75                 :            :     ::rtl::OUString& GetSource32()  { return aOUSource; }
      76                 :          0 :     sal_uInt16      GetBase() const     { return nDimBase;  }
      77                 :            :     String      GetString( short nId ) const;
      78                 :            :     const SbxObject*  FindType (String aTypeName) const;
      79                 :            : 
      80                 :         86 :     SbxArrayRef GetEnums()          { return rEnums; }
      81                 :            : 
      82                 :         13 :     void        SetFlag( sal_uInt16 n ) { nFlags |= n;      }
      83                 :        422 :     sal_uInt16      GetFlag( sal_uInt16 n ) const { return nFlags & n; }
      84                 :            :     sal_uInt16      CalcLegacyOffset( sal_Int32 nOffset );
      85                 :            :     sal_uInt32      CalcNewOffset( sal_Int16 nOffset );
      86                 :            :     void        ReleaseLegacyBuffer();
      87                 :            :     bool        ExceedsLegacyLimits();
      88                 :            : 
      89                 :            : };
      90                 :            : 
      91                 :            : #define SBIMG_EXPLICIT      0x0001  // OPTION EXPLICIT is active
      92                 :            : #define SBIMG_COMPARETEXT   0x0002  // OPTION COMPARE TEXT is active
      93                 :            : #define SBIMG_INITCODE      0x0004  // Init-Code does exist
      94                 :            : #define SBIMG_CLASSMODULE   0x0008  // OPTION ClassModule is active
      95                 :            : 
      96                 :            : #endif
      97                 :            : 
      98                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10