aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/FindSQLite3.cmake
blob: b23553a807cf7af6634c8b77c4259c8341a67af9 (plain)
1
2
3
4
5
6
7
8
9
mark_as_advanced(SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR) 

find_path(SQLITE3_INCLUDE_DIR sqlite3.h)

find_library(SQLITE3_LIBRARY NAMES sqlite3)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)

f='#n55'>55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
/*
Minetest-c55
Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>

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.
*/

#ifndef NAMEIDMAPPING_HEADER
#define NAMEIDMAPPING_HEADER

#include <string>
#include <iostream>
#include <set>
#include <map>
#include "irrlichttypes_bloated.h"

class NameIdMapping
{
public:
	void serialize(std::ostream &os) const;
	void deSerialize(std::istream &is);
	
	void clear(){
		m_id_to_name.clear();
		m_name_to_id.clear();
	}
	void set(u16 id, const std::string &name){
		m_id_to_name[id] = name;
		m_name_to_id[name] = id;
	}
	void removeId(u16 id){
		std::string name;
		bool found = getName(id, name);
		if(!found) return;
		m_id_to_name.erase(id);
		m_name_to_id.erase(name);
	}
	void eraseName(const std::string &name){
		u16 id;
		bool found = getId(name, id);
		if(!found) return;
		m_id_to_name.erase(id);