00001 /* $Id: validation.hpp 53187 2012-02-24 06:45:03Z shadowmaster $ */ 00002 /* 00003 Copyright (C) 2003 - 2008 by David White <dave@whitevine.net> 00004 2008 - 2012 by Ignacio R. Morelle <shadowm2006@gmail.com> 00005 Part of the Battle for Wesnoth Project http://www.wesnoth.org/ 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY. 00013 00014 See the COPYING file for more details. 00015 */ 00016 00017 #ifndef ADDON_VALIDATION_HPP_INCLUDED 00018 #define ADDON_VALIDATION_HPP_INCLUDED 00019 00020 #include <vector> 00021 #include <string> 00022 00023 class config; 00024 00025 /** 00026 * Default port number for the addon server. 00027 * 00028 * @note This might not be the best place to declare the variable, but it's 00029 * one of the few files shared by the server and the game. 00030 */ 00031 extern const unsigned short default_campaignd_port; 00032 00033 /** 00034 * Values used for add-on classification; UI-only 00035 * at the moment, in the future it could be used for 00036 * directory allocation too, removing the need for 00037 * the ADDON_GROUP constants (TODO). 00038 * 00039 * @note If you change the order or content of these, you'll also need 00040 * to update the @a addon_type_strings table found in validation.cpp. 00041 */ 00042 enum ADDON_TYPE { 00043 ADDON_UNKNOWN, /**< a.k.a. anything. */ 00044 ADDON_SP_CAMPAIGN, /**< Single-player campaign. */ 00045 ADDON_SP_SCENARIO, /**< Single-player scenario. */ 00046 ADDON_MP_CAMPAIGN, /**< Multiplayer campaign. */ 00047 ADDON_MP_SCENARIO, /**< Multiplayer scenario. */ 00048 ADDON_MP_MAPS, /**< Multiplayer plain (no WML) map pack. */ 00049 ADDON_MP_ERA, /**< Multiplayer era. */ 00050 ADDON_MP_FACTION, /**< Multiplayer faction. */ 00051 // NOTE: following two still require proper engine support 00052 //ADDON_MOD, // Modification of the game for SP and/or MP. 00053 //ADDON_GUI, // GUI add-ons/themes. 00054 ADDON_MEDIA, /**< Miscellaneous content/media (unit packs, terrain packs, music packs, etc.). */ 00055 ADDON_OTHER, /**< an add-on that fits in no other category */ 00056 ADDON_TYPES_COUNT 00057 }; 00058 00059 ADDON_TYPE get_addon_type(const std::string& str); 00060 std::string get_addon_type_string(ADDON_TYPE type); 00061 00062 /** Checks whether an add-on name is legal or not. */ 00063 bool addon_name_legal(const std::string& name); 00064 /** Probes an add-on archive for illegal names. */ 00065 bool check_names_legal(const config& dir); 00066 00067 std::string encode_binary(const std::string& str); 00068 std::string unencode_binary(const std::string& str); 00069 bool needs_escaping(char c); 00070 00071 #endif /* !ADDON_CHECKS_HPP_INCLUDED */
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:39 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |