X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=include%2Fimap.h;h=4661a794768fb349f2bf3247aee9567dfbedfec9;hp=c97a2ff2a326048f49fa0c5dbbc4b2a8298f8109;hb=HEAD;hpb=cc6bdd4869b80171d5690094f46254ecc2a2e860 diff --git a/include/imap.h b/include/imap.h index c97a2ff2..4661a794 100644 --- a/include/imap.h +++ b/include/imap.h @@ -1,25 +1,25 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. + Copyright (C) 2001-2006, William Joseph. + All Rights Reserved. -This file is part of GtkRadiant. + This file is part of GtkRadiant. -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + GtkRadiant is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -GtkRadiant 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 General Public License for more details. + GtkRadiant 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 General Public License for more details. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ + You should have received a copy of the GNU General Public License + along with GtkRadiant; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ -#if !defined(INCLUDED_IMAP_H) +#if !defined( INCLUDED_IMAP_H ) #define INCLUDED_IMAP_H #include "generic/constant.h" @@ -31,18 +31,18 @@ class TokenWriter; class MapImporter { public: - STRING_CONSTANT(Name, "MapImporter"); +STRING_CONSTANT( Name, "MapImporter" ); - virtual bool importTokens(Tokeniser& tokeniser) = 0; +virtual bool importTokens( Tokeniser& tokeniser ) = 0; }; /// \brief A node whose state can be exported to a token stream. class MapExporter { public: - STRING_CONSTANT(Name, "MapExporter"); +STRING_CONSTANT( Name, "MapExporter" ); - virtual void exportTokens(TokenWriter& writer) const = 0; +virtual void exportTokens( TokenWriter& writer ) const = 0; }; #include "iscenegraph.h" @@ -53,20 +53,21 @@ class TextInputStream; class TextOutputStream; -typedef void(*GraphTraversalFunc)(scene::Node& root, const scene::Traversable::Walker& walker); +typedef void ( *GraphTraversalFunc )( scene::Node& root, const scene::Traversable::Walker& walker ); /// \brief A module that reads and writes a map in a specific format. class MapFormat { public: - INTEGER_CONSTANT(Version, 2); - STRING_CONSTANT(Name, "map"); - mutable bool wrongFormat; - - /// \brief Read a map graph into \p root from \p outputStream, using \p entityTable to create entities. - virtual void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const = 0; - /// \brief Write the map graph obtained by applying \p traverse to \p root into \p outputStream. - virtual void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const = 0; +virtual ~MapFormat() = default; +INTEGER_CONSTANT( Version, 2 ); +STRING_CONSTANT( Name, "map" ); +mutable bool wrongFormat; + +/// \brief Read a map graph into \p root from \p outputStream, using \p entityTable to create entities. +virtual void readGraph( scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable ) const = 0; +/// \brief Write the map graph obtained by applying \p traverse to \p root into \p outputStream. +virtual void writeGraph( scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream, bool writeComments ) const = 0; };