Moved xml_auto_ptr from game_share to nel misc.

--HG--
branch : gui-refactoring
hg/feature/sse2
dfighter 13 years ago
parent 02b2da219d
commit b127966ffc

@ -0,0 +1,81 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef XML_AUTO_PTR_H
#define XML_AUTO_PTR_H
#include <string>
/** Simple auto pointer for xml pointers
*/
class CXMLAutoPtr
{
public:
CXMLAutoPtr(const char *value = NULL) : _Value(value) {}
CXMLAutoPtr(const unsigned char *value) : _Value((const char *) value) {}
~CXMLAutoPtr() { destroy(); }
operator const char *() const { return _Value; }
operator bool() const { return _Value != NULL; }
operator std::string() const { return std::string(_Value); }
bool operator ! () const { return _Value == NULL; }
operator const unsigned char *() const { return (const unsigned char *) _Value; }
char operator * () const { nlassert(_Value); return *_Value; }
/// NB : This remove previous owned pointer with xmlFree
CXMLAutoPtr &operator = (const char *other)
{
if (other == _Value) return *this;
destroy();
_Value = other;
return *this;
}
CXMLAutoPtr &operator = (const unsigned char *other)
{
*this = (const char *) other;
return *this;
}
char *getDatas() const { return const_cast<char *>(_Value); }
//////////////////////////////////////////////////
private:
const char *_Value;
private:
void destroy()
{
if (_Value)
{
xmlFree(const_cast<char *>(_Value));
_Value = NULL;
}
}
// We'd rather avoid problems
CXMLAutoPtr(const CXMLAutoPtr &/* other */)
{
nlassert(0);
}
CXMLAutoPtr&operator = (const CXMLAutoPtr &/* other */)
{
nlassert(0);
return *this;
}
};
#endif

@ -52,6 +52,7 @@
#include "nel/misc/stream.h"
#include "nel/misc/path.h"
#include "nel/misc/string_common.h"
//#include "nel/misc/xml_auto_ptr.h"
#ifdef NL_OS_WINDOWS
#define NOMINMAX

@ -30,7 +30,7 @@
//////////////
#include "cdb_branch.h"
#include "cdb_leaf.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
//#include <iostream.h>
#include "interface_v3/interface_manager.h"

@ -29,7 +29,7 @@
// Includes //
//////////////
#include "cdb_leaf.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
//#include <iostream.h>
#include "interface_v3/interface_manager.h"

@ -23,7 +23,7 @@
#include <libxml/parser.h>
#include "nel/misc/types_nl.h"
#include "nel/misc/debug.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include <map>
extern bool game_exit;

@ -19,7 +19,7 @@
#include "stdpch.h"
#include "ctrl_base.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "interface_manager.h"
using namespace NLMISC;

@ -20,7 +20,7 @@
#include "ctrl_base_button.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../time_client.h"
#include "lua_ihm.h"

@ -21,7 +21,7 @@
#include "ctrl_button.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
// ----------------------------------------------------------------------------
using namespace std;

@ -19,7 +19,7 @@
#include "stdpch.h"
#include "interface_manager.h"
#include "ctrl_col_pick.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace NLMISC;
using namespace std;

@ -19,7 +19,7 @@
#include "stdpch.h"
#include "interface_manager.h"
#include "ctrl_scroll.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "group_menu.h"
#include "lua_ihm.h"

@ -22,7 +22,7 @@
#include "ctrl_text_button.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "view_text.h"
#include "view_text_id.h"
#include "group_container.h"

@ -21,7 +21,7 @@
#include "ctrl_tooltip.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
// ----------------------------------------------------------------------------
using namespace std;

@ -43,7 +43,7 @@
#include "sbrick_manager.h"
#include "sphrase_manager.h"
#include "../client_sheets/sphrase_sheet.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "lua_ihm.h"
#include "../r2/editor.h"

@ -19,7 +19,7 @@
#include "stdpch.h"
#include "dbgroup_combo_box.h"
#include "group_menu.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "interface_manager.h"
#include "ctrl_button.h"
#include "action_handler.h"

@ -20,7 +20,7 @@
#include "dbgroup_list_sheet_text.h"
#include "group_container.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../sheet_manager.h"
#include "ctrl_button.h"
#include "view_text.h"

