LCOV - code coverage report
Current view: top level - idlc/inc/idlc - astattribute.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 40 41 97.6 %
Date: 2014-04-11 Functions: 15 17 88.2 %
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             : #ifndef _IDLC_ASTATTRIBUTE_HXX_
      20             : #define _IDLC_ASTATTRIBUTE_HXX_
      21             : 
      22             : #include <idlc/astdeclaration.hxx>
      23             : #include "idlc/astscope.hxx"
      24             : 
      25             : #include "registry/types.h"
      26             : #include "rtl/ustring.hxx"
      27             : 
      28             : namespace typereg { class Writer; }
      29             : 
      30             : class AstAttribute: public AstDeclaration, public AstScope {
      31             : public:
      32          44 :     AstAttribute(
      33             :         sal_uInt32 flags, AstType const * type, OString const & name,
      34             :         AstScope * scope):
      35             :         AstDeclaration(NT_attribute, name, scope),
      36          44 :         AstScope(NT_attribute), m_flags(flags), m_pType(type)
      37          44 :     {}
      38             : 
      39           1 :     AstAttribute(NodeType nodeType, sal_uInt32 flags, AstType const * pType, const OString& name, AstScope* pScope)
      40             :         : AstDeclaration(nodeType, name, pScope), AstScope(nodeType)
      41             :         , m_flags(flags)
      42           1 :         , m_pType(pType)
      43           1 :         {}
      44           0 :     virtual ~AstAttribute() {}
      45             : 
      46          44 :     void setExceptions(
      47             :         OUString const * getDoc, DeclList const * getExc,
      48             :         OUString const * setDoc, DeclList const * setExc)
      49             :     {
      50          44 :         if (getDoc != 0) {
      51          12 :             m_getDocumentation = *getDoc;
      52             :         }
      53          44 :         if (getExc != 0) {
      54          12 :             m_getExceptions = *getExc;
      55             :         }
      56          44 :         if (setDoc != 0) {
      57           5 :             m_setDocumentation = *setDoc;
      58             :         }
      59          44 :         if (setExc != 0) {
      60           5 :             m_setExceptions = *setExc;
      61             :         }
      62          44 :     }
      63             : 
      64          23 :     DeclList::size_type getGetExceptionCount() const
      65          23 :     { return m_getExceptions.size(); }
      66             : 
      67          23 :     DeclList::size_type getSetExceptionCount() const
      68          23 :     { return m_setExceptions.size(); }
      69             : 
      70          23 :     AstType const * getType() const
      71          23 :         { return m_pType; }
      72          29 :     bool isReadonly() const
      73          29 :         { return ((m_flags & AF_READONLY) == AF_READONLY); }
      74          23 :     bool isOptional() const
      75          23 :         { return ((m_flags & AF_OPTIONAL) == AF_OPTIONAL); }
      76             :     bool isAttribute() const
      77             :         { return ((m_flags & AF_ATTRIBUTE) == AF_ATTRIBUTE); }
      78             :     bool isProperty() const
      79             :         { return ((m_flags & AF_PROPERTY) == AF_PROPERTY); }
      80          46 :     bool isBound() const
      81          46 :         { return ((m_flags & AF_BOUND) == AF_BOUND); }
      82          23 :     bool isMayBeVoid() const
      83          23 :         { return ((m_flags & AF_MAYBEVOID) == AF_MAYBEVOID); }
      84          23 :     bool isConstrained() const
      85          23 :         { return ((m_flags & AF_CONSTRAINED) == AF_CONSTRAINED); }
      86          23 :     bool isTransient() const
      87          23 :         { return ((m_flags & AF_TRANSIENT) == AF_TRANSIENT); }
      88          23 :     bool isMayBeAmbiguous() const
      89          23 :         { return ((m_flags & AF_MAYBEAMBIGUOUS) == AF_MAYBEAMBIGUOUS); }
      90          23 :     bool isMayBeDefault() const
      91          23 :         { return ((m_flags & AF_MAYBEDEFAULT) == AF_MAYBEDEFAULT); }
      92          23 :     bool isRemoveable() const
      93          23 :         { return ((m_flags & AF_REMOVABLE) == AF_REMOVABLE); }
      94             : 
      95             :     bool dumpBlob(
      96             :         typereg::Writer & rBlob, sal_uInt16 index, sal_uInt16 * methodIndex);
      97             : 
      98             : private:
      99             :     void dumpExceptions(
     100             :         typereg::Writer & writer, OUString const & documentation,
     101             :         DeclList const & exceptions, RTMethodMode flags,
     102             :         sal_uInt16 * methodIndex);
     103             : 
     104             :     const sal_uInt32    m_flags;
     105             :     AstType const * m_pType;
     106             :     OUString m_getDocumentation;
     107             :     DeclList m_getExceptions;
     108             :     OUString m_setDocumentation;
     109             :     DeclList m_setExceptions;
     110             : };
     111             : 
     112             : #endif // _IDLC_ASTATTRIBUTE_HXX_
     113             : 
     114             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10