aboutsummaryrefslogtreecommitdiff
path: root/src/client/filecache.h
blob: 96e4c8ba1b6c14a6f3d0ae8dad1304390755d01b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2013 Jonathan Neuschäfer <j.neuschaefer@gmx.net>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#pragma once

#include <iostream>
#include <string>

class FileCache
{
public:
	/*
		'dir' is the file cache directory to use.
	*/
	FileCache(const std::string &dir) : m_dir(dir) {}

	bool update(const std::string &name, const std::string &data);
	bool load(const std::string &name, std::ostream &os);

private:
	std::string m_dir;

	bool loadByPath(const std::string &path, std::ostream &os);
	bool updateByPath(const std::string &path, const std::string &data);
};
/noise.cpp?h=gpcf&id=37ca3212eee6d70a54493168014f9254cc6e8f37'>Fix MSVC compatibilitykwolekr2015-04-29 * Noise: Fix PcgRandom::randNormalDist() when range contains negative numberskwolekr2015-04-27 * Replace PRNG assertions with PrngExceptionkwolekr2015-04-27 * Noise: Add noise unittestskwolekr2015-04-21 * Noise: Correct noise objects created with invalid dimensionskwolekr2015-04-19 * Fix endianness inconsistency with PcgRandom::bytes()kwolekr2015-03-23 * Fix some loose ends from 3993093fkwolekr2015-03-22 * Add support for the PCG32 PRNG algo (and associated script APIs)kwolekr2015-03-22 * Noise: Don't assume Noise is used for 2D unless gradientMap2D is actually calledkwolekr2014-12-14 * Clean up Noise macroskwolekr2014-12-11 * Noise: Automatically transform noise maps if neededkwolekr2014-12-10 * Noise: Create a deep copy of NoiseParamskwolekr2014-12-10 * Noise: Update Noise::resizeNoiseBuf to account for lacunarity not equal to 2kwolekr2014-12-09 * Optimize noise implementationskwolekr2014-12-08 * Add flags and lacunarity as new noise parameterskwolekr2014-12-07 * noise: Throw exception on noise allocation failurekwolekr2014-11-29 * Add eased 3d point-value noise functionskwolekr2014-11-12 * Add mgv5. New noise code, uses biome API. Eased 3d noise for terrain, caves, ...paramat2014-11-08 * Change license of noise implementation to Simplified BSDkwolekr2014-10-27 * Add support for eased 3d noisekwolekr2014-10-27 * Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14 * Add Mapgen V7, reorganize biomeskwolekr2013-04-07 * Fix most warnings, re-fix MSVC compile errorkwolekr2013-02-26 * Update Copyright YearsSfan52013-02-24 * Change Minetest-c55 to MinetestPilzAdam2013-02-24 * Fix and improve noise map functionskwolekr2013-02-06 * Finish and clean up mapgen configurationkwolekr2013-01-21 * Readded and optimized mapgen V6kwolekr2013-01-21 * Cleaned & enhanced noise object managementkwolekr2013-01-21 * Add initial Lua biomedef support, fixed biome selectionkwolekr2013-01-21