LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/idlc/inc/idlc - idlc.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 59 59 100.0 %
Date: 2013-07-09 Functions: 29 29 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_IDLC_HXX_
      20             : #define _IDLC_IDLC_HXX_
      21             : 
      22             : #include <idlc/idlctypes.hxx>
      23             : #include <idlc/aststack.hxx>
      24             : #include <idlc/options.hxx>
      25             : 
      26             : #ifdef SAL_UNX
      27             : #define SEPARATOR '/'
      28             : #define PATH_SEPARATOR "/"
      29             : #else
      30             : #define SEPARATOR '\\'
      31             : #define PATH_SEPARATOR "\\"
      32             : #endif
      33             : 
      34             : class AstInterface;
      35             : class AstModule;
      36             : class AstType;
      37             : class Options;
      38             : class ErrorHandler;
      39             : 
      40             : class Idlc
      41             : {
      42             : public:
      43             :     Idlc(Options* pOptions);
      44             :     virtual ~Idlc();
      45             : 
      46             :     void init();
      47             : 
      48             :     bool dumpDeps(OString const& rDepFile,
      49             :                   OString const& rTarget);
      50             : 
      51       12588 :     Options* getOptions()
      52       12588 :         { return m_pOptions; }
      53     2477664 :     AstStack* scopes()
      54     2477664 :         { return m_pScopes; }
      55        5428 :     AstModule* getRoot()
      56        5428 :         { return m_pRoot; }
      57      174455 :     ErrorHandler* error()
      58      174455 :         { return m_pErrorHandler; }
      59     1648707 :     const OString& getFileName()
      60     1648707 :         { return m_fileName; }
      61      126272 :     void setFileName(const OString& fileName)
      62      126272 :         { m_fileName = fileName; addInclude(fileName); }
      63      167386 :     const OString& getMainFileName()
      64      167386 :         { return m_mainFileName; }
      65        5600 :     void setMainFileName(const OString& mainFileName)
      66        5600 :         { m_mainFileName = mainFileName; }
      67      933214 :     const OString& getRealFileName()
      68      933214 :         { return m_realFileName; }
      69        5600 :     void setRealFileName(const OString& realFileName)
      70        5600 :         { m_realFileName = realFileName; }
      71      321521 :     const OString& getDocumentation()
      72             :         {
      73      321521 :             m_bIsDocValid = sal_False;
      74      321521 :             return m_documentation;
      75             :         }
      76      317849 :     void setDocumentation(const OString& documentation)
      77             :         {
      78      317849 :             m_documentation = documentation;
      79      317849 :             m_bIsDocValid = sal_True;
      80      317849 :         }
      81             :     OUString processDocumentation();
      82      218774 :     sal_Bool isInMainFile()
      83      218774 :         { return m_bIsInMainfile; }
      84      120672 :     void setInMainfile(sal_Bool bInMainfile)
      85      120672 :         { m_bIsInMainfile = bInMainfile; }
      86        5600 :     sal_uInt32 getErrorCount()
      87        5600 :         { return m_errorCount; }
      88             :     void setErrorCount(sal_uInt32 errorCount)
      89             :         { m_errorCount = errorCount; }
      90         223 :     void incErrorCount()
      91         223 :         { m_errorCount++; }
      92        5666 :     sal_uInt32 getWarningCount()
      93        5666 :         { return m_warningCount; }
      94             :     void setWarningCount(sal_uInt32 warningCount)
      95             :         { m_warningCount = warningCount; }
      96         370 :     void incWarningCount()
      97         370 :         { m_warningCount++; }
      98     1854753 :     sal_uInt32 getLineNumber()
      99     1854753 :         { return m_lineNumber; }
     100         223 :     sal_uInt32 getOffsetStart()
     101         223 :         { return m_offsetStart; }
     102         223 :     sal_uInt32 getOffsetEnd()
     103         223 :         { return m_offsetEnd; }
     104    14353778 :     void setOffset( sal_uInt32 start, sal_uInt32 end)
     105    14353778 :         { m_offsetStart = start; m_offsetEnd = end; }
     106     1894287 :     void setLineNumber(sal_uInt32 lineNumber)
     107     1894287 :         { m_lineNumber = lineNumber; }
     108     2294335 :     void incLineNumber()
     109     2294335 :         { m_lineNumber++; }
     110          64 :     ParseState getParseState()
     111          64 :         { return m_parseState; }
     112     4238140 :     void setParseState(ParseState parseState)
     113     4238140 :         { m_parseState = parseState; }
     114             : 
     115      126272 :     void addInclude(const OString& inc)
     116      126272 :         { m_includes.insert(inc); }
     117             :     StringSet* getIncludes()
     118             :         { return &m_includes; }
     119             : 
     120      326503 :     void setPublished(bool published) { m_published = published; }
     121      980920 :     bool isPublished() const { return m_published; }
     122             : 
     123             :     void reset();
     124             : private:
     125             :     Options*            m_pOptions;
     126             :     AstStack*           m_pScopes;
     127             :     AstModule*          m_pRoot;
     128             :     ErrorHandler*       m_pErrorHandler;
     129             :     OString      m_fileName;
     130             :     OString      m_mainFileName;
     131             :     OString      m_realFileName;
     132             :     OString      m_documentation;
     133             :     sal_Bool            m_bIsDocValid;
     134             :     sal_Bool            m_bGenerateDoc;
     135             :     sal_Bool            m_bIsInMainfile;
     136             :     bool                m_published;
     137             :     sal_uInt32          m_errorCount;
     138             :     sal_uInt32          m_warningCount;
     139             :     sal_uInt32          m_lineNumber;
     140             :     sal_uInt32          m_offsetStart;
     141             :     sal_uInt32          m_offsetEnd;
     142             :     ParseState          m_parseState;
     143             :     StringSet           m_includes;
     144             : };
     145             : 
     146             : 
     147             : typedef ::std::pair< OString, OString > sPair_t;
     148             : sal_Int32 compileFile(const OString * pathname);
     149             :     // a null pathname means stdin
     150             : sal_Int32 produceFile(const OString& filenameBase,
     151             :         sPair_t const*const pDepFile);
     152             :     // filenameBase is filename without ".idl"
     153             : void removeIfExists(const OString& pathname);
     154             : 
     155             : OString makeTempName(const OString& prefix, const OString& postfix);
     156             : sal_Bool copyFile(const OString* source, const OString& target);
     157             :     // a null source means stdin
     158             : 
     159             : sal_Bool isFileUrl(const OString& fileName);
     160             : OString convertToAbsoluteSystemPath(const OString& fileName);
     161             : OString convertToFileUrl(const OString& fileName);
     162             : 
     163             : Idlc* SAL_CALL idlc();
     164             : Idlc* SAL_CALL setIdlc(Options* pOptions);
     165             : 
     166             : AstDeclaration const * resolveTypedefs(AstDeclaration const * type);
     167             : 
     168             : AstDeclaration const * deconstructAndResolveTypedefs(
     169             :     AstDeclaration const * type, sal_Int32 * rank);
     170             : 
     171             : AstInterface const * resolveInterfaceTypedefs(AstType const * type);
     172             : 
     173             : #endif // _IDLC_IDLC_HXX_
     174             : 
     175             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10