PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: LocalizationLoaderPL.h * 00003 * 00004 * Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLCORE_LOCALIZATIONLOADER_PL_H__ 00024 #define __PLCORE_LOCALIZATIONLOADER_PL_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLCore/Tools/LocalizationLoader.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLCore { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Forward declarations ] 00042 //[-------------------------------------------------------] 00043 class LocalizationGroup; 00044 00045 00046 //[-------------------------------------------------------] 00047 //[ Classes ] 00048 //[-------------------------------------------------------] 00049 /** 00050 * @brief 00051 * Localization loader implementation for the PixelLight localization XML file format 00052 */ 00053 class LocalizationLoaderPL : public LocalizationLoader { 00054 00055 00056 //[-------------------------------------------------------] 00057 //[ RTTI interface ] 00058 //[-------------------------------------------------------] 00059 pl_class(PLCORE_RTTI_EXPORT, LocalizationLoaderPL, "PLCore", PLCore::LocalizationLoader, "Localization loader implementation for the PixelLight localization XML file format") 00060 // Properties 00061 pl_properties 00062 pl_property("Formats", "loc,LOC") 00063 pl_property("Load", "1") 00064 pl_property("Save", "1") 00065 pl_properties_end 00066 // Constructors 00067 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00068 // Methods 00069 pl_method_2(Load, pl_ret_type(bool), LocalizationGroup&, File&, "Load method", "") 00070 pl_method_2(Save, pl_ret_type(bool), const LocalizationGroup&, File&, "Save method", "") 00071 pl_class_end 00072 00073 00074 //[-------------------------------------------------------] 00075 //[ Public RTTI methods ] 00076 //[-------------------------------------------------------] 00077 public: 00078 PLCORE_API bool Load(LocalizationGroup &cLocalizationGroup, File &cFile); 00079 PLCORE_API bool Save(const LocalizationGroup &cLocalizationGroup, File &cFile); 00080 00081 00082 //[-------------------------------------------------------] 00083 //[ Public functions ] 00084 //[-------------------------------------------------------] 00085 public: 00086 /** 00087 * @brief 00088 * Default constructor 00089 */ 00090 PLCORE_API LocalizationLoaderPL(); 00091 00092 /** 00093 * @brief 00094 * Destructor 00095 */ 00096 PLCORE_API virtual ~LocalizationLoaderPL(); 00097 00098 00099 //[-------------------------------------------------------] 00100 //[ Private functions ] 00101 //[-------------------------------------------------------] 00102 private: 00103 /** 00104 * @brief 00105 * Loader implementation for format version 1 00106 * 00107 * @param[in] cLocalizationGroup 00108 * Localization group to load into 00109 * @param[in] cLocalizationGroupElement 00110 * Localization group XML element to read the data from 00111 * 00112 * @return 00113 * 'true' if all went fine, else 'false' 00114 */ 00115 bool LoadV1(LocalizationGroup &cLocalizationGroup, const XmlElement &cLocalizationElement) const; 00116 00117 00118 }; 00119 00120 00121 //[-------------------------------------------------------] 00122 //[ Namespace ] 00123 //[-------------------------------------------------------] 00124 } // PLCore 00125 00126 00127 #endif // __PLCORE_LOCALIZATIONLOADER_PL_H__
|