@ -17,7 +17,7 @@
#include "stdpch.h"
#include "dbgroup_list_sheet_text_brick_composition.h"
#include "../client_sheets/sbrick_sheet.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../string_manager_client.h"
#include "sbrick_manager.h"

@ -19,7 +19,7 @@
#include "stdpch.h"
#include "dbgroup_list_sheet_text_share.h"
#include "../client_sheets/sbrick_sheet.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "interface_manager.h"
#include "view_bitmap.h"
#include "ctrl_text_button.h"

@ -20,7 +20,7 @@
#include "dbgroup_list_sheet_trade.h"
#include "interface_manager.h"
#include "inventory_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../sheet_manager.h"
#include "ctrl_button.h"
#include "view_text.h"

@ -21,7 +21,7 @@
#include "dbview_bar.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;

@ -21,7 +21,7 @@
#include "dbview_bar3.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NL3D;

@ -20,7 +20,7 @@
#include "dbview_digit.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NL3D;

@ -20,7 +20,7 @@
#include "dbview_number.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NL3D;

@ -21,7 +21,7 @@
#include "dbview_quantity.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NL3D;

@ -23,7 +23,7 @@
#include "interface_element.h"
//#include "game_share/jobs.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;

@ -18,7 +18,7 @@
#include "stdpch.h"
//
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
//
#include "group_compas.h"
#include "interface_3d_scene.h"

@ -22,7 +22,7 @@
#include "group_container.h"
#include "interface_manager.h"
#include "interface_options.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "action_handler.h"
#include "../time_client.h"
#include "group_editbox.h"

@ -23,7 +23,7 @@
#include "input_handler_manager.h"
#include "nel/misc/command.h"
#include "view_text.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "interface_options.h"
#include "dbctrl_sheet.h"
#include "group_container.h"

@ -21,7 +21,7 @@
#include "group_frame.h"
#include "interface_manager.h"
#include "interface_element.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NLMISC;

@ -22,7 +22,7 @@
#include "stdpch.h"
#include "group_html_cs.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../client_cfg.h"
// used for login cookie to be sent to the web server

@ -22,7 +22,7 @@
#include "stdpch.h"
#include "group_html_forum.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../client_cfg.h"
#include "../user_entity.h"
#include "guild_manager.h"

@ -22,7 +22,7 @@
#include "stdpch.h"
#include "group_html_mail.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../client_cfg.h"
#include "../user_entity.h"
#include "interface_manager.h"

@ -22,7 +22,7 @@
#include "stdpch.h"
#include "group_html_qcm.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../client_cfg.h"
#include "interface_manager.h"
#include "../user_entity.h"

@ -17,7 +17,7 @@
#include "stdpch.h"
#include "group_html_webig.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../client_cfg.h"
#include "../user_entity.h"
#include "interface_manager.h"

@ -24,7 +24,7 @@
#include "group_in_scene.h"
#include "interface_manager.h"
#include "view_renderer.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NLMISC;

@ -29,7 +29,7 @@
#include "lua_ihm.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NLMISC;

@ -38,7 +38,7 @@
#include "../global.h"
#include "ctrl_quad.h"
//
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "game_share/mission_desc.h"
#include "game_share/inventories.h"
#include "game_share/animal_type.h"

@ -21,7 +21,7 @@
#include "interface_manager.h"
#include "interface_expr.h"
#include "group_menu.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "view_bitmap.h"
#include "action_handler.h" // Just for getAllParams
#include "lua_ihm.h"

@ -21,7 +21,7 @@
#include "group_modal.h"
#include "interface_manager.h"
#include "interface_element.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;

@ -30,7 +30,7 @@
#include "nel/misc/i_xml.h"
#include "nel/misc/i18n.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NLMISC;

@ -26,7 +26,7 @@
#include "game_share/skills.h"
#include "game_share/brick_families.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "skill_manager.h"
#include "sbrick_manager.h"

@ -27,7 +27,7 @@
#include "../libwww.h"
#include "interface_manager.h"
#include "action_handler.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../client_cfg.h"

@ -29,7 +29,7 @@
#include "dbview_bar.h"
#include "game_share/skills.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "skill_manager.h"
#include "nel/misc/i_xml.h"

@ -19,7 +19,7 @@
#include "stdpch.h"
#include "group_tab.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../time_client.h"
#include "interface_manager.h"

