40 #ifndef _serialization_h
41 #define _serialization_h
289 template <
class Serializable>
304 virtual void ProtoSerializeAll(
XML::Node& CurrentRoot)
const = 0;
313 ProtoSerializeAll(Doc);
322 virtual void ProtoSerialize(
const Serializable& Target,
XML::Node& CurrentRoot) = 0;
328 virtual std::ostream&
Serialize(std::ostream& Stream,
const Serializable& Target)
332 ProtoSerialize(Target,Doc);
350 template <
class DeSerializable>
363 while(SingleItemNode)
365 ProtoDeSerialize(SingleItemNode);
386 virtual DeSerializable* ProtoDeSerialize(
const XML::Node& OneNode) = 0;
402 virtual String ContainerName()
const = 0;
416 Converted.ProtoSerialize(Doc);
417 Doc.
Print(Stream, Indent.c_str());
447 std::stringstream Depot;
478 std::ostream& MEZZ_LIB operator<< <Mezzanine::XML::Node> (std::ostream& Stream, const Mezzanine::XML::Node& OneNode)
480 OneNode.Print(Stream);
String GetOneTag(std::istream &stream)
Gets the first tag out of the Stream and returns it as a String.
virtual std::ostream & Serialize(std::ostream &Stream, const Serializable &Target)
Output the specified member to a stream.
virtual std::istream & DeSerializeAll(std::istream &Stream)
Get One node that has several of the appropriate kinds of nodes as children and deserialize all of th...
virtual void ProtoDeSerializeAll(const XML::Node &OneNode)
Convert An XML Node into a complete series of live class instances.
bool Boole
Generally acts a single bit, true or false.
void Print(Writer &WriterInstance, const Char8 *indent="\t", unsigned int flags=FormatDefault, Encoding DocumentEncoding=EncodingAuto, unsigned int Depth=0) const
Output the XML document using a Writer.
A tool for serializing classes with specific issues serializing.
Document * PreParseClassFromSingleTag(const String &NameSpace, const String &ClassName, const String &OneTag)
Perform a basic series of checks for extracting meaning from a single xml tag.
Node GetFirstChild() const
Get the first child Node of this Node.
All the definitions for datatypes as well as some basic conversion functions are defined here...
std::ostream & Serialize(std::ostream &Stream, const T &Converted, const String &Indent=String(""))
Convert any class that supports serialization or has a serializer to a string of chars in a stream...
A simple reference counting pointer.
virtual std::ostream & SerializeAll(std::ostream &Stream) const
Output the complete serialized data to a stream.
ParseResult Load(std::basic_istream< char, std::char_traits< char > > &stream, unsigned int options=ParseDefault, Encoding DocumentEncoding=EncodingAuto)
Load XML from a stream.
Node GetNextSibling() const
Attempt to retrieve the next sibling of this Node.
Node DocumentElement() const
Get document element.
virtual std::istream & DeSerialize(std::istream &Stream)
Get the serialized version of all the live data from the stream.
A light-weight handle for manipulating nodes in DOM tree.
This file describes and implements a reference counted pointer that is NOT threadsafe.
std::istream & DeSerialize(std::istream &Stream, T &Converted)
Deserialize the next xml tag in the stream into a specific in memory class instance.
void DeSerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
The root node of any xml hierarchy is a Document.
A tool for deserializing classes with specific issues deserializing them.
The bulk of the engine components go in this namspace.
void SloppyProtoSerialize(const T &Converted, XML::Node &CurrentRoot)
Used to interface with a previous version of the serialization code.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
std::string String
A datatype used to a series of characters.
Attribute AppendCopy(const Attribute &proto)
Copies an Attribute and puts the copy at the end of this Nodes attributes.