libreoffice-online/loolwsd/TileCache.hpp

42 lines
1.2 KiB
C++
Raw Normal View History

2015-03-12 09:18:35 -05:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_TILECACHE_HPP
#define INCLUDED_TILECACHE_HPP
#include <fstream>
#include <memory>
#include <string>
2015-03-12 09:18:35 -05:00
2015-03-12 18:34:42 -05:00
#include <Poco/Timestamp.h>
class TileCache
2015-03-12 09:18:35 -05:00
{
2015-03-12 18:34:42 -05:00
public:
TileCache(const std::string& docURL);
std::unique_ptr<std::fstream> lookupTile(int part, int width, int height, int tilePosX, int tilePosY, int tileWidth, int tileHeight);
void saveTile(int part, int width, int height, int tilePosX, int tilePosY, int tileWidth, int tileHeight, const char *data, size_t size);
2015-03-13 07:17:51 -05:00
std::string getStatus();
// The parameter is a status: message
2015-03-13 07:17:51 -05:00
void saveStatus(const std::string& status);
2015-03-12 18:34:42 -05:00
private:
std::string cacheDirName();
std::string cacheFileName(int part, int width, int height, int tilePosX, int tilePosY, int tileWidth, int tileHeight);
2015-03-12 18:34:42 -05:00
Poco::Timestamp getLastModified();
const std::string& _docURL;
2015-03-12 09:18:35 -05:00
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */