js_serializer.hpp File Reference

#include <s11n.net/s11n/traits.hpp>
#include <stdexcept>
#include <sstream>

Go to the source code of this file.

Namespaces

namespace  s11n
namespace  s11n::io
namespace  s11n::io::sharing

Classes

struct  s11n::io::sharing::js_sharing_context
 Sharing context used by expat_serializer. More...
class  s11n::io::js_serializer< NodeType >
 js_serializer writes objects to a Javascript dialect. More...

Defines

#define s11n_JS_SERIALIZER_HPP_INCLUDED   1
#define MAGIC_COOKIE_JS   "// s11n::io::js_serializer"
 MAGIC_COOKIE_JS defines the magic-cookie which prefixes each file output by the js_serializer.
#define INDENT(LEVEL, ECHO)   indent = ""; for( size_t i = 0; i < depth + LEVEL; i++ ) { indent += '\t'; if(ECHO) dest << '\t'; }

Functions

std::string s11n::io::quote_js_string (std::string const &s)
 An attempt to quote s as a JS string:.


Define Documentation

#define INDENT ( LEVEL,
ECHO   )     indent = ""; for( size_t i = 0; i < depth + LEVEL; i++ ) { indent += '\t'; if(ECHO) dest << '\t'; }

#define MAGIC_COOKIE_JS   "// s11n::io::js_serializer"

MAGIC_COOKIE_JS defines the magic-cookie which prefixes each file output by the js_serializer.

If the magic cookie associated with a Serializer changes, older versions of the serializer will not be able to read the file. Since js_serializer is write-only, this is not a specific problem for this serializer, but it should not be changed without careful consideration nonetheless.

Note that this macro is undef'd at the end of this file, and is therefore unavailable to client code.

Definition at line 18 of file js_serializer.hpp.

Referenced by s11n::io::js_serializer< NodeType >::js_serializer().

#define s11n_JS_SERIALIZER_HPP_INCLUDED   1

Definition at line 2 of file js_serializer.hpp.


Generated on Sun Apr 27 13:16:04 2008 for libs11n by  doxygen 1.5.3