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 | |
Adam Lesinski | ce5e56e | 2016-10-21 17:56:45 -0700 | [diff] [blame] | 20 | #include <iostream> |
| 21 | #include <list> |
| 22 | #include <sstream> |
| 23 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 24 | #include "Diagnostics.h" |
| 25 | #include "NameMangler.h" |
| 26 | #include "Resource.h" |
| 27 | #include "ResourceValues.h" |
| 28 | #include "Source.h" |
| 29 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 30 | namespace aapt { |
| 31 | |
| 32 | class ResourceTable; |
Adam Lesinski | 64587af | 2016-02-18 18:33:06 -0800 | [diff] [blame] | 33 | class SymbolTable; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 34 | |
| 35 | struct IAaptContext { |
Adam Lesinski | cacb28f | 2016-10-19 12:18:14 -0700 | [diff] [blame] | 36 | virtual ~IAaptContext() = default; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 37 | |
Adam Lesinski | ce5e56e | 2016-10-21 17:56:45 -0700 | [diff] [blame] | 38 | virtual SymbolTable* GetExternalSymbols() = 0; |
| 39 | virtual IDiagnostics* GetDiagnostics() = 0; |
| 40 | virtual const std::string& GetCompilationPackage() = 0; |
| 41 | virtual uint8_t GetPackageId() = 0; |
| 42 | virtual NameMangler* GetNameMangler() = 0; |
| 43 | virtual bool IsVerbose() = 0; |
| 44 | virtual int GetMinSdkVersion() = 0; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | struct IResourceTableConsumer { |
Adam Lesinski | cacb28f | 2016-10-19 12:18:14 -0700 | [diff] [blame] | 48 | virtual ~IResourceTableConsumer() = default; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 49 | |
Adam Lesinski | ce5e56e | 2016-10-21 17:56:45 -0700 | [diff] [blame] | 50 | virtual bool Consume(IAaptContext* context, ResourceTable* table) = 0; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | namespace xml { |
Adam Lesinski | 5eeaadd | 2016-08-25 12:26:56 -0700 | [diff] [blame] | 54 | class XmlResource; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 55 | } |
| 56 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 57 | struct IXmlResourceConsumer { |
Adam Lesinski | cacb28f | 2016-10-19 12:18:14 -0700 | [diff] [blame] | 58 | virtual ~IXmlResourceConsumer() = default; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 59 | |
Adam Lesinski | ce5e56e | 2016-10-21 17:56:45 -0700 | [diff] [blame] | 60 | virtual bool Consume(IAaptContext* context, xml::XmlResource* resource) = 0; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 61 | }; |
| 62 | |
Adam Lesinski | cacb28f | 2016-10-19 12:18:14 -0700 | [diff] [blame] | 63 | } // namespace aapt |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 64 | |
| 65 | #endif /* AAPT_PROCESS_IRESOURCETABLECONSUMER_H */ |