LibreOffice Module idl (master) 1
database.hxx
Go to the documentation of this file.
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 INCLUDED_IDL_INC_DATABASE_HXX
21#define INCLUDED_IDL_INC_DATABASE_HXX
22
23#include "module.hxx"
24#include "hash.hxx"
25#include "lex.hxx"
26#include <rtl/string.hxx>
27
28#include <rtl/ustring.hxx>
29#include <set>
30#include <string_view>
31#include <exception>
32
33class SvCommand;
34
36{
37 OString aText;
38public:
39 sal_uInt32 nLine, nColumn;
40
41 SvIdlError() : nLine(0), nColumn(0) {}
42 SvIdlError( sal_uInt32 nL, sal_uInt32 nC )
43 : nLine(nL), nColumn(nC) {}
44
45 const OString& GetText() const { return aText; }
46 void SetText( const OString& rT ) { aText = rT; }
47 bool IsError() const { return nLine != 0; }
48};
49
50class SvParseException final : public std::exception
51{
52public:
54 SvParseException( SvTokenStream const & rInStm, const OString& rError );
55 SvParseException( const OString& rError, SvToken const & rTok );
56};
57
58
59
61{
62 bool bExport;
63 OUString aExportFile;
64 sal_uInt32 nUniqueId;
65 sal_uInt32 nVerbosity;
66 std::vector<OUString> aIdFileList;
67 std::unique_ptr<SvStringHashTable> pIdTable;
68
74
75protected:
76 ::std::set< OUString > m_DepFiles;
77 OUString aPath;
80 {
82 }
83public:
84 OUString sSlotMapFile;
85
86 explicit SvIdlDataBase( const SvCommand& rCmd );
88
92
93 // list of used types while writing
95
96 void StartNewFile( std::u16string_view rName );
97 void SetExportFile( const OUString& rName )
98 { aExportFile = rName; }
99 void AppendSlot( SvMetaSlot *pSlot );
100 const SvIdlError & GetError() const { return aError; }
101 void SetError( const SvIdlError & r )
102 { aError = r; }
103
104 const OUString & GetPath() const { return aPath; }
105 void SetPath(const OUString &s) { aPath = s; }
107
108 void Write(const OString& rText) const;
109 void WriteError( SvTokenStream & rInStm );
110 void SetError( const OString& rError, SvToken const & rTok );
111 void SetAndWriteError( SvTokenStream & rInStm, const OString& rError );
112 void Push( SvMetaObject * pObj );
113 sal_uInt32 GetUniqueId() { return ++nUniqueId; }
114 bool FindId( const OString& rIdName, sal_uInt32 * pVal );
115 void InsertId( const OString& rIdName, sal_uInt32 nVal );
116 bool ReadIdFile( std::string_view rFileName );
117
118 SvMetaType * FindType( std::string_view rName );
120
123 SvMetaType * pType );
126 SvMetaClass * FindKnownClass( std::string_view aName );
127 void AddDepFile(OUString const& rFileName);
128 void WriteDepFile(SvFileStream & rStream, std::u16string_view rTarget);
129};
130
132{
133public:
134 explicit SvIdlWorkingBase( const SvCommand& rCmd );
135
136 bool WriteSfx( SvStream & );
137};
138
139#endif // INCLUDED_IDL_INC_DATABASE_HXX
140
141/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< SvStringHashTable > pIdTable
Definition: database.hxx:67
SvRefMemberList< SvMetaObject * > & GetStack()
Definition: database.hxx:106
SvMetaAttribute * FindKnownAttr(const SvIdentifier &)
Definition: database.cxx:351
OUString aPath
Definition: database.hxx:77
void SetAndWriteError(SvTokenStream &rInStm, const OString &rError)
Definition: database.cxx:101
SvMetaClass * ReadKnownClass(SvTokenStream &rInStm)
Definition: database.cxx:367
void AppendSlot(SvMetaSlot *pSlot)
Definition: database.cxx:503
SvRefMemberList< SvMetaModule * > & GetModuleList()
Definition: database.hxx:91
sal_uInt32 nUniqueId
Definition: database.hxx:64
void Push(SvMetaObject *pObj)
Definition: database.cxx:107
SvRefMemberList< SvMetaModule * > aModuleList
Definition: database.hxx:71
void SetPath(const OUString &s)
Definition: database.hxx:105
const OUString & GetPath() const
Definition: database.hxx:104
sal_uInt32 nVerbosity
Definition: database.hxx:65
SvIdlDataBase(const SvCommand &rCmd)
Definition: database.cxx:48
SvIdlError aError
Definition: database.hxx:78
void WriteDepFile(SvFileStream &rStream, std::u16string_view rTarget)
Definition: database.cxx:542
SvMetaAttribute * ReadKnownAttr(SvTokenStream &rInStm, SvMetaType *pType)
Definition: database.cxx:315
std::vector< OUString > aIdFileList
Definition: database.hxx:66
SvRefMemberList< SvMetaClass * > & GetClassList()
Definition: database.hxx:90
SvRefMemberList< SvMetaType * > & GetTypeList()
Definition: database.cxx:64
SvRefMemberList< SvMetaType * > aUsedTypes
Definition: database.hxx:94
OUString sSlotMapFile
Definition: database.hxx:84
void SetError(const SvIdlError &r)
Definition: database.hxx:101
sal_uInt32 GetUniqueId()
Definition: database.hxx:113
SvRefMemberList< SvMetaObject * > aContextStack
Definition: database.hxx:73
void StartNewFile(std::u16string_view rName)
Definition: database.cxx:497
void WriteError(SvTokenStream &rInStm)
Definition: database.cxx:400
SvRefMemberList< SvMetaSlot * > aSlotList
Definition: database.hxx:72
void WriteReset()
Definition: database.hxx:79
OUString aExportFile
Definition: database.hxx:63
void Write(const OString &rText) const
Definition: database.cxx:394
SvMetaType * FindType(std::string_view rName)
Definition: database.cxx:286
void AddDepFile(OUString const &rFileName)
Definition: database.cxx:509
SvRefMemberList< SvMetaClass * > aClassList
Definition: database.hxx:70
bool FindId(const OString &rIdName, sal_uInt32 *pVal)
Definition: database.cxx:112
SvMetaType * ReadKnownType(SvTokenStream &rInStm)
Definition: database.cxx:294
SvRefMemberList< SvMetaType * > aTypeList
Definition: database.hxx:69
void InsertId(const OString &rIdName, sal_uInt32 nVal)
Definition: database.cxx:126
SvMetaClass * FindKnownClass(std::string_view aName)
Definition: database.cxx:383
void SetExportFile(const OUString &rName)
Definition: database.hxx:97
const SvIdlError & GetError() const
Definition: database.hxx:100
bool ReadIdFile(std::string_view rFileName)
Definition: database.cxx:135
::std::set< OUString > m_DepFiles
Definition: database.hxx:76
const OString & GetText() const
Definition: database.hxx:45
sal_uInt32 nColumn
Definition: database.hxx:39
OString aText
Definition: database.hxx:37
SvIdlError(sal_uInt32 nL, sal_uInt32 nC)
Definition: database.hxx:42
sal_uInt32 nLine
Definition: database.hxx:39
bool IsError() const
Definition: database.hxx:47
void SetText(const OString &rT)
Definition: database.hxx:46
SvIdlWorkingBase(const SvCommand &rCmd)
Definition: database.cxx:467
bool WriteSfx(SvStream &)
Definition: database.cxx:472
SvIdlError aError
Definition: database.hxx:53
SvParseException(SvTokenStream const &rInStm, const OString &rError)
Definition: database.cxx:34
void clear()
Definition: basobj.hxx:51
Definition: lex.hxx:36