LibreOffice Module codemaker (master) 1
includes.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#pragma once
21
22#include <rtl/ref.hxx>
23#include <rtl/ustring.hxx>
24#include <string_view>
25#include <vector>
26#include "dependencies.hxx"
27
28class FileStream;
29class TypeManager;
30
31namespace codemaker::cppumaker {
32
33class Includes {
34public:
37 Dependencies const & dependencies, bool hpp);
38
39 ~Includes();
40
41 void add(OString const & entityName);
42 void addCassert() { m_includeCassert = true; }
43 void addAny() { m_includeAny = true; }
45 void addSequence() { m_includeSequence = true; }
46 void addType() { m_includeType = true; }
61 void addCustom(const OUString& s) { m_custom.push_back(s); }
62 void dump(
63 FileStream & out, OUString const * companionHdl, bool exceptions);
64
65 static void dumpInclude(
66 FileStream & out, OString const & entityName, bool hpp);
67
68private:
69 Includes(Includes const &) = delete;
70 Includes& operator =(const Includes&) = delete;
71
72 bool isInterfaceType(std::string_view entityName) const;
73
76 bool m_hpp;
95 std::vector<OUString> m_custom;
96};
97
98}
99
100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A simple class to track which other entities a given entity depends on.
std::map< OUString, Kind > Map
void add(OString const &entityName)
Definition: includes.cxx:72
bool isInterfaceType(std::string_view entityName) const
Definition: includes.cxx:269
Includes(rtl::Reference< TypeManager > manager, Dependencies const &dependencies, bool hpp)
Definition: includes.cxx:41
Includes(Includes const &)=delete
static void dumpInclude(FileStream &out, OString const &entityName, bool hpp)
Definition: includes.cxx:262
void dump(FileStream &out, OUString const *companionHdl, bool exceptions)
Definition: includes.cxx:136
Includes & operator=(const Includes &)=delete
rtl::Reference< TypeManager > m_manager
Definition: includes.hxx:74
Dependencies::Map m_map
Definition: includes.hxx:75
void addCustom(const OUString &s)
Definition: includes.hxx:61
std::vector< OUString > m_custom
Definition: includes.hxx:95
rtl::Reference< ParseManager > manager