LCOV - code coverage report
Current view: top level - idlc/inc/idlc - astdeclaration.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 36 36 100.0 %
Date: 2014-04-11 Functions: 20 20 100.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             : #ifndef _IDLC_ASTDECLARATION_HXX_
      20             : #define _IDLC_ASTDECLARATION_HXX_
      21             : 
      22             : #include <idlc/idlc.hxx>
      23             : #include <registry/registry.hxx>
      24             : 
      25             : class AstScope;
      26             : 
      27             : // Enum defining the different kinds of Ast nodes
      28             : enum NodeType
      29             : {
      30             :     NT_object,              // Denotes an object
      31             :     NT_service,             // Denotes an servcie
      32             :     NT_interface_member,    // Denotes an interface which is exported from object
      33             :     NT_service_member,      // Denotes an service which is exported from object
      34             :     NT_observes,            // Denotes an observed interface
      35             :     NT_needs,               // Denotes an needed service
      36             :     NT_module,              // Denotes a module
      37             :     NT_root,                // Denotes the root of AST
      38             :     NT_interface,           // Denotes an interface
      39             :     NT_constants,           // Denotes a constant group
      40             :     NT_const,               // Denotes a constant
      41             :     NT_exception,           // Denotes an exception
      42             :     NT_attribute,           // Denotes an attribute
      43             :     NT_property,            // Denotes an property
      44             :     NT_operation,           // Denotes an operation
      45             :     NT_parameter,           // Denotes an op. parameter
      46             :     NT_struct,              // Denotes either a plain struct type, or a
      47             :                             // polymorphic struct type template
      48             :     NT_type_parameter,      // Denotes a type parameter of a polymorphic struct
      49             :                             // type template
      50             :     NT_instantiated_struct, // Denotes an instantiated polymorphic struct type
      51             :     NT_member,              // Denotes a member in structure, exception
      52             :     NT_enum,                // Denotes an enumeration
      53             :     NT_enum_val,            // Denotes an enum. value
      54             :     NT_sequence,            // Denotes an IDL sequence
      55             :     NT_typedef,             // Denotes a typedef
      56             :     NT_predefined,          // Denotes a predefined type
      57             :     NT_singleton            // Denotes a singleton
      58             : };
      59             : 
      60           3 : class AstDeclaration
      61             : {
      62             : public:
      63             :     // Constructors
      64             :     AstDeclaration(NodeType type, const OString& name, AstScope* pScope);
      65             :     virtual ~AstDeclaration();
      66             : 
      67             :     // Data access
      68      138734 :     const OString& getLocalName() const
      69      138734 :         { return m_localName; }
      70       15851 :     const OString&   getScopedName() const
      71       15851 :         { return m_scopedName; }
      72         393 :     const OString&   getFullName()
      73         393 :         { return m_fullName; }
      74         875 :     virtual const sal_Char* getRelativName() const
      75         875 :         { return m_fullName.getStr()+1; }
      76        2554 :     AstScope* getScope()
      77        2554 :         { return m_pScope; }
      78             :     void setScope(AstScope* pSc)
      79             :         { m_pScope = pSc; }
      80       11681 :     NodeType getNodeType() const
      81       11681 :         { return m_nodeType; }
      82        2859 :     bool isInMainfile() const
      83        2859 :         { return m_bInMainFile; }
      84         110 :     void setInMainfile(bool bInMainfile)
      85         110 :         { m_bInMainFile = bInMainfile; }
      86           3 :     bool isImported() const
      87           3 :         { return m_bImported; }
      88           3 :     void setImported(bool bImported)
      89           3 :         { m_bImported = bImported; }
      90           3 :     sal_Int32 getLineNumber() const
      91           3 :         { return m_lineNumber; }
      92           3 :     void setLineNumber(sal_Int32 lineNumber)
      93           3 :         { m_lineNumber = lineNumber; }
      94         110 :     const OString& getFileName() const
      95         110 :         { return m_fileName; }
      96         110 :     void setFileName(const OString& rFileName)
      97         110 :         { m_fileName = rFileName; }
      98         973 :     const OUString& getDocumentation() const
      99         973 :         { return m_documentation; }
     100           3 :     void setDocumentation(const OUString& rDocumentation)
     101           3 :         { m_documentation = rDocumentation; }
     102             :     bool isAdded()
     103             :         { return m_bIsAdded; }
     104             :     void markAsAdded()
     105             :         { m_bIsAdded = true; }
     106             : 
     107             :     virtual bool isType() const;
     108             : 
     109             :     bool hasAncestor(AstDeclaration* pDecl);
     110             : 
     111         329 :     void setPublished() { m_bPublished = true; }
     112         112 :     bool isPublished() const { return m_bPublished; }
     113             : 
     114             :     virtual bool dump(RegistryKey& rKey);
     115             : 
     116         110 :     bool isPredefined() { return m_bPredefined; }
     117             :     void setPredefined(bool bPredefined);
     118             : 
     119             : protected:
     120             :     OString      m_localName;
     121             :     OString      m_scopedName;       // full qualified name
     122             :     OString      m_fullName;         // full qualified name with '/' as separator
     123             :     AstScope*           m_pScope;
     124             :     NodeType            m_nodeType;
     125             :     bool            m_bImported;        // imported ?
     126             :     bool            m_bIsAdded;         // mark declaration as added in scope
     127             :     bool            m_bInMainFile;      // defined in main file
     128             :     bool                m_bPublished;
     129             :     bool                m_bPredefined;
     130             :     sal_Int32           m_lineNumber;       // line number defined in
     131             :     OString      m_fileName;         // fileName defined in
     132             :     OUString     m_documentation;    // fileName defined in
     133             : };
     134             : 
     135             : #endif // _IDLC_ASTDECLARATION_HXX_
     136             : 
     137             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10