8a39da80b3
Added a cache management system for pre-processed PNG files along with unit tests. The cache system will be used if the --no-crunch flag is passed to AAPT during the package phase. The cache can be updated by a call to 'aapt crunch' (see usage statement). Also put in benchmarking code. Change-Id: I58271fb2ee2f5f9075fd74d4ff6f15e7afabd05c
40 lines
812 B
C++
40 lines
812 B
C++
//
|
|
// Copyright 2011 The Android Open Source Project
|
|
//
|
|
#ifndef MOCKCACHEUPDATER_H
|
|
#define MOCKCACHEUPDATER_H
|
|
|
|
#include <utils/String8.h>
|
|
#include "CacheUpdater.h"
|
|
|
|
using namespace android;
|
|
|
|
class MockCacheUpdater : public CacheUpdater {
|
|
public:
|
|
|
|
MockCacheUpdater()
|
|
: deleteCount(0), processCount(0) { };
|
|
|
|
// Make sure all the directories along this path exist
|
|
virtual void ensureDirectoriesExist(String8 path)
|
|
{
|
|
// Nothing to do
|
|
};
|
|
|
|
// Delete a file
|
|
virtual void deleteFile(String8 path) {
|
|
deleteCount++;
|
|
};
|
|
|
|
// Process an image from source out to dest
|
|
virtual void processImage(String8 source, String8 dest) {
|
|
processCount++;
|
|
};
|
|
|
|
// DATA MEMBERS
|
|
int deleteCount;
|
|
int processCount;
|
|
private:
|
|
};
|
|
|
|
#endif // MOCKCACHEUPDATER_H
|