예제 #1
0
void config_cache::write_file(std::string file_path, const preproc_map& defines)
{
	if(defines.empty()) {
		if(filesystem::file_exists(file_path)) {
			filesystem::delete_directory(file_path);
		}
		return;
	}

	filesystem::scoped_ostream stream = filesystem::ostream_file(file_path);
	config_writer writer(*stream, true, game_config::cache_compression_level);

	// Write all defines to stream.
	for(const preproc_map::value_type& define : defines) {
		define.second.write(writer, define.first);
	}
}
예제 #2
0
	void config_cache::write_file(std::string path, const preproc_map& defines_map)
	{
		if (defines_map.empty())
		{
			if (file_exists(path))
			{
				delete_directory(path);
			}
			return;
		}
		scoped_ostream stream = ostream_file(path);
		const bool gzip = true;
		config_writer writer(*stream, gzip, game_config::cache_compression_level);

		// write all defines to stream
		BOOST_FOREACH(const preproc_map::value_type &define, defines_map) {
			define.second.write(writer, define.first);
		}