blob: 9c4b323db4334feb5db201f2a1d1762f67442f38 [file] [log] [blame]
Adam Lesinski1ab598f2015-08-14 14:26:04 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef AAPT_PROCESS_IRESOURCETABLECONSUMER_H
18#define AAPT_PROCESS_IRESOURCETABLECONSUMER_H
19
Adam Lesinskice5e56e2016-10-21 17:56:45 -070020#include <iostream>
21#include <list>
Udam Sainib228df32019-06-18 16:50:34 -070022#include <set>
Adam Lesinskice5e56e2016-10-21 17:56:45 -070023#include <sstream>
24
Adam Lesinski1ab598f2015-08-14 14:26:04 -070025#include "Diagnostics.h"
26#include "NameMangler.h"
27#include "Resource.h"
28#include "ResourceValues.h"
29#include "Source.h"
30
Adam Lesinski1ab598f2015-08-14 14:26:04 -070031namespace aapt {
32
33class ResourceTable;
Adam Lesinski64587af2016-02-18 18:33:06 -080034class SymbolTable;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070035
Adam Lesinskib522f042017-04-21 16:57:59 -070036// The type of package to build.
37enum class PackageType {
38 kApp,
39 kSharedLib,
40 kStaticLib,
41};
42
Adam Lesinski1ab598f2015-08-14 14:26:04 -070043struct IAaptContext {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070044 virtual ~IAaptContext() = default;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070045
Adam Lesinskib522f042017-04-21 16:57:59 -070046 virtual PackageType GetPackageType() = 0;
Adam Lesinskice5e56e2016-10-21 17:56:45 -070047 virtual SymbolTable* GetExternalSymbols() = 0;
48 virtual IDiagnostics* GetDiagnostics() = 0;
49 virtual const std::string& GetCompilationPackage() = 0;
50 virtual uint8_t GetPackageId() = 0;
51 virtual NameMangler* GetNameMangler() = 0;
52 virtual bool IsVerbose() = 0;
53 virtual int GetMinSdkVersion() = 0;
Udam Sainib228df32019-06-18 16:50:34 -070054 virtual const std::set<std::string>& GetSplitNameDependencies() = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070055};
56
57struct IResourceTableConsumer {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070058 virtual ~IResourceTableConsumer() = default;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070059
Adam Lesinskice5e56e2016-10-21 17:56:45 -070060 virtual bool Consume(IAaptContext* context, ResourceTable* table) = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070061};
62
63namespace xml {
Adam Lesinski5eeaadd2016-08-25 12:26:56 -070064class XmlResource;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070065}
66
Adam Lesinski1ab598f2015-08-14 14:26:04 -070067struct IXmlResourceConsumer {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070068 virtual ~IXmlResourceConsumer() = default;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070069
Adam Lesinskice5e56e2016-10-21 17:56:45 -070070 virtual bool Consume(IAaptContext* context, xml::XmlResource* resource) = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070071};
72
Adam Lesinskicacb28f2016-10-19 12:18:14 -070073} // namespace aapt
Adam Lesinski1ab598f2015-08-14 14:26:04 -070074
75#endif /* AAPT_PROCESS_IRESOURCETABLECONSUMER_H */