Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 20 | #include "Diagnostics.h" |
| 21 | #include "NameMangler.h" |
| 22 | #include "Resource.h" |
| 23 | #include "ResourceValues.h" |
| 24 | #include "Source.h" |
| 25 | |
| 26 | #include <iostream> |
| 27 | #include <list> |
| 28 | #include <sstream> |
| 29 | |
| 30 | namespace aapt { |
| 31 | |
| 32 | class ResourceTable; |
| 33 | struct ISymbolTable; |
| 34 | |
| 35 | struct IAaptContext { |
| 36 | virtual ~IAaptContext() = default; |
| 37 | |
| 38 | virtual ISymbolTable* getExternalSymbols() = 0; |
| 39 | virtual IDiagnostics* getDiagnostics() = 0; |
| 40 | virtual StringPiece16 getCompilationPackage() = 0; |
| 41 | virtual uint8_t getPackageId() = 0; |
| 42 | virtual NameMangler* getNameMangler() = 0; |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame^] | 43 | virtual bool verbose() = 0; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | struct IResourceTableConsumer { |
| 47 | virtual ~IResourceTableConsumer() = default; |
| 48 | |
| 49 | virtual bool consume(IAaptContext* context, ResourceTable* table) = 0; |
| 50 | }; |
| 51 | |
| 52 | namespace xml { |
Adam Lesinski | 467f171 | 2015-11-16 17:35:44 -0800 | [diff] [blame] | 53 | struct XmlResource; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 54 | } |
| 55 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 56 | struct IXmlResourceConsumer { |
| 57 | virtual ~IXmlResourceConsumer() = default; |
| 58 | |
Adam Lesinski | 467f171 | 2015-11-16 17:35:44 -0800 | [diff] [blame] | 59 | virtual bool consume(IAaptContext* context, xml::XmlResource* resource) = 0; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | } // namespace aapt |
| 63 | |
| 64 | #endif /* AAPT_PROCESS_IRESOURCETABLECONSUMER_H */ |