@ -29,7 +29,7 @@
#include "nel/misc/i_xml.h"
#include "nel/misc/i18n.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NLMISC;

@ -30,7 +30,7 @@
#include "nel/misc/i_xml.h"
#include "nel/misc/i18n.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NLMISC;

@ -22,7 +22,7 @@
#include "nel/misc/file.h"
#include "nel/misc/game_device_events.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "input_handler_manager.h"
#include "interface_manager.h"

@ -29,7 +29,7 @@
#include "nel/3d/u_particle_system_instance.h"
#include "nel/3d/u_animation_set.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "action_handler.h"
#include "lua_ihm.h"

@ -22,7 +22,7 @@
#include "interface_anim.h"
#include "interface_manager.h"
#include "interface_expr.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "action_handler.h"
#include "../time_client.h"

@ -25,7 +25,7 @@
#include "group_modal.h"
#include "../client_cfg.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
//
using namespace std;

@ -24,7 +24,7 @@
#include "group_container.h"
#include "../misc.h"
#include "interface_link.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "lua_ihm.h"
#include "nel/misc/mem_stream.h"
//

@ -20,7 +20,7 @@
#include "interface_group.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "group_container.h"
#include "group_editbox.h"
#include "group_scrolltext.h"

@ -21,7 +21,7 @@
#include "nel/misc/types_nl.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
/**

@ -22,7 +22,7 @@
#include "interface_options.h"
#include "interface_manager.h"
#include "group_menu.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../net_manager.h"
#include "../sheet_manager.h"
#include "../entity_animation_manager.h"

@ -27,7 +27,7 @@
#include "nel/misc/factory.h"
#include "nel/misc/big_file.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "interface_parser.h"
#include "interface_observer.h"

@ -20,7 +20,7 @@
#include "skill_manager.h"
#include "interface_manager.h"
#include "game_share/skills.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "game_share/character_title.h"
#include "game_share/fame.h"
#include "../sheet_manager.h"

@ -22,7 +22,7 @@
#include "view_bitmap.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "group_container.h"
// ----------------------------------------------------------------------------

@ -20,7 +20,7 @@
#include "view_bitmap_combo.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace NLMISC;

@ -19,7 +19,7 @@
#include "view_bitmap_faber_mp.h"
#include "interface_manager.h"
#include "../sheet_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
extern CSheetManager SheetMngr;

@ -28,7 +28,7 @@
#include "group_html.h"
#include "group_map.h"
//
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
//
#include "group_container.h"
#include "interface_3d_scene.h"

@ -22,7 +22,7 @@
#include "view_radar.h"
#include "interface_manager.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "group_container.h"
#include "../npc_icon.h"
#include "nel/misc/fast_floor.h"

@ -26,7 +26,7 @@
#include "group_container.h" // CCtrlResizer
#include "ctrl_tooltip.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "lua_ihm.h"
#include "lua_ihm.h"

@ -23,7 +23,7 @@
#include "../string_manager_client.h"
#include "action_handler_misc.h"
//
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
//
#include "nel/misc/i18n.h"

@ -22,7 +22,7 @@
#include "interface_manager.h"
#include "../string_manager_client.h"
#include "view_text_id.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include "../client_cfg.h"
#include "nel/misc/algo.h"

@ -22,7 +22,7 @@
#include "../string_manager_client.h"
#include "../user_entity.h"
#include "../entities.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace STRING_MANAGER;

@ -20,7 +20,7 @@
#include "generic_xml_msg_mngr.h"
#include "nel/misc/file.h"
#include "xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
using namespace std;
using namespace NLMISC;

@ -32,7 +32,7 @@
#include "nel/misc/o_xml.h"
#include "nel/misc/i_xml.h"
#include "nel/misc/algo.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"

@ -30,7 +30,7 @@
//////////////
#include "player_manager/cdb_branch.h"
#include "player_manager/cdb_leaf.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include <libxml/parser.h>
////////////////

@ -29,7 +29,7 @@
// Includes //
//////////////
#include "player_manager/cdb_leaf.h"
#include "game_share/xml_auto_ptr.h"
#include "nel/misc/xml_auto_ptr.h"
#include <libxml/parser.h>

Loading…
Cancel
Save