1fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski/* 2fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * Copyright (C) 2014 The Android Open Source Project 3fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * 4fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * Licensed under the Apache License, Version 2.0 (the "License"); 5fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * you may not use this file except in compliance with the License. 6fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * You may obtain a copy of the License at 7fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * 8fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * http://www.apache.org/licenses/LICENSE-2.0 9fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * 10fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * Unless required by applicable law or agreed to in writing, software 11fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * distributed under the License is distributed on an "AS IS" BASIS, 12fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * See the License for the specific language governing permissions and 14fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski * limitations under the License. 15fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski */ 16fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 17fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski#ifndef __OUTPUT_SET_H 18fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski#define __OUTPUT_SET_H 19fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 20fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski#include <set> 21fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski#include <utils/Errors.h> 22fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski#include <utils/String8.h> 23fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski#include <utils/StrongPointer.h> 24fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 25fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinskiclass AaptFile; 26fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 27fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinskiclass OutputEntry { 28fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinskipublic: 29fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski OutputEntry() {} 30fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski OutputEntry(const android::String8& path, const android::sp<const AaptFile>& file) 31fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski : mPath(path), mFile(file) {} 32fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 33fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski inline const android::sp<const AaptFile>& getFile() const { 34fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski return mFile; 35fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski } 36fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 37fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski inline const android::String8& getPath() const { 38fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski return mPath; 39fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski } 40fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 41fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski bool operator<(const OutputEntry& o) const { return getPath() < o.mPath; } 42fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski bool operator==(const OutputEntry& o) const { return getPath() == o.mPath; } 43fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 44fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinskiprivate: 45fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski android::String8 mPath; 46fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski android::sp<const AaptFile> mFile; 47fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski}; 48fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 49fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinskiclass OutputSet : public virtual android::RefBase { 50fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinskipublic: 51fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski virtual const std::set<OutputEntry>& getEntries() const = 0; 52fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 53fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski virtual ~OutputSet() {} 54fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski}; 55fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski 56fab50875b98e8274ac8ee44b38ba42521bbbf1f9Adam Lesinski#endif // __OUTPUT_SET_H 57